diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 636073e..b9d0d00 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -2,4 +2,5 @@ vim.cmd('source ~/.vim/init/general.vim') require 'init.plugins' require 'init.gitsigns' +require 'init.treesitter' require 'init.lsp_and_cmp' diff --git a/.config/nvim/lua/init/gitsigns.lua b/.config/nvim/lua/init/gitsigns.lua index ff72b93..8ad5c76 100644 --- a/.config/nvim/lua/init/gitsigns.lua +++ b/.config/nvim/lua/init/gitsigns.lua @@ -1,48 +1,48 @@ local status_ok, gitsigns = pcall(require, "gitsigns") if not status_ok then - return + return end gitsigns.setup { - signs = { - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, + signs = { + add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, + change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, + changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, + }, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter_opts = { + relative_time = false, + }, + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { + enable = false, + }, } diff --git a/.config/nvim/lua/init/plugins.lua b/.config/nvim/lua/init/plugins.lua index 594aacc..b3c9a93 100644 --- a/.config/nvim/lua/init/plugins.lua +++ b/.config/nvim/lua/init/plugins.lua @@ -1,8 +1,14 @@ -vim.cmd('colorscheme nord') vim.cmd('source ~/.vim/init/vimtex.vim') -require 'plugins' -require 'lualine'.setup{} +vim.g.nord_borders = true + +require('plugins') +require('nord').set() +require('lualine').setup { + options = { + theme = 'nord', + } +} vim.cmd [[ "" Snippets @@ -12,3 +18,27 @@ vim.cmd [[ smap snippy#can_jump(-1) ? '(snippy-previous)' : '' xmap (snippy-cut-text) ]] + +-- You dont need to set any of these options. These are the default ones. Only +-- the loading is important +require('telescope').setup { + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + } + } +} +-- To get fzf loaded and working with telescope, you need to call +-- load_extension, somewhere after setup function: +require('telescope').load_extension('fzf') + +vim.cmd [[ + nnoremap ff lua require('telescope.builtin').find_files() + nnoremap fg lua require('telescope.builtin').live_grep() + nnoremap fb lua require('telescope.builtin').buffers() + nnoremap fh lua require('telescope.builtin').help_tags() +]] diff --git a/.config/nvim/lua/init/treesitter.lua b/.config/nvim/lua/init/treesitter.lua new file mode 100644 index 0000000..9ab0bcf --- /dev/null +++ b/.config/nvim/lua/init/treesitter.lua @@ -0,0 +1,25 @@ +local ok, configs = pcall(require, "nvim-treesitter.configs") +if not ok then + return +end + +configs.setup { + ensure_installed = { + "c", "cpp", "lua", "scheme", "vue", "javascript", "pug" + }, + sync_install = false, + ignore_install = { "" }, + autopairs = { + enable = true, + }, + highlight = { + enable = true, + disable = { "" }, + additional_vim_regex_highlighting = true, + }, + indent = { enable = true, disable = { "yaml" } }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, +} diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index e2c904d..b11d662 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -41,4 +41,11 @@ return require('packer').startup(function() -- Another tools -- use 'MunifTanjim/nui.nvim' -- UI framework + + use { + 'nvim-telescope/telescope.nvim', tag = '0.1.0', + requires = { {'nvim-lua/plenary.nvim'} } + } + + use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } end)