From 36c42a18b4f19df545755cb5447667a16d6e8875 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 5 Aug 2025 22:10:03 -0400 Subject: Add back barbar --- nvim/.config/nvim/lazy-lock.json | 28 ++++++------ nvim/.config/nvim/lua/plugins/barbar.lua | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 nvim/.config/nvim/lua/plugins/barbar.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index f8142c7..dee4742 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,35 +1,35 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, - "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, - "blink.cmp": { "branch": "main", "commit": "586ee87534f5bf65f1c8dea2d1da2a57e8cddd36" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" }, + "fidget.nvim": { "branch": "main", "commit": "4ec7bed6c86b671ddde03ca1b227343cfa3e65fa" }, + "gitsigns.nvim": { "branch": "main", "commit": "736f51d2bb684c06f39a2032f064d7244f549981" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "5fcd0dfdcf55d8a1c1a02cccc14ee5d79728a496" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "844d247d998c2f9a6a3baad8bb9748edc55ce69f" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.icons": { "branch": "main", "commit": "94848dad1589a199f876539bd79befb0c5e3abf0" }, - "mini.nvim": { "branch": "main", "commit": "77e20cd6ed80fdf1738c116c35da81e7d9ad997e" }, + "mason.nvim": { "branch": "main", "commit": "9e25c98d4826998460926f8c5c2284848d80ae89" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "mini.nvim": { "branch": "main", "commit": "03387f53f1cb8c6a8ba0798041c6aa3525ed11ba" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" }, + "nvim-dap": { "branch": "master", "commit": "a479e25ed5b5d331fb46ee4b9e160ff02ac64310" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lint": { "branch": "master", "commit": "9c6207559297b24f0b7c32829f8e45f7d65b991f" }, - "nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, + "nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" }, + "nvim-lspconfig": { "branch": "master", "commit": "9141be4c1332afc83bdf1b0278dbb030f75ff8e3" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" }, + "nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, diff --git a/nvim/.config/nvim/lua/plugins/barbar.lua b/nvim/.config/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..9787b05 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/barbar.lua @@ -0,0 +1,74 @@ +return { + { + 'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', + 'nvim-tree/nvim-web-devicons', + }, + init = function() + vim.g.barbar_auto_setup = false + end, + version = '^1.0.0', + config = function() + require('barbar').setup {} + + local map = vim.api.nvim_set_keymap + local opts = { noremap = true, silent = true } + + -- Move to previous/next + map('n', '', 'BufferPrevious', opts) + map('n', '', 'BufferNext', opts) + + -- Re-order to previous/next + map('n', '', 'BufferMovePrevious', opts) + map('n', '>', 'BufferMoveNext', opts) + + -- Goto buffer in position... + map('n', '', 'BufferGoto 1', opts) + map('n', '', 'BufferGoto 2', opts) + map('n', '', 'BufferGoto 3', opts) + map('n', '', 'BufferGoto 4', opts) + map('n', '', 'BufferGoto 5', opts) + map('n', '', 'BufferGoto 6', opts) + map('n', '', 'BufferGoto 7', opts) + map('n', '', 'BufferGoto 8', opts) + map('n', '', 'BufferGoto 9', opts) + map('n', '', 'BufferLast', opts) + + -- Pin/unpin buffer + map('n', '', 'BufferPin', opts) + + -- Goto pinned/unpinned buffer + -- :BufferGotoPinned + -- :BufferGotoUnpinned + + -- Close buffer + map('n', '', 'BufferClose', opts) + + -- Wipeout buffer + -- :BufferWipeout + + -- Close commands + -- :BufferCloseAllButCurrent + -- :BufferCloseAllButPinned + -- :BufferCloseAllButCurrentOrPinned + -- :BufferCloseBuffersLeft + -- :BufferCloseBuffersRight + + -- Magic buffer-picking mode + map('n', '', 'BufferPick', opts) + map('n', '', 'BufferPickDelete', opts) + + -- Sort automatically by... + map('n', 'bb', 'BufferOrderByBufferNumber', opts) + map('n', 'bn', 'BufferOrderByName', opts) + map('n', 'bd', 'BufferOrderByDirectory', opts) + map('n', 'bl', 'BufferOrderByLanguage', opts) + map('n', 'bw', 'BufferOrderByWindowNumber', opts) + + -- Other: + -- :BarbarEnable - enables barbar (enabled by default) + -- :BarbarDisable - very bad command, should never be used + end, + }, +} -- cgit v1.2.3 From 258d7eaa9027c8e0552d474c7f3b5ac6adb875a1 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 6 Aug 2025 23:13:20 -0400 Subject: update lockfile --- nvim/.config/nvim/lazy-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index dee4742..1650b7e 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -10,7 +10,7 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "844d247d998c2f9a6a3baad8bb9748edc55ce69f" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "9e25c98d4826998460926f8c5c2284848d80ae89" }, -- cgit v1.2.3 From ae25c83f2973034df98ade2d74f4905c15d489b0 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 15:13:30 -0400 Subject: Use in terminal mode If we use a single esc, it messes up situations like vim in vim because you can't use esc to get out. --- nvim/.config/nvim/lua/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua index 829f514..18a2a98 100644 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -14,7 +14,7 @@ map('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]ui -- -- NOTE: This won't work in all terminal emulators/tmux/etc. -- Try your own mapping or just use to exit terminal mode -map('t', '', '', { desc = 'Exit terminal mode' }) +map('t', '', '', { desc = 'Exit terminal mode' }) map('t', '', '', { desc = 'Verbatim escape' }) -- Keybinds to make split navigation easier. -- cgit v1.2.3 From 0c7f192f808e0563248a6f0defb0ee6deefae80f Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 15:13:53 -0400 Subject: Use copilot chat --- nvim/.config/nvim/lazy-lock.json | 4 ++++ nvim/.config/nvim/lua/plugins/blink.lua | 8 ++++++++ nvim/.config/nvim/lua/plugins/copilot.lua | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 nvim/.config/nvim/lua/plugins/copilot.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 1650b7e..6ead06c 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,8 +1,11 @@ { + "CopilotChat.nvim": { "branch": "main", "commit": "807c4a179d48aedaf9c5b5dd667486766411d81b" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, + "copilot.lua": { "branch": "master", "commit": "0f2fd3829dd27d682e46c244cf48d9715726f612" }, "fidget.nvim": { "branch": "main", "commit": "4ec7bed6c86b671ddde03ca1b227343cfa3e65fa" }, "gitsigns.nvim": { "branch": "main", "commit": "736f51d2bb684c06f39a2032f064d7244f549981" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, @@ -30,6 +33,7 @@ "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua index 3fd95e3..6b450fc 100644 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -32,6 +32,7 @@ return { opts = {}, }, 'folke/lazydev.nvim', + 'giuxtaposition/blink-cmp-copilot', }, --- @module 'blink.cmp' --- @type blink.cmp.Config @@ -82,9 +83,16 @@ return { 'path', 'snippets', 'lazydev', + 'copilot', }, providers = { lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, + copilot = { + name = 'copilot', + module = 'blink-cmp-copilot', + score_offset = 100, + async = true, + }, }, }, diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..2c9b166 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,24 @@ +return { + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + opts = {}, + }, + { + 'CopilotC-Nvim/CopilotChat.nvim', + dependencies = { + { 'zbirenbaum/copilot.lua' }, + { 'nvim-lua/plenary.nvim', branch = 'master' }, + }, + build = 'make tiktoken', -- Only on MacOS or Linux + config = function() + require('CopilotChat').setup { + model = 'claude-sonnet-4', + } + vim.keymap.set('n', 'tc', function() + vim.cmd 'CopilotChatToggle' + end, { desc = '[Copilot] Toggle Copilot Chat' }) + end, + }, +} -- cgit v1.2.3 From 8c51878b2ec81d2bd67d135b00426c700a820b23 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 15:14:19 -0400 Subject: Adjust config for terraform --- nvim/.config/nvim/lua/plugins/conform.lua | 1 + nvim/.config/nvim/lua/plugins/lint.lua | 2 +- nvim/.config/nvim/lua/plugins/lsp.lua | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index c83ea3b..bb85828 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -80,6 +80,7 @@ return { sh = { 'shfmt' }, cpp = { 'clang-format' }, c = { 'clang-format' }, + tf = { 'terraformfmt' }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index da98a9e..d607118 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -11,7 +11,7 @@ return { lint.linters_by_ft['cpp'] = { 'cppcheck' } lint.linters_by_ft['dockerfile'] = { 'hadolint' } lint.linters_by_ft['json'] = { 'jsonlint' } - lint.linters_by_ft['terraform'] = { 'tflint' } + lint.linters_by_ft['terraform'] = { 'tflint', 'terraform_validate' } lint.linters_by_ft['python'] = { 'ruff', 'bandit' } lint.linters_by_ft['markdown'] = nil lint.linters_by_ft['text'] = nil diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index f3c51ad..18a00ff 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -187,6 +187,7 @@ return { }, tailwindcss = {}, mesonlsp = {}, + terraformls = {}, } -- Ensure the servers and tools above are installed -- cgit v1.2.3 From d45192af6d69981d668898e901007cf9c9db1d0c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 15:49:37 -0400 Subject: Add spell checking to markdown files --- nvim/.config/nvim/after/ftplugin/markdown.lua | 19 +++++++++++++++++++ nvim/.config/nvim/lua/config/options.lua | 2 ++ nvim/.config/nvim/spell/en.utf-8.add | 0 3 files changed, 21 insertions(+) create mode 100644 nvim/.config/nvim/after/ftplugin/markdown.lua create mode 100644 nvim/.config/nvim/spell/en.utf-8.add (limited to 'nvim') diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..4f56524 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,19 @@ +local opt_local = vim.opt_local + +opt_local.textwidth = 80 +opt_local.formatoptions:append { 't' } +opt_local.formatoptions:remove { 'l' } + +opt_local.wrap = true +opt_local.linebreak = true +opt_local.breakindent = true + +opt_local.spell = true +opt_local.spelllang = 'en_us' + +opt_local.expandtab = true +opt_local.tabstop = 2 +opt_local.shiftwidth = 2 + +opt_local.list = true +opt_local.listchars = 'tab:»·,trail:·' diff --git a/nvim/.config/nvim/lua/config/options.lua b/nvim/.config/nvim/lua/config/options.lua index 7f5d331..77d38c3 100644 --- a/nvim/.config/nvim/lua/config/options.lua +++ b/nvim/.config/nvim/lua/config/options.lua @@ -92,3 +92,5 @@ opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } -- Preview substitutions live, as you type! opt.inccommand = 'split' + +opt.spellfile = vim.fn.stdpath 'config' .. '/spell/en.utf-8.add' diff --git a/nvim/.config/nvim/spell/en.utf-8.add b/nvim/.config/nvim/spell/en.utf-8.add new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3 From 4458866940f569986786260785be46011c524745 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 16:07:18 -0400 Subject: Remove obsidian plugin --- nvim/.config/nvim/lazy-lock.json | 14 ++++++-------- nvim/.config/nvim/lua/plugins/indent_line.lua | 2 ++ nvim/.config/nvim/lua/plugins/obsidian.lua | 20 -------------------- 3 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 nvim/.config/nvim/lua/plugins/obsidian.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 6ead06c..0078035 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,13 +1,13 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "807c4a179d48aedaf9c5b5dd667486766411d81b" }, + "CopilotChat.nvim": { "branch": "main", "commit": "f1d6bb5aa7219cfb426c2f585362b866f1dbb7d9" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, "copilot.lua": { "branch": "master", "commit": "0f2fd3829dd27d682e46c244cf48d9715726f612" }, - "fidget.nvim": { "branch": "main", "commit": "4ec7bed6c86b671ddde03ca1b227343cfa3e65fa" }, - "gitsigns.nvim": { "branch": "main", "commit": "736f51d2bb684c06f39a2032f064d7244f549981" }, + "fidget.nvim": { "branch": "main", "commit": "dafd592c7bdbb6cd6d17d3c9a1a8abf3930138c1" }, + "gitsigns.nvim": { "branch": "main", "commit": "c7d37ca22b461f64e26f8f6701b2586128ed0bef" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, @@ -16,9 +16,9 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "9e25c98d4826998460926f8c5c2284848d80ae89" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, - "mini.nvim": { "branch": "main", "commit": "03387f53f1cb8c6a8ba0798041c6aa3525ed11ba" }, + "mini.nvim": { "branch": "main", "commit": "4035ef97407a6661ae9ff913ff980e271a658502" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-dap": { "branch": "master", "commit": "a479e25ed5b5d331fb46ee4b9e160ff02ac64310" }, @@ -26,14 +26,12 @@ "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" }, - "nvim-lspconfig": { "branch": "master", "commit": "9141be4c1332afc83bdf1b0278dbb030f75ff8e3" }, + "nvim-lspconfig": { "branch": "master", "commit": "d6dc63670d3dc5204b1e874af4cbf340cb5d9d18" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" }, - "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, diff --git a/nvim/.config/nvim/lua/plugins/indent_line.lua b/nvim/.config/nvim/lua/plugins/indent_line.lua index 041ba40..cc1c414 100644 --- a/nvim/.config/nvim/lua/plugins/indent_line.lua +++ b/nvim/.config/nvim/lua/plugins/indent_line.lua @@ -6,6 +6,8 @@ return { -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl` main = 'ibl', + ---@module "ibl" + ---@type ibl.config opts = {}, }, } diff --git a/nvim/.config/nvim/lua/plugins/obsidian.lua b/nvim/.config/nvim/lua/plugins/obsidian.lua deleted file mode 100644 index a29e9f8..0000000 --- a/nvim/.config/nvim/lua/plugins/obsidian.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - 'epwalsh/obsidian.nvim', - version = '*', - lazy = true, - event = { - 'BufReadPre ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', - 'BufNewFile ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', - }, - dependencies = { - 'nvim-lua/plenary.nvim', - }, - opts = { - workspaces = { - { - name = 'personal', - path = '~/Documents/Notes', - }, - }, - }, -} -- cgit v1.2.3 From c388c1229ccdcde156cfa416f7304f52cc83f696 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Aug 2025 18:31:49 -0400 Subject: Update neovim config to use vim pack --- nvim/.config/nvim/after/ftplugin/css.lua | 2 + nvim/.config/nvim/after/ftplugin/go.lua | 2 + nvim/.config/nvim/after/ftplugin/html.lua | 2 + nvim/.config/nvim/after/ftplugin/javascript.lua | 2 + .../nvim/after/ftplugin/javascriptreact.lua | 2 + nvim/.config/nvim/after/ftplugin/lua.lua | 3 + nvim/.config/nvim/after/ftplugin/python.lua | 11 + nvim/.config/nvim/after/ftplugin/typescript.lua | 2 + .../nvim/after/ftplugin/typescriptreact.lua | 2 + nvim/.config/nvim/init.lua | 7 +- nvim/.config/nvim/lua/config/autocmds.lua | 14 -- nvim/.config/nvim/lua/config/filetypes.lua | 41 ---- nvim/.config/nvim/lua/config/global.lua | 15 -- nvim/.config/nvim/lua/config/keymaps.lua | 33 --- nvim/.config/nvim/lua/config/lazy.lua | 91 -------- nvim/.config/nvim/lua/config/options.lua | 96 --------- nvim/.config/nvim/lua/eugenetriguba/autocmds.lua | 8 + nvim/.config/nvim/lua/eugenetriguba/global.lua | 8 + nvim/.config/nvim/lua/eugenetriguba/init.lua | 5 + nvim/.config/nvim/lua/eugenetriguba/keymaps.lua | 20 ++ nvim/.config/nvim/lua/eugenetriguba/options.lua | 94 ++++++++ .../nvim/lua/eugenetriguba/plugins/blink.lua | 105 +++++++++ .../lua/eugenetriguba/plugins/colorschemes.lua | 14 ++ .../nvim/lua/eugenetriguba/plugins/conform.lua | 95 ++++++++ .../nvim/lua/eugenetriguba/plugins/fzf-lua.lua | 34 +++ .../nvim/lua/eugenetriguba/plugins/gitsigns.lua | 66 ++++++ .../nvim/lua/eugenetriguba/plugins/harpoon.lua | 46 ++++ .../nvim/lua/eugenetriguba/plugins/indent_line.lua | 8 + .../nvim/lua/eugenetriguba/plugins/init.lua | 20 ++ .../nvim/lua/eugenetriguba/plugins/lint.lua | 52 +++++ .../lua/eugenetriguba/plugins/lsp/diagnostics.lua | 27 +++ .../nvim/lua/eugenetriguba/plugins/lsp/init.lua | 3 + .../lua/eugenetriguba/plugins/lsp/lspconfig.lua | 71 ++++++ .../nvim/lua/eugenetriguba/plugins/lsp/mason.lua | 62 ++++++ .../nvim/lua/eugenetriguba/plugins/mini.lua | 32 +++ .../.config/nvim/lua/eugenetriguba/plugins/oil.lua | 18 ++ .../lua/eugenetriguba/plugins/tmux-navigator.lua | 6 + .../nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 29 +++ .../nvim/lua/eugenetriguba/plugins/which-key.lua | 13 ++ nvim/.config/nvim/lua/plugins/autopairs.lua | 14 -- nvim/.config/nvim/lua/plugins/barbar.lua | 74 ------- nvim/.config/nvim/lua/plugins/blink.lua | 114 ---------- nvim/.config/nvim/lua/plugins/colorizer.lua | 8 - nvim/.config/nvim/lua/plugins/colorschemes.lua | 20 -- nvim/.config/nvim/lua/plugins/conform.lua | 115 ---------- nvim/.config/nvim/lua/plugins/copilot.lua | 24 --- nvim/.config/nvim/lua/plugins/debug.lua | 239 --------------------- nvim/.config/nvim/lua/plugins/gitsigns.lua | 67 ------ nvim/.config/nvim/lua/plugins/harpoon.lua | 36 ---- nvim/.config/nvim/lua/plugins/indent_line.lua | 13 -- nvim/.config/nvim/lua/plugins/lint.lua | 63 ------ nvim/.config/nvim/lua/plugins/lsp.lua | 229 -------------------- nvim/.config/nvim/lua/plugins/lualine.lua | 14 -- nvim/.config/nvim/lua/plugins/mini.lua | 41 ---- nvim/.config/nvim/lua/plugins/oil.lua | 13 -- nvim/.config/nvim/lua/plugins/telescope.lua | 109 ---------- nvim/.config/nvim/lua/plugins/tmux-navigator.lua | 20 -- nvim/.config/nvim/lua/plugins/todo-comments.lua | 41 ---- nvim/.config/nvim/lua/plugins/tree-sitter.lua | 28 --- nvim/.config/nvim/lua/plugins/which-key.lua | 55 ----- 60 files changed, 865 insertions(+), 1633 deletions(-) create mode 100644 nvim/.config/nvim/after/ftplugin/css.lua create mode 100644 nvim/.config/nvim/after/ftplugin/go.lua create mode 100644 nvim/.config/nvim/after/ftplugin/html.lua create mode 100644 nvim/.config/nvim/after/ftplugin/javascript.lua create mode 100644 nvim/.config/nvim/after/ftplugin/javascriptreact.lua create mode 100644 nvim/.config/nvim/after/ftplugin/lua.lua create mode 100644 nvim/.config/nvim/after/ftplugin/python.lua create mode 100644 nvim/.config/nvim/after/ftplugin/typescript.lua create mode 100644 nvim/.config/nvim/after/ftplugin/typescriptreact.lua delete mode 100644 nvim/.config/nvim/lua/config/autocmds.lua delete mode 100644 nvim/.config/nvim/lua/config/filetypes.lua delete mode 100644 nvim/.config/nvim/lua/config/global.lua delete mode 100644 nvim/.config/nvim/lua/config/keymaps.lua delete mode 100644 nvim/.config/nvim/lua/config/lazy.lua delete mode 100644 nvim/.config/nvim/lua/config/options.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/autocmds.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/global.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/init.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/keymaps.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/options.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua delete mode 100644 nvim/.config/nvim/lua/plugins/autopairs.lua delete mode 100644 nvim/.config/nvim/lua/plugins/barbar.lua delete mode 100644 nvim/.config/nvim/lua/plugins/blink.lua delete mode 100644 nvim/.config/nvim/lua/plugins/colorizer.lua delete mode 100644 nvim/.config/nvim/lua/plugins/colorschemes.lua delete mode 100644 nvim/.config/nvim/lua/plugins/conform.lua delete mode 100644 nvim/.config/nvim/lua/plugins/copilot.lua delete mode 100644 nvim/.config/nvim/lua/plugins/debug.lua delete mode 100644 nvim/.config/nvim/lua/plugins/gitsigns.lua delete mode 100644 nvim/.config/nvim/lua/plugins/harpoon.lua delete mode 100644 nvim/.config/nvim/lua/plugins/indent_line.lua delete mode 100644 nvim/.config/nvim/lua/plugins/lint.lua delete mode 100644 nvim/.config/nvim/lua/plugins/lsp.lua delete mode 100644 nvim/.config/nvim/lua/plugins/lualine.lua delete mode 100644 nvim/.config/nvim/lua/plugins/mini.lua delete mode 100644 nvim/.config/nvim/lua/plugins/oil.lua delete mode 100644 nvim/.config/nvim/lua/plugins/telescope.lua delete mode 100644 nvim/.config/nvim/lua/plugins/tmux-navigator.lua delete mode 100644 nvim/.config/nvim/lua/plugins/todo-comments.lua delete mode 100644 nvim/.config/nvim/lua/plugins/tree-sitter.lua delete mode 100644 nvim/.config/nvim/lua/plugins/which-key.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/after/ftplugin/css.lua b/nvim/.config/nvim/after/ftplugin/css.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/css.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/after/ftplugin/go.lua b/nvim/.config/nvim/after/ftplugin/go.lua new file mode 100644 index 0000000..3aec42b --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/go.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 diff --git a/nvim/.config/nvim/after/ftplugin/html.lua b/nvim/.config/nvim/after/ftplugin/html.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/html.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/after/ftplugin/javascript.lua b/nvim/.config/nvim/after/ftplugin/javascript.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/javascript.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/after/ftplugin/javascriptreact.lua b/nvim/.config/nvim/after/ftplugin/javascriptreact.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/javascriptreact.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/after/ftplugin/lua.lua b/nvim/.config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..03a618a --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/lua.lua @@ -0,0 +1,3 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 +vim.opt_local.commentstring = '-- %s' diff --git a/nvim/.config/nvim/after/ftplugin/python.lua b/nvim/.config/nvim/after/ftplugin/python.lua new file mode 100644 index 0000000..20fc6b1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/python.lua @@ -0,0 +1,11 @@ +-- PEP 8 indentation settings +vim.opt_local.tabstop = 4 +vim.opt_local.softtabstop = 4 +vim.opt_local.shiftwidth = 4 +vim.opt_local.expandtab = true + +-- 88 character length lines for Black formatter +vim.opt_local.colorcolumn = '88' + +-- Google-style docstrings +vim.g.python_style = 'google' diff --git a/nvim/.config/nvim/after/ftplugin/typescript.lua b/nvim/.config/nvim/after/ftplugin/typescript.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/typescript.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/after/ftplugin/typescriptreact.lua b/nvim/.config/nvim/after/ftplugin/typescriptreact.lua new file mode 100644 index 0000000..9e469a1 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/typescriptreact.lua @@ -0,0 +1,2 @@ +vim.opt_local.tabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 96ccd07..4a5ce9f 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,6 +1 @@ -require 'config.global' -require 'config.keymaps' -require 'config.autocmds' -require 'config.options' -require 'config.filetypes' -require 'config.lazy' +require 'eugenetriguba' diff --git a/nvim/.config/nvim/lua/config/autocmds.lua b/nvim/.config/nvim/lua/config/autocmds.lua deleted file mode 100644 index 1e8b533..0000000 --- a/nvim/.config/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,14 +0,0 @@ --- [[ Autocommands ]] --- See `:help lua-guide-autocommands` -local autocmd = vim.api.nvim_create_autocmd - --- Highlight when yanking (copying) text --- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` -autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), - callback = function() - vim.highlight.on_yank() - end, -}) diff --git a/nvim/.config/nvim/lua/config/filetypes.lua b/nvim/.config/nvim/lua/config/filetypes.lua deleted file mode 100644 index 3c98c6b..0000000 --- a/nvim/.config/nvim/lua/config/filetypes.lua +++ /dev/null @@ -1,41 +0,0 @@ -vim.api.nvim_create_autocmd('FileType', { - pattern = 'python', - callback = function() - -- PEP 8 indentation settings - vim.opt_local.tabstop = 4 - vim.opt_local.softtabstop = 4 - vim.opt_local.shiftwidth = 4 - vim.opt_local.expandtab = true - - -- 88 character length lines for Black formatter - vim.opt_local.colorcolumn = '88' - - -- Google-style docstrings - vim.g.python_style = 'google' - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - pattern = 'lua', - callback = function() - vim.opt_local.tabstop = 2 - vim.opt_local.shiftwidth = 2 - vim.opt_local.commentstring = '-- %s' - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - pattern = { 'html', 'css', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact' }, - callback = function() - vim.opt_local.tabstop = 2 - vim.opt_local.shiftwidth = 2 - end, -}) - -vim.api.nvim_create_autocmd('FileType', { - pattern = 'go', - callback = function() - vim.opt_local.tabstop = 4 - vim.opt_local.shiftwidth = 4 - end, -}) diff --git a/nvim/.config/nvim/lua/config/global.lua b/nvim/.config/nvim/lua/config/global.lua deleted file mode 100644 index f5462f9..0000000 --- a/nvim/.config/nvim/lua/config/global.lua +++ /dev/null @@ -1,15 +0,0 @@ --- Set as the leader key --- See `:help mapleader` -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' - --- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = true - --- Disable netrw -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - --- Set Python 3 to a virtual environment with `pynvim` installed --- to support python plugins. -vim.g.python3_host_prog = vim.fn.expand '~/.config/nvim/venv/bin/python' diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua deleted file mode 100644 index 18a2a98..0000000 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,33 +0,0 @@ --- [[ Keymaps ]] --- See `:help vim.keymap.set()` -local map = vim.keymap.set - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -map('n', '', 'nohlsearch') - --- Diagnostic keymaps -map('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - --- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier --- to discover. Otherwise, you normally need to press . --- --- NOTE: This won't work in all terminal emulators/tmux/etc. --- Try your own mapping or just use to exit terminal mode -map('t', '', '', { desc = 'Exit terminal mode' }) -map('t', '', '', { desc = 'Verbatim escape' }) - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -map('n', '', '', { desc = 'Move focus to the left window' }) -map('n', '', '', { desc = 'Move focus to the right window' }) -map('n', '', '', { desc = 'Move focus to the lower window' }) -map('n', '', '', { desc = 'Move focus to the upper window' }) - --- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -map('n', '', 'H', { desc = 'Move window to the left' }) -map('n', '', 'L', { desc = 'Move window to the right' }) -map('n', '', 'J', { desc = 'Move window to the lower' }) -map('n', '', 'K', { desc = 'Move window to the upper' }) diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index d4dbe5f..0000000 --- a/nvim/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,91 +0,0 @@ --- [[ Install `lazy.nvim` plugin manager ]] --- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info -local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { 'Failed to clone lazy.nvim:\n', 'ErrorMsg' }, - { out, 'WarningMsg' }, - { '\nPress any key to exit...' }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- NOTE: All plugins are automatically discovered via the --- 'plugins' directory. --- --- Plugins can also be added by using a table, with the first --- argument being the link and the following keys can be used --- to configure plugin behavior/loading/etc. --- --- Use `opts = {}` to automatically pass options to a plugin's --- `setup()` function, forcing the plugin to be loaded. --- --- Alternatively, use `config = function() ... end` for full --- control over the configuration. --- --- `setup` may also be called explicitly: --- { --- 'lewis6991/gitsigns.nvim', --- config = function() --- require('gitsigns').setup({ --- -- Your gitsigns configuration here --- }) --- end, --- } --- --- NOTE: Plugins can also be configured to run Lua code when they are loaded. --- --- This is often very useful to both group configuration, as well as handle --- lazy loading plugins that don't need to be loaded immediately at startup. --- --- For example, in the whichkey configuration, we use: --- event = 'VimEnter' --- --- which loads which-key before all the UI elements are loaded. Events can be --- normal autocommands events (`:help autocmd-events`). --- --- Then, because we use the `opts` key (recommended), the configuration runs --- after the plugin has been loaded as `require(MODULE).setup(opts)`. --- --- NOTE: Plugins can specify dependencies. --- --- The dependencies are proper plugin specifications as well - anything --- you do for a plugin at the top level, you can do for a dependency. --- --- Use the `dependencies` key to specify the dependencies of a particular plugin - -require('lazy').setup({ - spec = { - { import = 'plugins' }, - }, - install = { colorscheme = { 'tokyonight' } }, - -- Check for plugin updates automatically. - checker = { enabled = true, notify = false }, -}, { - ui = { - -- If Nerd Fonts are enabled, we set the icons to an empty table to use the - -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons - -- table - icons = vim.g.have_nerd_font and {} or { - cmd = '⌘', - config = '🛠', - event = '📅', - ft = '📂', - init = '⚙', - keys = '🗝', - plugin = '🔌', - runtime = '💻', - require = '🌙', - source = '📄', - start = '🚀', - task = '📌', - lazy = '💤 ', - }, - }, -}) diff --git a/nvim/.config/nvim/lua/config/options.lua b/nvim/.config/nvim/lua/config/options.lua deleted file mode 100644 index 77d38c3..0000000 --- a/nvim/.config/nvim/lua/config/options.lua +++ /dev/null @@ -1,96 +0,0 @@ --- [[ Setting options ]] --- See `:help vim.opt` --- For more options, see `:help option-list` -local opt = vim.opt - --- Make line numbers default -opt.number = true - --- Use relative line numbers, to help with jumping. -opt.relativenumber = true - --- In Insert mode, replace with the appropriate --- number of spaces. -opt.expandtab = true - --- When starting a new line, use smart indentation to --- figure out what indentation the new line should be --- at. -opt.autoindent = true -opt.smartindent = true - --- Number of spaces to use for each step of autoindentation. -opt.shiftwidth = 2 - --- Number of spaces to use when using . -opt.tabstop = 2 - --- Case-insensitive searching UNLESS \C or one --- or more capital letters in the search term -opt.ignorecase = true -opt.smartcase = true - --- Explicitly enable 24-bit RGB colors in the terminal. --- Neovim will normally automatically attempt to enable --- this if it detects the terminal can support it. -opt.termguicolors = true - --- Keep signcolumn on by default -opt.signcolumn = 'yes' - --- Show which line your cursor is on -opt.cursorline = true - --- If performing an operation that would fail due to unsaved --- changes in the buffer (like `:q`), instead raise a dialog --- asking if you wish to save the current file(s) --- --- See `:help 'confirm'` -opt.confirm = true - --- Save undo history -opt.undofile = true - --- Minimal number of screen lines to keep above and below the cursor. -opt.scrolloff = 10 - --- Enable mouse mode e.g. can be useful for resizing splits -opt.mouse = 'a' - --- Don't show the mode, since it's already in the status line -opt.showmode = false - --- Sync clipboard between OS and Neovim. --- --- Schedule the setting after `UiEnter` because it can increase --- startup-time. Remove this option to keep the OS clipboard --- independent from neovim. --- --- See `:help 'clipboard'` -vim.schedule(function() - opt.clipboard = 'unnamedplus' -end) - --- Continue to visually indent wrapped lines --- to preserve horizontal blocks of text -opt.breakindent = true - --- Decrease update time -opt.updatetime = 250 - --- Decrease mapped sequence wait time -opt.timeoutlen = 300 - --- Configure how new splits should be opened -opt.splitright = true -opt.splitbelow = true - --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` and `:help 'listchars'` -opt.list = true -opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - --- Preview substitutions live, as you type! -opt.inccommand = 'split' - -opt.spellfile = vim.fn.stdpath 'config' .. '/spell/en.utf-8.add' diff --git a/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua new file mode 100644 index 0000000..e4ed02b --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua @@ -0,0 +1,8 @@ +-- Highlight when yanking (copying) text +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), + callback = function() + vim.highlight.on_yank() + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/global.lua b/nvim/.config/nvim/lua/eugenetriguba/global.lua new file mode 100644 index 0000000..41f48e4 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/global.lua @@ -0,0 +1,8 @@ +-- Set as the leader key +-- See `:help mapleader` +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- Set Python 3 to a virtual environment with `pynvim` installed +-- to support python plugins. +vim.g.python3_host_prog = vim.fn.expand '~/.config/nvim/venv/bin/python' diff --git a/nvim/.config/nvim/lua/eugenetriguba/init.lua b/nvim/.config/nvim/lua/eugenetriguba/init.lua new file mode 100644 index 0000000..d372afd --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/init.lua @@ -0,0 +1,5 @@ +require 'eugenetriguba.global' +require 'eugenetriguba.keymaps' +require 'eugenetriguba.autocmds' +require 'eugenetriguba.options' +require 'eugenetriguba.plugins' diff --git a/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua b/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua new file mode 100644 index 0000000..7b65adf --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua @@ -0,0 +1,20 @@ +local map = vim.keymap.set + +-- Clear highlights on search when pressing in normal mode +map('n', '', 'nohlsearch') + +-- Diagnostic keymaps +map('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- to remember. +map('t', '', '', { desc = 'Exit terminal mode' }) + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +map('n', '', '', { desc = 'Move focus to the left window' }) +map('n', '', '', { desc = 'Move focus to the right window' }) +map('n', '', '', { desc = 'Move focus to the lower window' }) +map('n', '', '', { desc = 'Move focus to the upper window' }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/options.lua b/nvim/.config/nvim/lua/eugenetriguba/options.lua new file mode 100644 index 0000000..2634748 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/options.lua @@ -0,0 +1,94 @@ +local opt = vim.opt + +-- Make line numbers default +opt.number = true + +-- Use relative line numbers, to help with jumping. +opt.relativenumber = true + +-- In Insert mode, replace with the appropriate +-- number of spaces. +opt.expandtab = true + +-- When starting a new line, use smart indentation to +-- figure out what indentation the new line should be +-- at. +opt.autoindent = true +opt.smartindent = true + +-- Number of spaces to use for each step of autoindentation. +opt.shiftwidth = 2 + +-- Number of spaces to use when using . +opt.tabstop = 2 + +-- Case-insensitive searching UNLESS \C or one +-- or more capital letters in the search term +opt.ignorecase = true +opt.smartcase = true + +-- Explicitly enable 24-bit RGB colors in the terminal. +-- Neovim will normally automatically attempt to enable +-- this if it detects the terminal can support it. +opt.termguicolors = true + +-- Keep signcolumn on by default +opt.signcolumn = 'yes' + +-- Show which line your cursor is on +opt.cursorline = true + +-- If performing an operation that would fail due to unsaved +-- changes in the buffer (like `:q`), instead raise a dialog +-- asking if you wish to save the current file(s) +-- +-- See `:help 'confirm'` +opt.confirm = true + +-- Save undo history +opt.undofile = true + +-- Minimal number of screen lines to keep above and below the cursor. +opt.scrolloff = 10 + +-- Enable mouse mode e.g. can be useful for resizing splits +opt.mouse = 'a' + +-- Don't show the mode, since it's already in the status line +opt.showmode = false + +-- Sync clipboard between OS and Neovim. +-- +-- Schedule the setting after `UiEnter` because it can increase +-- startup-time. Remove this option to keep the OS clipboard +-- independent from neovim. +-- +-- See `:help 'clipboard'` +vim.schedule(function() + opt.clipboard = 'unnamedplus' +end) + +-- Continue to visually indent wrapped lines +-- to preserve horizontal blocks of text +opt.breakindent = true + +-- Decrease update time +opt.updatetime = 250 + +-- Decrease mapped sequence wait time +opt.timeoutlen = 300 + +-- Configure how new splits should be opened +opt.splitright = true +opt.splitbelow = true + +-- Sets how neovim will display certain whitespace characters in the editor. +-- See `:help 'list'` and `:help 'listchars'` +opt.list = true +opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } + +-- Preview substitutions live, as you type! +opt.inccommand = 'split' + +-- Add a spell file for files that are spell checked +opt.spellfile = vim.fn.stdpath 'config' .. '/spell/en.utf-8.add' diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua new file mode 100644 index 0000000..eced340 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua @@ -0,0 +1,105 @@ +vim.pack.add { + { + name = 'blink.cmp', + src = 'https://github.com/saghen/blink.cmp', + }, + { + name = 'LuaSnip', + src = 'https://github.com/L3MON4D3/LuaSnip', + }, + { + name = 'friendly-snippets', + src = 'https://github.com/rafamadriz/friendly-snippets', + }, + { + name = 'lazydev.nvim', + src = 'https://github.com/folke/lazydev.nvim', + }, +} + +local lsp = vim.api.nvim_create_augroup('lsp', { clear = true }) +vim.api.nvim_create_autocmd('FileType', { + desc = 'Setup lua lsp on lua filetype', + pattern = 'lua', + group = lsp, + callback = function() + require('lazydev').setup { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + } + end, +}) + +require('luasnip').setup {} +require('luasnip.loaders.from_vscode').lazy_load() -- load friendly-snippets + +require('blink.cmp').setup { + keymap = { + preset = 'default', + }, + + appearance = { + nerd_font_variant = 'mono', + }, + + completion = { + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + }, + }, + + sources = { + default = { + 'lsp', + 'path', + 'snippets', + 'lazydev', + }, + providers = { + lazydev = { + module = 'lazydev.integrations.blink', + score_offset = 100, + }, + }, + }, + snippets = { preset = 'luasnip' }, + fuzzy = { implementation = 'prefer_rust_with_warning' }, + signature = { enabled = true }, +} + +local function build_with_job(cmd, cwd, name) + vim.notify('Building ' .. name .. '...', vim.log.levels.INFO) + + vim.fn.jobstart(cmd, { + cwd = cwd, + on_exit = function(_, code) + if code == 0 then + vim.notify(name .. ' build completed successfully!', vim.log.levels.INFO) + else + vim.notify(name .. ' build failed with code ' .. code, vim.log.levels.ERROR) + end + end, + on_stdout = function(_, data) + if data and #data > 0 and data[1] ~= '' then + vim.notify(name .. ': ' .. table.concat(data, '\n'), vim.log.levels.DEBUG) + end + end, + }) +end + +vim.api.nvim_create_user_command('BlinkBuild', function() + local blink_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/blink.cmp' + build_with_job({ 'cargo', '+nightly', 'build', '--release' }, blink_path, 'blink.cmp') +end, { desc = 'Build blink.cmp' }) + +vim.api.nvim_create_user_command('LuaSnipBuild', function() + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + vim.notify 'LuaSnip build not supported on this system' + return + end + local luasnip_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/LuaSnip' + build_with_job({ 'make', 'install_jsregexp' }, luasnip_path, 'LuaSnip') +end, { desc = 'Build LuaSnip jsregexp' }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua new file mode 100644 index 0000000..63e3cf8 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua @@ -0,0 +1,14 @@ +vim.pack.add { + { + name = 'tokyonight', + src = 'https://github.com/folke/tokyonight.nvim', + }, +} + + +require('tokyonight').setup { + styles = { + comments = { italic = false }, + }, +} +vim.cmd.colorscheme 'tokyonight' diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua new file mode 100644 index 0000000..d177759 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua @@ -0,0 +1,95 @@ +vim.pack.add({ + { + name = 'conform', + src = 'https://github.com/stevearc/conform.nvim', + }, +}, { load = false }) + +vim.api.nvim_create_autocmd('VimEnter', { + once = true, + callback = function() + local prettier_fmt = { 'prettierd', 'prettier', stop_after_first = true } + require('conform').setup { + notify_on_error = true, + format_on_save = function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + return { + timeout_ms = 500, + lsp_format = 'fallback', + } + end, + formatters_by_ft = { + lua = { 'stylua' }, + go = { 'goimports', 'gofmt' }, + python = { 'isort', 'black' }, + rust = { 'rustfmt' }, + javascript = prettier_fmt, + typescript = prettier_fmt, + javascriptreact = prettier_fmt, + typescriptreact = prettier_fmt, + css = prettier_fmt, + htmldjango = prettier_fmt, + html = prettier_fmt, + sh = { 'shfmt' }, + cpp = { 'clang-format' }, + c = { 'clang-format' }, + tf = { 'terraformfmt' }, + }, + formatters = { + isort = { + prepend_args = { '--profile', 'black' }, + }, + }, + } + end, +}) + +-- Format current buffer +vim.keymap.set({ 'n', 'v' }, 'f', function() + require('conform').format { async = true, lsp_format = 'fallback' } +end, { desc = '[F]ormat buffer' }) + +-- Toggle autoformat for current buffer +vim.keymap.set('n', 'tf', function() + if vim.b.disable_autoformat then + vim.cmd 'FormatEnable' + vim.notify 'Enabled autoformat for current buffer' + else + vim.cmd 'FormatDisable!' + vim.notify 'Disabled autoformat for current buffer' + end +end, { desc = 'Toggle autoformat for current buffer' }) + +-- Toggle autoformat globally +vim.keymap.set('n', 'tF', function() + if vim.g.disable_autoformat then + vim.cmd 'FormatEnable' + vim.notify 'Enabled autoformat globally' + else + vim.cmd 'FormatDisable' + vim.notify 'Disabled autoformat globally' + end +end, { desc = 'Toggle autoformat globally' }) + +-- :FormatDisable! disables autoformat for this buffer only +-- :FormatDisable disables autoformat globally +vim.api.nvim_create_user_command('FormatDisable', function(args) + if args.bang then + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end +end, { + desc = 'Disable autoformat-on-save', + bang = true, +}) + +-- :FormatEnable enables autoformat globally and for this buffer +vim.api.nvim_create_user_command('FormatEnable', function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false +end, { + desc = 'Re-enable autoformat-on-save', +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua new file mode 100644 index 0000000..e2686b6 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua @@ -0,0 +1,34 @@ +vim.pack.add({ + { + name = 'fzf-lua', + src = 'https://github.com/ibhagwan/fzf-lua', + }, + { + name = 'nvim-web-devicons', + src = 'https://github.com/nvim-tree/nvim-web-devicons', + }, +}, { load = false }) + +vim.api.nvim_create_autocmd('VimEnter', { + once = true, + callback = function() + require('fzf-lua').setup { + files = { + hidden = true, + }, + } + vim.keymap.set('n', 'sh', require('fzf-lua').help_tags, { desc = '[S]earch [H]elp' }) + vim.keymap.set('n', 'sk', require('fzf-lua').keymaps, { desc = '[S]earch [K]eymaps' }) + vim.keymap.set('n', 'sf', require('fzf-lua').files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', require('fzf-lua').builtin, { desc = '[S]earch [S]elect Telescope' }) + vim.keymap.set('n', 'sw', require('fzf-lua').grep_cword, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', require('fzf-lua').live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sd', require('fzf-lua').diagnostics_document, { desc = '[S]earch [D]iagnostics' }) + vim.keymap.set('n', 'sr', require('fzf-lua').resume, { desc = '[S]earch [R]esume' }) + vim.keymap.set('n', 's.', require('fzf-lua').oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', '', require('fzf-lua').buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'sn', function() + require('fzf-lua').files { cwd = vim.fn.stdpath 'config' } + end, { desc = '[S]earch [N]eovim files' }) + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua new file mode 100644 index 0000000..a3fd83a --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua @@ -0,0 +1,66 @@ +vim.pack.add { + { + name = 'gitsigns', + src = 'https://github.com/lewis6991/gitsigns.nvim', + }, +} + +require('gitsigns').setup { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map('n', ']c', function() + if vim.wo.diff then + vim.cmd.normal { ']c', bang = true } + else + gitsigns.nav_hunk 'next' + end + end, { desc = 'Jump to next git [c]hange' }) + + map('n', '[c', function() + if vim.wo.diff then + vim.cmd.normal { '[c', bang = true } + else + gitsigns.nav_hunk 'prev' + end + end, { desc = 'Jump to previous git [c]hange' }) + + -- Actions + -- visual mode + map('v', 'hs', function() + gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'git [s]tage hunk' }) + map('v', 'hr', function() + gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + end, { desc = 'git [r]eset hunk' }) + -- normal mode + map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) + map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) + map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) + map('n', 'hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) + map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) + map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) + map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) + map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) + map('n', 'hD', function() + gitsigns.diffthis '@' + end, { desc = 'git [D]iff against last commit' }) + -- Toggles + map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) + map('n', 'tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) + end, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua new file mode 100644 index 0000000..6d3b050 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua @@ -0,0 +1,46 @@ +vim.pack.add({ + { + name = 'harpoon', + src = 'https://github.com/ThePrimeagen/harpoon', + version = 'harpoon2', + }, + { + name = 'plenary', + src = 'https://github.com/nvim-lua/plenary.nvim', + }, +}, { load = false }) + +vim.api.nvim_create_autocmd('VimEnter', { + once = true, + callback = function() + local harpoon = require 'harpoon' + harpoon:setup() + + vim.keymap.set('n', 'a', function() + harpoon:list():add() + end) + vim.keymap.set('n', '', function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end) + + vim.keymap.set('n', '1', function() + harpoon:list():select(1) + end) + vim.keymap.set('n', '2', function() + harpoon:list():select(2) + end) + vim.keymap.set('n', '3', function() + harpoon:list():select(3) + end) + vim.keymap.set('n', '4', function() + harpoon:list():select(4) + end) + + vim.keymap.set('n', 'hp', function() + harpoon:list():prev() + end) + vim.keymap.set('n', 'hn', function() + harpoon:list():next() + end) + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua new file mode 100644 index 0000000..f6c0e8f --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua @@ -0,0 +1,8 @@ +vim.pack.add { + { + name = 'indent-blankline', + src = 'https://github.com/lukas-reineke/indent-blankline.nvim', + }, +} + +require('ibl').setup() diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua new file mode 100644 index 0000000..f148112 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua @@ -0,0 +1,20 @@ +local plugins = { + 'tree-sitter', + 'colorschemes', + 'which-key', + 'indent_line', + 'conform', + 'fzf-lua', + 'gitsigns', + 'harpoon', + 'lint', + 'mini', + 'oil', + 'lsp', + 'blink', + 'tmux-navigator', +} + +for _, plugin in ipairs(plugins) do + pcall(require, 'eugenetriguba.plugins.' .. plugin) +end diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua new file mode 100644 index 0000000..72f9a51 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua @@ -0,0 +1,52 @@ +vim.pack.add({ + { + name = 'nvim-lint', + src = 'https://github.com/mfussenegger/nvim-lint', + }, +}, { load = false }) + +vim.api.nvim_create_autocmd({ 'BufReadPre', 'BufNewFile' }, { + callback = function() + -- Default linters, which will cause errors unless these tools are available: + -- { + -- clojure = { "clj-kondo" }, + -- dockerfile = { "hadolint" }, + -- inko = { "inko" }, + -- janet = { "janet" }, + -- json = { "jsonlint" }, + -- markdown = { "vale" }, + -- rst = { "vale" }, + -- ruby = { "ruby" }, + -- terraform = { "tflint" }, + -- text = { "vale" } + -- } + -- + -- They can be disabled by setting their filetypes to nil: + -- lint.linters_by_ft['clojure'] = nil + + local lint = require 'lint' + lint.linters_by_ft = lint.linters_by_ft or {} + lint.linters_by_ft['cpp'] = { 'cppcheck' } + lint.linters_by_ft['dockerfile'] = { 'hadolint' } + lint.linters_by_ft['json'] = { 'jsonlint' } + lint.linters_by_ft['terraform'] = { 'tflint', 'terraform_validate' } + lint.linters_by_ft['python'] = { 'ruff', 'bandit' } + lint.linters_by_ft['markdown'] = nil + lint.linters_by_ft['text'] = nil + lint.linters_by_ft['sh'] = { 'shellcheck' } + lint.linters.shellcheck.args = { '-x' } + + local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) + vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { + group = lint_augroup, + callback = function() + -- Only run the linter in buffers that you can modify in order to + -- avoid superfluous noise, notably within the handy LSP pop-ups that + -- describe the hovered symbol using Markdown. + if vim.opt_local.modifiable:get() then + lint.try_lint() + end + end, + }) + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua new file mode 100644 index 0000000..4ea0673 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua @@ -0,0 +1,27 @@ +-- See :help vim.diagnostic.Opts +vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = vim.g.have_nerd_font and { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + } or {}, + virtual_text = { + source = 'if_many', + spacing = 2, + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua new file mode 100644 index 0000000..065f34c --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua @@ -0,0 +1,3 @@ +require 'eugenetriguba.plugins.lsp.lspconfig' +require 'eugenetriguba.plugins.lsp.diagnostics' +require 'eugenetriguba.plugins.lsp.mason' diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua new file mode 100644 index 0000000..2ce6198 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua @@ -0,0 +1,71 @@ +vim.pack.add { + { + name = 'nvim-lspconfig', + src = 'https://github.com/neovim/nvim-lspconfig', + }, + { + name = 'fidget.nvim', + src = 'https://github.com/j-hui/fidget.nvim', + }, +} + +require('fidget').setup {} + +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), + callback = function(event) + -- Utility to more easily define mappings specific for LSP related items. + -- It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + map('grn', vim.lsp.buf.rename, '[R]e[n]ame') + map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + map('grr', require('fzf-lua').lsp_references, '[G]oto [R]eferences') + map('gri', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation') + map('grd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition') + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols') + map('gW', require('fzf-lua').lsp_workspace_symbols, 'Open Workspace Symbols') + map('grt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition') + + -- Highlight references of the word under your cursor when your cursor + -- rests there for a little while. + -- + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd('LspDetach', { + group = vim.api.nvim_create_augroup('lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'lsp-highlight', buffer = event2.buf } + end, + }) + end + + -- Keymap to toggle inlay hints if the language server supports them + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + map('th', function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) + end, '[T]oggle Inlay [H]ints') + end + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua new file mode 100644 index 0000000..2c2bde1 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua @@ -0,0 +1,62 @@ +vim.pack.add { + { + name = 'mason.nvim', + src = 'https://github.com/williamboman/mason.nvim', + }, + { + name = 'mason-lspconfig.nvim', + src = 'https://github.com/williamboman/mason-lspconfig.nvim', + }, + { + name = 'mason-tool-installer.nvim', + src = 'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim', + }, + { + name = 'blink.cmp', + src = 'https://github.com/saghen/blink.cmp', + }, +} + +require('mason').setup {} + +local capabilities = require('blink.cmp').get_lsp_capabilities() +local servers = { + clangd = {}, + gopls = {}, + pyright = {}, + rust_analyzer = {}, + -- Note: https://github.com/pmizio/typescript-tools.nvim may be a better + -- LSP to use here at some point. + ts_ls = {}, + lua_ls = { + settings = { + Lua = { + completion = { + callSnippet = 'Replace', + }, + }, + }, + }, + tailwindcss = {}, + mesonlsp = {}, + terraformls = {}, +} + +local ensure_installed = vim.tbl_keys(servers or {}) +vim.list_extend(ensure_installed, { + 'stylua', -- Used to format Lua code +}) +require('mason-tool-installer').setup { ensure_installed = ensure_installed } + +require('mason-lspconfig').setup { + ensure_installed = {}, -- Populated via mason-tool-installer + automatic_installation = false, + automatic_enable = true, + handlers = { + function(server_name) + local server = servers[server_name] or {} + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua new file mode 100644 index 0000000..5f8f862 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua @@ -0,0 +1,32 @@ +vim.pack.add { + { + name = 'mini', + src = 'https://github.com/echasnovski/mini.nvim', + }, +} + +require('mini.pairs').setup() + +-- Better Around/Inside textobjects +-- +-- Examples: +-- - va) - [V]isually select [A]round [)]paren +-- - yinq - [Y]ank [I]nside [N]ext [Q]uote +-- - ci' - [C]hange [I]nside [']quote +require('mini.ai').setup { n_lines = 500 } + +-- Add/delete/replace surroundings (brackets, quotes, etc.) +-- +-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren +-- - sd' - [S]urround [D]elete [']quotes +-- - sr)' - [S]urround [R]eplace [)] ['] +-- require('mini.surround').setup() + +local statusline = require 'mini.statusline' +statusline.setup { use_icons = true } + +-- Set the section for cursor location to LINE:COLUMN +---@diagnostic disable-next-line: duplicate-set-field +statusline.section_location = function() + return '%2l:%-2v' +end diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua new file mode 100644 index 0000000..e7d39c6 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua @@ -0,0 +1,18 @@ +vim.pack.add { + { + name = 'oil', + src = 'https://github.com/stevearc/oil.nvim', + }, + { + name = 'mini.icons', + src = 'https://github.com/echasnovski/mini.icons', + }, +} + +require('oil').setup { + keymaps = { + [''] = false, -- Clashes with tmux navigator + }, +} +vim.keymap.set('n', '\\', 'Oil --float', { desc = 'Open parent directory in floating window' }) +vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua new file mode 100644 index 0000000..2ec0035 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua @@ -0,0 +1,6 @@ +vim.pack.add { + { + name = 'vim-tmux-navigator', + src = 'https://github.com/christoomey/vim-tmux-navigator', + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua new file mode 100644 index 0000000..47631c3 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -0,0 +1,29 @@ +vim.pack.add { + { + name = 'nvim-treesitter', + src = 'https://github.com/nvim-treesitter/nvim-treesitter', + }, +} + +require('nvim-treesitter.configs').setup { + ensure_installed = 'all', + auto_install = true, + modules = {}, + sync_install = false, + ignore_install = { 'norg', 'org', 'ipkg' }, -- Issues installing them, unused anyway. + highlight = { + enable = true, + additional_vim_regex_highlighting = { 'ruby', 'cpp' }, + }, + indent = { enable = true, disable = { 'ruby', 'cpp' } }, + incremental_selection = { enable = true }, + context_commentstring = { enable = true }, + textobjects = { enable = true }, +} + +vim.api.nvim_create_autocmd('VimEnter', { + once = true, + callback = function() + vim.cmd 'TSUpdate' + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua new file mode 100644 index 0000000..47c789d --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua @@ -0,0 +1,13 @@ +vim.pack.add({ + { + name = 'which-key', + src = 'https://github.com/folke/which-key.nvim', + }, +}, { load = false }) + +vim.api.nvim_create_autocmd('VimEnter', { + once = true, + callback = function() + require('which-key').setup {} + end, +}) diff --git a/nvim/.config/nvim/lua/plugins/autopairs.lua b/nvim/.config/nvim/lua/plugins/autopairs.lua deleted file mode 100644 index 8171237..0000000 --- a/nvim/.config/nvim/lua/plugins/autopairs.lua +++ /dev/null @@ -1,14 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = function() - local autopairs = require 'nvim-autopairs' - autopairs.setup { - check_ts = true, -- Use treesitter for smarter pairing - disable_filetype = { 'TelescopePrompt' }, - } - end, -} diff --git a/nvim/.config/nvim/lua/plugins/barbar.lua b/nvim/.config/nvim/lua/plugins/barbar.lua deleted file mode 100644 index 9787b05..0000000 --- a/nvim/.config/nvim/lua/plugins/barbar.lua +++ /dev/null @@ -1,74 +0,0 @@ -return { - { - 'romgrk/barbar.nvim', - dependencies = { - 'lewis6991/gitsigns.nvim', - 'nvim-tree/nvim-web-devicons', - }, - init = function() - vim.g.barbar_auto_setup = false - end, - version = '^1.0.0', - config = function() - require('barbar').setup {} - - local map = vim.api.nvim_set_keymap - local opts = { noremap = true, silent = true } - - -- Move to previous/next - map('n', '', 'BufferPrevious', opts) - map('n', '', 'BufferNext', opts) - - -- Re-order to previous/next - map('n', '', 'BufferMovePrevious', opts) - map('n', '>', 'BufferMoveNext', opts) - - -- Goto buffer in position... - map('n', '', 'BufferGoto 1', opts) - map('n', '', 'BufferGoto 2', opts) - map('n', '', 'BufferGoto 3', opts) - map('n', '', 'BufferGoto 4', opts) - map('n', '', 'BufferGoto 5', opts) - map('n', '', 'BufferGoto 6', opts) - map('n', '', 'BufferGoto 7', opts) - map('n', '', 'BufferGoto 8', opts) - map('n', '', 'BufferGoto 9', opts) - map('n', '', 'BufferLast', opts) - - -- Pin/unpin buffer - map('n', '', 'BufferPin', opts) - - -- Goto pinned/unpinned buffer - -- :BufferGotoPinned - -- :BufferGotoUnpinned - - -- Close buffer - map('n', '', 'BufferClose', opts) - - -- Wipeout buffer - -- :BufferWipeout - - -- Close commands - -- :BufferCloseAllButCurrent - -- :BufferCloseAllButPinned - -- :BufferCloseAllButCurrentOrPinned - -- :BufferCloseBuffersLeft - -- :BufferCloseBuffersRight - - -- Magic buffer-picking mode - map('n', '', 'BufferPick', opts) - map('n', '', 'BufferPickDelete', opts) - - -- Sort automatically by... - map('n', 'bb', 'BufferOrderByBufferNumber', opts) - map('n', 'bn', 'BufferOrderByName', opts) - map('n', 'bd', 'BufferOrderByDirectory', opts) - map('n', 'bl', 'BufferOrderByLanguage', opts) - map('n', 'bw', 'BufferOrderByWindowNumber', opts) - - -- Other: - -- :BarbarEnable - enables barbar (enabled by default) - -- :BarbarDisable - very bad command, should never be used - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua deleted file mode 100644 index 6b450fc..0000000 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ /dev/null @@ -1,114 +0,0 @@ -return { - { -- Autocompletion - 'saghen/blink.cmp', - build = 'cargo +nightly build --release', - event = 'VimEnter', - version = '*', - dependencies = { - -- Snippet Engine - { - 'L3MON4D3/LuaSnip', - version = '2.*', - build = (function() - -- Build Step is needed for regex support in snippets. - -- This step is not supported in many windows environments. - -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then - return - end - return 'make install_jsregexp' - end)(), - dependencies = { - -- `friendly-snippets` contains a variety of premade snippets. - -- See the README about individual language/framework/plugin snippets: - -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, - }, - opts = {}, - }, - 'folke/lazydev.nvim', - 'giuxtaposition/blink-cmp-copilot', - }, - --- @module 'blink.cmp' - --- @type blink.cmp.Config - opts = { - keymap = { - -- 'default' (recommended) for mappings similar to built-in completions - -- to accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - -- 'super-tab' for tab to accept - -- 'enter' for enter to accept - -- 'none' for no mappings - -- - -- For an understanding of why the 'default' preset is recommended, - -- you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- - -- All presets have the following mappings: - -- /: move to right/left of your snippet expansion - -- : Open menu or open docs if already open - -- / or /: Select next/previous item - -- : Hide menu - -- : Toggle signature help - -- - -- See :h blink-cmp-config-keymap for defining your own keymap - preset = 'default', - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - - appearance = { - -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- Adjusts spacing to ensure icons are aligned - nerd_font_variant = 'mono', - }, - - completion = { - -- By default, you may press `` to show the documentation. - -- Optionally, set `auto_show = true` to show the documentation after a delay. - documentation = { auto_show = true, auto_show_delay_ms = 500 }, - }, - - sources = { - default = { - 'lsp', - 'path', - 'snippets', - 'lazydev', - 'copilot', - }, - providers = { - lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, - copilot = { - name = 'copilot', - module = 'blink-cmp-copilot', - score_offset = 100, - async = true, - }, - }, - }, - - snippets = { preset = 'luasnip' }, - - -- Blink.cmp includes an optional, recommended rust fuzzy matcher, - -- which automatically downloads a prebuilt binary when enabled. - -- - -- By default, we use the Lua implementation instead, but you may enable - -- the rust implementation via `'prefer_rust_with_warning'` - -- - -- See :h blink-cmp-config-fuzzy for more information - fuzzy = { implementation = 'lua' }, - - -- Shows a signature help window while you type arguments for a function - signature = { enabled = true }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/colorizer.lua b/nvim/.config/nvim/lua/plugins/colorizer.lua deleted file mode 100644 index e8ead01..0000000 --- a/nvim/.config/nvim/lua/plugins/colorizer.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - { - "norcalli/nvim-colorizer.lua", - config = function() - require 'colorizer'.setup() - end, - } -} diff --git a/nvim/.config/nvim/lua/plugins/colorschemes.lua b/nvim/.config/nvim/lua/plugins/colorschemes.lua deleted file mode 100644 index aae2d30..0000000 --- a/nvim/.config/nvim/lua/plugins/colorschemes.lua +++ /dev/null @@ -1,20 +0,0 @@ --- Setup the tokyonight color scheme. --- --- To see what colorschemes are already installed: `:Telescope colorscheme`. - -return { - { - 'folke/tokyonight.nvim', - priority = 1000, - config = function() - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Other styles: 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight' - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua deleted file mode 100644 index bb85828..0000000 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ /dev/null @@ -1,115 +0,0 @@ --- Conform adds code autoformatting funcionality. - -return { - { - 'stevearc/conform.nvim', - event = { 'BufWritePre' }, - cmd = { 'ConformInfo' }, - lazy = false, - keys = { - { - 'f', - function() - require('conform').format { async = true, lsp_format = 'fallback' } - end, - mode = '', - desc = '[F]ormat buffer', - }, - { - 'tf', - function() - -- If autoformat is currently disabled for this buffer, - -- then enable it, otherwise disable it - if vim.b.disable_autoformat then - vim.cmd 'FormatEnable' - vim.notify 'Enabled autoformat for current buffer' - else - vim.cmd 'FormatDisable!' - vim.notify 'Disabled autoformat for current buffer' - end - end, - desc = 'Toggle autoformat for current buffer', - }, - { - 'tF', - function() - -- If autoformat is currently disabled globally, - -- then enable it globally, otherwise disable it globally - if vim.g.disable_autoformat then - vim.cmd 'FormatEnable' - vim.notify 'Enabled autoformat globally' - else - vim.cmd 'FormatDisable' - vim.notify 'Disabled autoformat globally' - end - end, - desc = 'Toggle autoformat globally', - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable with a global or buffer-local variable - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - - -- Disable "format_on_save lsp_fallback" for certain languages. - local disable_filetypes = {} - if disable_filetypes[vim.bo[bufnr].filetype] then - return nil - end - - return { - timeout_ms = 500, - lsp_format = 'fallback', - } - end, - formatters_by_ft = { - lua = { 'stylua' }, - go = { 'goimports', 'gofmt' }, - python = { 'isort', 'black' }, - rust = { 'rustfmt' }, - javascript = { 'prettierd', 'prettier', stop_after_first = true }, - typescript = { 'prettierd', 'prettier', stop_after_first = true }, - javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, - typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, - css = { 'prettierd', 'prettier', stop_after_first = true }, - htmldjango = { 'prettierd', 'prettier', stop_after_first = true }, - html = { 'prettierd', 'prettier', stop_after_first = true }, - sh = { 'shfmt' }, - cpp = { 'clang-format' }, - c = { 'clang-format' }, - tf = { 'terraformfmt' }, - }, - formatters = { - isort = { - prepend_args = { '--profile', 'black' }, - }, - }, - }, - config = function(_, opts) - require('conform').setup(opts) - - vim.api.nvim_create_user_command('FormatDisable', function(args) - if args.bang then - -- :FormatDisable! disables autoformat for this buffer only - vim.b.disable_autoformat = true - else - -- :FormatDisable disables autoformat globally - vim.g.disable_autoformat = true - end - end, { - desc = 'Disable autoformat-on-save', - bang = true, -- allows the ! variant - }) - - vim.api.nvim_create_user_command('FormatEnable', function() - vim.b.disable_autoformat = false - vim.g.disable_autoformat = false - end, { - desc = 'Re-enable autoformat-on-save', - }) - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua deleted file mode 100644 index 2c9b166..0000000 --- a/nvim/.config/nvim/lua/plugins/copilot.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - { - 'zbirenbaum/copilot.lua', - cmd = 'Copilot', - event = 'InsertEnter', - opts = {}, - }, - { - 'CopilotC-Nvim/CopilotChat.nvim', - dependencies = { - { 'zbirenbaum/copilot.lua' }, - { 'nvim-lua/plenary.nvim', branch = 'master' }, - }, - build = 'make tiktoken', -- Only on MacOS or Linux - config = function() - require('CopilotChat').setup { - model = 'claude-sonnet-4', - } - vim.keymap.set('n', 'tc', function() - vim.cmd 'CopilotChatToggle' - end, { desc = '[Copilot] Toggle Copilot Chat' }) - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/debug.lua b/nvim/.config/nvim/lua/plugins/debug.lua deleted file mode 100644 index e8b3110..0000000 --- a/nvim/.config/nvim/lua/plugins/debug.lua +++ /dev/null @@ -1,239 +0,0 @@ --- debug.lua --- --- Configures the DAP plugin to debug code. - ----@class DapConfig ----@field name string Configuration name ----@field type string Debug adapter type ----@field request string Launch type ('launch' or 'attach') ----@field program function|string Path to executable or function returning path ----@field cwd string Working directory ----@field stopOnEntry boolean Whether to stop at entry point ----@field args table Command line arguments ----@field runInTerminal boolean Whether to run in terminal - ----@class DapAdapter ----@field type string Adapter type ('server', 'executable', etc.) ----@field port string Port configuration ----@field executable table Executable configuration with command and args - --- Go debugging adapter setup --- Configures delve debugger for Go with platform-specific settings ----@return nil -local function setup_go_adapter() - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes - detached = vim.fn.has 'win32' == 0, - }, - } -end - --- Python debugging adapter setup --- Configures Python debugger using python3 interpreter ----@return nil -local function setup_python_adapter() - require('dap-python').setup 'python3' -end - --- CodeLLDB adapter setup --- Configures LLDB-based debugger for native languages (C, C++, Rust, Zig) ----@param dap table # DAP module instance ----@return nil -local function setup_codelldb_adapter(dap) - ---@type DapAdapter - dap.adapters.codelldb = { - type = 'server', - port = '${port}', - executable = { - command = vim.fn.exepath 'codelldb', - args = { '--port', '${port}' }, - }, - } -end - --- Build and find the newly-built Zig executable by running --- 'zig build' and attempting to locate the resulting executable. --- If the executable is unable to be automatically found, the user --- will be prompted to give the path to the executable. --- ----@return string|nil # Path to executable or nil if build the failed -local function build_and_find_zig_executable() - local build_result = vim.fn.system 'zig build' - if vim.v.shell_error ~= 0 then - vim.notify('Build failed: ' .. build_result, vim.log.levels.ERROR) - return nil - end - - local exe_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':t') - local possible_paths = { 'zig-out/bin/' .. exe_name } - - for _, path in ipairs(possible_paths) do - local full_path = vim.fn.getcwd() .. '/' .. path - if vim.fn.executable(full_path) == 1 then - return full_path - end - end - - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file') -end - --- Build and find the Zig test executable by running --- 'zig build test' and prompting the user for the test --- executable location. --- ----@return string # Path to test executable -local function build_and_find_zig_test() - vim.fn.system 'zig build test' - return vim.fn.input('Path to test executable: ', vim.fn.getcwd() .. '/zig-cache/o/', 'file') -end - --- Zig debugging configuration --- Sets up debugging configurations for Zig programs and tests ----@param dap table # DAP module instance ----@return nil -local function setup_zig_configuration(dap) - ---@type DapConfig[] - dap.configurations.zig = { - { - name = 'Build and Launch Zig Program', - type = 'codelldb', - request = 'launch', - program = build_and_find_zig_executable, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = {}, - runInTerminal = false, - }, - { - name = 'Launch Zig Test', - type = 'codelldb', - request = 'launch', - program = build_and_find_zig_test, - cwd = '${workspaceFolder}', - stopOnEntry = false, - args = {}, - runInTerminal = false, - }, - } -end - --- Language adapters and configurations --- Sets up debugging support for all supported languages ----@param dap table # DAP module instance ----@return nil -local function setup_language_adapters(dap) - setup_go_adapter() - setup_python_adapter() - setup_codelldb_adapter(dap) - setup_zig_configuration(dap) -end - --- Key mappings setup --- Configures function keys and leader key combinations for debugging actions ----@param dap table # DAP module instance ----@param dapui table # DAP UI module instance ----@return nil -local function setup_keymaps(dap, dapui) - ---@type table - local keymaps = { - [''] = { dap.continue, 'Debug: Start/Continue' }, - [''] = { dap.step_into, 'Debug: Step Into' }, - [''] = { dap.step_over, 'Debug: Step Over' }, - [''] = { dap.step_out, 'Debug: Step Out' }, - [''] = { dapui.toggle, 'Debug: See last session result' }, - ['tB'] = { dap.toggle_breakpoint, 'Debug: Toggle Breakpoint' }, - ['B'] = { - function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - 'Debug: Set Breakpoint', - }, - } - - for key, config in pairs(keymaps) do - vim.keymap.set('n', key, config[1], { desc = config[2] }) - end -end - --- Event listeners setup --- Configures automatic UI opening/closing based on debug session events ----@param dap table # DAP module instance ----@param dapui table # DAP UI module instance ----@return nil -local function setup_dap_listeners(dap, dapui) - local dapui_config = 'dapui_config' - dap.listeners.after.event_initialized[dapui_config] = dapui.open - dap.listeners.before.event_terminated[dapui_config] = dapui.close - dap.listeners.before.event_exited[dapui_config] = dapui.close -end - --- DAP UI configuration --- Sets up the debugging user interface with custom icons and controls ----@param dapui table # DAP UI module instance ----@return nil -local function setup_dapui_config(dapui) - dapui.setup { - icons = { - expanded = '▾', - collapsed = '▸', - current_frame = '*', - }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } -end - --- Mason DAP configuration --- Automatically installs and configures debug adapters through Mason ----@return nil -local function setup_mason_dap() - require('mason-nvim-dap').setup { - automatic_installation = true, - handlers = {}, - ensure_installed = { 'delve', 'python', 'codelldb' }, - } -end - --- Main configuration orchestrator --- Sets up all debugging components in the correct order ----@return nil -local function setup_dap() - local dap = require 'dap' - local dapui = require 'dapui' - - setup_mason_dap() - setup_dapui_config(dapui) - setup_dap_listeners(dap, dapui) - setup_language_adapters(dap) - setup_keymaps(dap, dapui) -end - --- Plugin specification --- Configures nvim-dap with all necessary dependencies for debugging ----@return table # Plugin specification for lazy.nvim -return { - 'mfussenegger/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', -- Beautiful debugger UI - 'nvim-neotest/nvim-nio', -- Required dependency for nvim-dap-ui - 'williamboman/mason.nvim', -- Package manager for debug adapters - 'jay-babu/mason-nvim-dap.nvim', -- Mason integration for DAP - 'leoluz/nvim-dap-go', -- Go debugging support - 'mfussenegger/nvim-dap-python', -- Python debugging support - }, - config = function() - setup_dap() - end, -} diff --git a/nvim/.config/nvim/lua/plugins/gitsigns.lua b/nvim/.config/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index 1a87c61..0000000 --- a/nvim/.config/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,67 +0,0 @@ --- Adds git related signs to the gutter, as well as utilities --- for managing changes - -return { - { - 'lewis6991/gitsigns.nvim', - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - local gitsigns = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', ']c', function() - if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } - else - gitsigns.nav_hunk 'next' - end - end, { desc = 'Jump to next git [c]hange' }) - - map('n', '[c', function() - if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } - else - gitsigns.nav_hunk 'prev' - end - end, { desc = 'Jump to previous git [c]hange' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [s]tage hunk' }) - map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'git [r]eset hunk' }) - -- normal mode - map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) - map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) - map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) - map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' }) - map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) - map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) - map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) - map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) - map('n', 'hD', function() - gitsigns.diffthis '@' - end, { desc = 'git [D]iff against last commit' }) - -- Toggles - map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) - map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' }) - end, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/harpoon.lua b/nvim/.config/nvim/lua/plugins/harpoon.lua deleted file mode 100644 index bf43c5d..0000000 --- a/nvim/.config/nvim/lua/plugins/harpoon.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - 'ThePrimeagen/harpoon', - branch = 'harpoon2', - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function() - local harpoon = require 'harpoon' - harpoon:setup() - - vim.keymap.set('n', 'a', function() - harpoon:list():add() - end) - vim.keymap.set('n', '', function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end) - - vim.keymap.set('n', '1', function() - harpoon:list():select(1) - end) - vim.keymap.set('n', '2', function() - harpoon:list():select(2) - end) - vim.keymap.set('n', '3', function() - harpoon:list():select(3) - end) - vim.keymap.set('n', '4', function() - harpoon:list():select(4) - end) - - vim.keymap.set('n', 'hp', function() - harpoon:list():prev() - end) - vim.keymap.set('n', 'hn', function() - harpoon:list():next() - end) - end, -} diff --git a/nvim/.config/nvim/lua/plugins/indent_line.lua b/nvim/.config/nvim/lua/plugins/indent_line.lua deleted file mode 100644 index cc1c414..0000000 --- a/nvim/.config/nvim/lua/plugins/indent_line.lua +++ /dev/null @@ -1,13 +0,0 @@ --- Add indentation guides even on blank lines - -return { - { - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` - main = 'ibl', - ---@module "ibl" - ---@type ibl.config - opts = {}, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua deleted file mode 100644 index d607118..0000000 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ /dev/null @@ -1,63 +0,0 @@ --- Linting - -return { - - { - 'mfussenegger/nvim-lint', - event = { 'BufReadPre', 'BufNewFile' }, - config = function() - local lint = require 'lint' - lint.linters_by_ft = lint.linters_by_ft or {} - lint.linters_by_ft['cpp'] = { 'cppcheck' } - lint.linters_by_ft['dockerfile'] = { 'hadolint' } - lint.linters_by_ft['json'] = { 'jsonlint' } - lint.linters_by_ft['terraform'] = { 'tflint', 'terraform_validate' } - lint.linters_by_ft['python'] = { 'ruff', 'bandit' } - lint.linters_by_ft['markdown'] = nil - lint.linters_by_ft['text'] = nil - lint.linters_by_ft['sh'] = { 'shellcheck' } - lint.linters.shellcheck.args = { '-x' } - - -- Default linters, which will cause errors unless these tools are available: - -- { - -- clojure = { "clj-kondo" }, - -- dockerfile = { "hadolint" }, - -- inko = { "inko" }, - -- janet = { "janet" }, - -- json = { "jsonlint" }, - -- markdown = { "vale" }, - -- rst = { "vale" }, - -- ruby = { "ruby" }, - -- terraform = { "tflint" }, - -- text = { "vale" } - -- } - -- - -- They can be disabled by setting their filetypes to nil: - -- lint.linters_by_ft['clojure'] = nil - -- lint.linters_by_ft['dockerfile'] = nil - -- lint.linters_by_ft['inko'] = nil - -- lint.linters_by_ft['janet'] = nil - -- lint.linters_by_ft['json'] = nil - -- lint.linters_by_ft['markdown'] = nil - -- lint.linters_by_ft['rst'] = nil - -- lint.linters_by_ft['ruby'] = nil - -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil - - -- Create autocommand which carries out the actual linting - -- on the specified events. - local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { - group = lint_augroup, - callback = function() - -- Only run the linter in buffers that you can modify in order to - -- avoid superfluous noise, notably within the handy LSP pop-ups that - -- describe the hovered symbol using Markdown. - if vim.opt_local.modifiable:get() then - lint.try_lint() - end - end, - }) - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 18a00ff..0000000 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,229 +0,0 @@ --- LSP Plugins - -return { - { - -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins - -- used for completion, annotations and signatures of Neovim apis - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- Load luvit types when the `vim.uv` word is found - { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, - }, - }, - }, - { - -- Main LSP Configuration - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs and related tools to stdpath for Neovim - -- Mason must be loaded before its dependents so we need to set it up here. - -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` - { 'williamboman/mason.nvim', opts = {} }, - 'williamboman/mason-lspconfig.nvim', - 'WhoIsSethDaniel/mason-tool-installer.nvim', - - -- Useful status updates for LSP. - { 'j-hui/fidget.nvim', opts = {} }, - - -- Allows extra capabilities provided by blink.cmp - 'saghen/blink.cmp', - }, - config = function() - -- This function gets run when an LSP attaches to a particular buffer. - -- That is to say, every time a new file is opened that is associated with - -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this - -- function will be executed to configure the current buffer - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), - callback = function(event) - -- Utility to more easily define mappings specific for LSP related items. - -- It sets the mode, buffer and description for us each time. - local map = function(keys, func, desc, mode) - mode = mode or 'n' - vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - - -- Find references for the word under your cursor. - map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- Jump to the definition of the word under your cursor. - -- This is where a variable was first declared, or where a function is defined, etc. - -- To jump back, press . - map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - - -- The following two autocommands are used to highlight references of the - -- word under your cursor when your cursor rests there for a little while. - -- See `:help CursorHold` for information about when this is executed - -- - -- When you move your cursor, the highlights will be cleared (the second autocommand). - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then - local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd('LspDetach', { - group = vim.api.nvim_create_augroup('lsp-detach', { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'lsp-highlight', buffer = event2.buf } - end, - }) - end - - -- The following code creates a keymap to toggle inlay hints in your - -- code, if the language server you are using supports them - -- - -- This may be unwanted, since they displace some of your code - if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then - map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) - end, '[T]oggle Inlay [H]ints') - end - end, - }) - - -- Diagnostic Config - -- See :help vim.diagnostic.Opts - vim.diagnostic.config { - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = vim.diagnostic.severity.ERROR }, - signs = vim.g.have_nerd_font and { - text = { - [vim.diagnostic.severity.ERROR] = '󰅚 ', - [vim.diagnostic.severity.WARN] = '󰀪 ', - [vim.diagnostic.severity.INFO] = '󰋽 ', - [vim.diagnostic.severity.HINT] = '󰌶 ', - }, - } or {}, - virtual_text = { - source = 'if_many', - spacing = 2, - format = function(diagnostic) - local diagnostic_message = { - [vim.diagnostic.severity.ERROR] = diagnostic.message, - [vim.diagnostic.severity.WARN] = diagnostic.message, - [vim.diagnostic.severity.INFO] = diagnostic.message, - [vim.diagnostic.severity.HINT] = diagnostic.message, - } - return diagnostic_message[diagnostic.severity] - end, - }, - } - - -- LSP servers and clients are able to communicate to each other what features they support. - -- - -- By default, Neovim doesn't support everything that is in the LSP specification. - -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. - -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. - local capabilities = require('blink.cmp').get_lsp_capabilities() - - -- Enable the following language servers. They will automatically be installed. - -- - -- Add any additional override configuration in the following tables. Available keys are: - -- - cmd (table): Override the default command used to start the server - -- - filetypes (table): Override the default list of associated filetypes for the server - -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. - -- - settings (table): Override the default settings passed when initializing the server. - -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ - local servers = { - -- See `:help lspconfig-all` for a list of all the pre-configured LSPs - clangd = {}, - gopls = {}, - pyright = {}, - rust_analyzer = {}, - -- NOTE: https://github.com/pmizio/typescript-tools.nvim may be a better - -- LSP to use here at some point. - ts_ls = {}, - lua_ls = { - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - }, - }, - }, - tailwindcss = {}, - mesonlsp = {}, - terraformls = {}, - } - - -- Ensure the servers and tools above are installed - -- - -- To check the current status of installed tools and/or manually install - -- other tools, you can run - -- :Mason - -- - -- You can press `g?` for help in this menu. - -- - -- `mason` had to be setup earlier: to configure its options see the - -- `dependencies` table for `nvim-lspconfig` above. - -- - -- You can add other tools here that you want Mason to install - -- for you, so that they are available from within Neovim. - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - 'stylua', -- Used to format Lua code - }) - require('mason-tool-installer').setup { ensure_installed = ensure_installed } - - require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Populated via mason-tool-installer) - automatic_installation = false, - automatic_enable = true, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) - require('lspconfig')[server_name].setup(server) - end, - }, - } - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/lualine.lua b/nvim/.config/nvim/lua/plugins/lualine.lua deleted file mode 100644 index c5ed579..0000000 --- a/nvim/.config/nvim/lua/plugins/lualine.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - { - "nvim-lualine/lualine.nvim", - event = "VeryLazy", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { - options = { - theme = "tokyonight", - component_separators = { left = "|", right = "|" }, - section_separators = { left = "", right = "" }, - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/mini.lua b/nvim/.config/nvim/lua/plugins/mini.lua deleted file mode 100644 index 0138e29..0000000 --- a/nvim/.config/nvim/lua/plugins/mini.lua +++ /dev/null @@ -1,41 +0,0 @@ --- Collection of various small independent plugins/modules - -return { - { - 'echasnovski/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/oil.lua b/nvim/.config/nvim/lua/plugins/oil.lua deleted file mode 100644 index f200559..0000000 --- a/nvim/.config/nvim/lua/plugins/oil.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - 'stevearc/oil.nvim', - ---@module 'oil' - ---@type oil.SetupOpts - opts = {}, - dependencies = { { 'echasnovski/mini.icons', opts = {} } }, - config = function(_, opts) - vim.keymap.set('n', '\\', 'Oil --float', { desc = 'Open parent directory in floating window' }) - vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) - require('oil').setup(opts) - end, - lazy = false, -} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 90064f6..0000000 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,109 +0,0 @@ --- Fuzzy Finder (files, lsp, etc) - -return { - { - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - dependencies = { - 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope-fzf-native.nvim', - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, - }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - }, - config = function() - -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search - -- many different aspects of Neovim, your workspace, LSP, and more! - -- - -- The easiest way to use Telescope, is to start by doing something like: - -- :Telescope help_tags - -- - -- After running this command, a window will open up and you're able to - -- type in the prompt window. You'll see a list of `help_tags` options and - -- a corresponding preview of the help. - -- - -- Two important keymaps to use while in Telescope are: - -- - Insert mode: - -- - Normal mode: ? - -- - -- This opens a window that shows you all of the keymaps for the current - -- Telescope picker. This is really useful to discover what Telescope can - -- do as well as how to actually do it! - - -- [[ Configure Telescope ]] - -- See `:help telescope` and `:help telescope.setup()` - require('telescope').setup { - defaults = { - vimgrep_arguments = { - 'rg', - '--color=never', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case', - '--hidden', - '--glob', - '!.git/*', - }, - }, - pickers = { - find_files = { - find_command = { 'fd', '--type', 'f', '--hidden', '--strip-cwd-prefix', '--exclude', '.git' }, - }, - }, - extensions = { - ['ui-select'] = { - require('telescope.themes').get_dropdown(), - }, - }, - } - - -- Enable Telescope extensions if they are installed - pcall(require('telescope').load_extension, 'fzf') - pcall(require('telescope').load_extension, 'ui-select') - - -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - - -- Slightly advanced example of overriding default behavior and theme - vim.keymap.set('n', '/', function() - -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) - end, { desc = '[/] Fuzzily search in current buffer' }) - - -- It's also possible to pass additional configuration options. - -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() - builtin.live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } - end, { desc = '[S]earch [/] in Open Files' }) - - -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) - end, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/plugins/tmux-navigator.lua deleted file mode 100644 index a161285..0000000 --- a/nvim/.config/nvim/lua/plugins/tmux-navigator.lua +++ /dev/null @@ -1,20 +0,0 @@ ---- Vim Tmux Navigator is a plugin that allows you to navigate between Vim and Tmux panes seamlessly. - -return { - 'christoomey/vim-tmux-navigator', - cmd = { - 'TmuxNavigateLeft', - 'TmuxNavigateDown', - 'TmuxNavigateUp', - 'TmuxNavigateRight', - 'TmuxNavigatePrevious', - 'TmuxNavigatorProcessList', - }, - keys = { - { '', 'TmuxNavigateLeft' }, - { '', 'TmuxNavigateDown' }, - { '', 'TmuxNavigateUp' }, - { '', 'TmuxNavigateRight' }, - { '', 'TmuxNavigatePrevious' }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/todo-comments.lua b/nvim/.config/nvim/lua/plugins/todo-comments.lua deleted file mode 100644 index 3b3bd96..0000000 --- a/nvim/.config/nvim/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,41 +0,0 @@ --- Highlight todo, notes, etc in comments - -return { - { - 'folke/todo-comments.nvim', - event = 'VimEnter', - dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { - signs = false, - keywords = { - NOTE = { - color = 'hint', - alt = { 'INFO', 'Note' }, - }, - }, - }, - keys = { - { - ']t', - function() - require('todo-comments').jump_next() - end, - desc = 'Next todo comment', - }, - { - '[t', - function() - require('todo-comments').jump_prev() - end, - desc = 'Previous todo comment', - }, - { - 'st', - function() - vim.cmd 'TodoTelescope' - end, - desc = 'Search todo comments', - }, - }, - }, -} diff --git a/nvim/.config/nvim/lua/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/plugins/tree-sitter.lua deleted file mode 100644 index ea68249..0000000 --- a/nvim/.config/nvim/lua/plugins/tree-sitter.lua +++ /dev/null @@ -1,28 +0,0 @@ --- Highlight, edit, and navigate code - -return { - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - main = 'nvim-treesitter.configs', - -- [[ Configure Treesitter ]] See `:help nvim-treesitter` - opts = { - ensure_installed = 'all', - -- Autoinstall languages that are not installed - auto_install = true, - highlight = { - enable = true, - -- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules. - -- If you are experiencing weird indenting issues, add the language to - -- the list of additional_vim_regex_highlighting and disabled languages for indent. - additional_vim_regex_highlighting = { 'ruby', 'cpp' }, - }, - indent = { enable = true, disable = { 'ruby', 'cpp' } }, - }, - -- Additional nvim-treesitter modules to explore: - -- - -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context - -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - }, -} diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua deleted file mode 100644 index ca43c7a..0000000 --- a/nvim/.config/nvim/lua/plugins/which-key.lua +++ /dev/null @@ -1,55 +0,0 @@ --- which-key is a useful plugin to show you pending keybinds. - -return { - { - 'folke/which-key.nvim', - event = 'VimEnter', - opts = { - -- delay between pressing a key and opening which-key (milliseconds) - -- this setting is independent of vim.opt.timeoutlen - delay = 0, - icons = { - mappings = vim.g.have_nerd_font, - -- If you are using a Nerd Font: set icons.keys to an empty table which will use the - -- default which-key.nvim defined Nerd Font icons, otherwise define a string table - keys = vim.g.have_nerd_font and {} or { - Up = ' ', - Down = ' ', - Left = ' ', - Right = ' ', - C = ' ', - M = ' ', - D = ' ', - S = ' ', - CR = ' ', - Esc = ' ', - ScrollWheelDown = ' ', - ScrollWheelUp = ' ', - NL = ' ', - BS = ' ', - Space = ' ', - Tab = ' ', - F1 = '', - F2 = '', - F3 = '', - F4 = '', - F5 = '', - F6 = '', - F7 = '', - F8 = '', - F9 = '', - F10 = '', - F11 = '', - F12 = '', - }, - }, - - -- Document existing key chains - spec = { - { 's', group = '[S]earch' }, - { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, - }, - }, - }, -} -- cgit v1.2.3 From 53788a32f132d62abe8a206c99401b4a2e8da88d Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Aug 2025 20:29:54 -0400 Subject: Add nvim treesitter context --- nvim/.config/nvim/lua/eugenetriguba/autocmds.lua | 2 +- nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua index e4ed02b..145d00a 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua @@ -3,6 +3,6 @@ vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), callback = function() - vim.highlight.on_yank() + vim.hl.on_yank() end, }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua index 47631c3..63e3d39 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -3,6 +3,10 @@ vim.pack.add { name = 'nvim-treesitter', src = 'https://github.com/nvim-treesitter/nvim-treesitter', }, + { + name = 'nvim-treesitter-context', + src = 'https://github.com/nvim-treesitter/nvim-treesitter-context', + }, } require('nvim-treesitter.configs').setup { -- cgit v1.2.3 From 5ec4d9936b9e62633b33f9e3341dd1815e09292b Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Aug 2025 20:32:37 -0400 Subject: Add nts update --- nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua index 63e3d39..6eda91d 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -31,3 +31,10 @@ vim.api.nvim_create_autocmd('VimEnter', { vim.cmd 'TSUpdate' end, }) + +local nts = require 'nvim-treesitter' +vim.api.nvim_create_autocmd('PackChanged', { + callback = function() + nts.update() + end, +}) -- cgit v1.2.3 From 053cd3c35bcc04fa2580aa2dd9249b46a62954b3 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Aug 2025 20:49:22 -0400 Subject: adjust pack update for tree sitter --- .../nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua index 6eda91d..1f57e46 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -25,16 +25,14 @@ require('nvim-treesitter.configs').setup { textobjects = { enable = true }, } -vim.api.nvim_create_autocmd('VimEnter', { - once = true, - callback = function() - vim.cmd 'TSUpdate' - end, -}) - local nts = require 'nvim-treesitter' vim.api.nvim_create_autocmd('PackChanged', { - callback = function() - nts.update() + callback = function(args) + local spec = args.data.spec + if spec and spec.name == 'nvim-treesitter' and args.data.kind == 'update' then + vim.schedule(function() + nts.update() + end) + end end, }) -- cgit v1.2.3 From 5b1c62e9c1ca4949f1da2a73237678d7d6ae3d4e Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 10 Aug 2025 21:04:53 -0400 Subject: Add starship and simplify fzf lua --- nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua index e2686b6..0b7029d 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua @@ -12,11 +12,7 @@ vim.pack.add({ vim.api.nvim_create_autocmd('VimEnter', { once = true, callback = function() - require('fzf-lua').setup { - files = { - hidden = true, - }, - } + require('fzf-lua').setup {} vim.keymap.set('n', 'sh', require('fzf-lua').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', require('fzf-lua').keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', require('fzf-lua').files, { desc = '[S]earch [F]iles' }) -- cgit v1.2.3