diff --git a/nvim/init.lua b/nvim/init.lua index c2f95cc..d15159e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -12,6 +12,7 @@ require('autocompletion') require('treesitterconfig') require('troubleconfig') require('null-ls-config') +require('gitsigns-config') require('filemanager') require('notes') require('zenmode') diff --git a/nvim/lua/autocompletion.lua b/nvim/lua/autocompletion.lua index b9e1f1f..343e74d 100644 --- a/nvim/lua/autocompletion.lua +++ b/nvim/lua/autocompletion.lua @@ -30,6 +30,31 @@ cmp.setup({ }) }) +-- Use buffer source for `vimwiki` +cmp.setup.cmdline('vimwiki', { + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' } + } +}) + +cmp.setup.cmdline('md', { + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' } + } +}) + +cmp.setup.cmdline('tex', { + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' } + } +}) + -- Use buffer source for `/` cmp.setup.cmdline('/', { sources = { diff --git a/nvim/lua/gitsigns-config.lua b/nvim/lua/gitsigns-config.lua new file mode 100644 index 0000000..707e243 --- /dev/null +++ b/nvim/lua/gitsigns-config.lua @@ -0,0 +1,41 @@ +require('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 = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + yadm = { + enable = false + }, +}) diff --git a/nvim/lua/null-ls-config.lua b/nvim/lua/null-ls-config.lua index 7191cd9..79b06ca 100644 --- a/nvim/lua/null-ls-config.lua +++ b/nvim/lua/null-ls-config.lua @@ -1,12 +1,16 @@ -require("null-ls").setup({ +local null_ls = require("null-ls") + +null_ls.setup({ sources = { -- FORMATTING - require("null-ls").builtins.formatting.stylua, - require("null-ls").builtins.formatting.eslint, - require("null-ls").builtins.formatting.prettierd, + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.eslint, + null_ls.builtins.formatting.prettierd, -- DIAGNOSTICS - require("null-ls").builtins.diagnostics.eslint, + null_ls.builtins.diagnostics.eslint, -- COMPLETIONS - require("null-ls").builtins.completion.spell, + null_ls.builtins.completion.spell, + -- CODE ACTIONS + null_ls.builtins.code_actions.gitsigns }, }) diff --git a/nvim/lua/pluginoptions.lua b/nvim/lua/pluginoptions.lua index 7fd3db3..83a4d96 100644 --- a/nvim/lua/pluginoptions.lua +++ b/nvim/lua/pluginoptions.lua @@ -1,12 +1,5 @@ -- SETUP FO VARIOUS PLUGIN OPTIONS --- GITGUTTER SETUP --- ========================= -vim.api.nvim_set_var('gitgutter_sign_added', '∙') -vim.api.nvim_set_var('gitgutter_sign_modified', '∙') -vim.api.nvim_set_var('gitgutter_sign_removed', '∙') -vim.api.nvim_set_var('gitgutter_sign_modified_removed', '∙') - vim.cmd [[ augroup VimDiff autocmd! diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 1890230..4eeebca 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -48,8 +48,8 @@ Plug 'vimwiki/vimwiki' -- git Plug 'tpope/vim-fugitive' --- vim gitgutter -Plug 'airblade/vim-gitgutter' +-- git signs +Plug 'lewis6991/gitsigns.nvim' -- COLORS -- ===================