From 0bbd3de7bea9d3634fffd7adfa3a43daf8aea398 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 20 Apr 2025 10:00:17 -0400 Subject: tweak zshrc and lockfile --- nvim/.config/nvim/lazy-lock.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 57d2f1e..b24b124 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,3 +1,4 @@ { - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" } + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" } } -- cgit v1.2.3 From 15ce60180a144eefcc735989d878944fb1859746 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 22 Apr 2025 09:00:33 -0400 Subject: fix lockfile --- nvim/.config/nvim/lazy-lock.json | 3 --- 1 file changed, 3 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 8b17953..1493a28 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,7 +1,5 @@ { "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, -<<<<<<< HEAD -======= "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "1ef260eb4f54515fe121a2267b477efb054d108a" }, @@ -9,6 +7,5 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-web-devicons": { "branch": "master", "commit": "855c97005c8eebcdd19846f2e54706bffd40ee96" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, ->>>>>>> upstream "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" } } -- cgit v1.2.3 From 363dd14bff5f7da7fada3bc78c9dad37ca04a188 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 28 Apr 2025 07:33:25 -0400 Subject: add telescope --- nvim/.config/nvim/lazy-lock.json | 8 ++++---- nvim/.config/nvim/lua/config/keymaps.lua | 12 +++++++++++- nvim/.config/nvim/lua/plugins/editor.lua | 30 ++++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 13 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 1493a28..5eee803 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,11 +1,11 @@ { "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "1ef260eb4f54515fe121a2267b477efb054d108a" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-web-devicons": { "branch": "master", "commit": "855c97005c8eebcdd19846f2e54706bffd40ee96" }, + "nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" } } diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua index d4d2a45..c77b7ed 100644 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -1,5 +1,15 @@ -vim.g.mapleader = "" +vim.g.mapleader = " " vim.g.maplocalleader = "\\" local map = vim.keymap.set +local telescope = require('telescope.builtin') + +map('n', 'ff', telescope.find_files, { desc = 'Telescope find files' }) +map('n', 'fg', telescope.live_grep, { desc = 'Telescope live grep' }) +map('n', 'fb', telescope.buffers, { desc = 'Telescope buffers' }) +map('n', 'fh', telescope.help_tags, { desc = 'Telescope help tags' }) + + +map("n", "sh", ":split") +map("n", "sv", ":vsplit") diff --git a/nvim/.config/nvim/lua/plugins/editor.lua b/nvim/.config/nvim/lua/plugins/editor.lua index 022b72a..27b8a88 100644 --- a/nvim/.config/nvim/lua/plugins/editor.lua +++ b/nvim/.config/nvim/lua/plugins/editor.lua @@ -7,15 +7,29 @@ return { end, }, { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + require("telescope").setup { + extensions = { + file_browser = { + theme = "ivy", + hijack_netrw = true, + }, + }, + } + end, + }, + { + "nvim-telescope/telescope-file-browser.nvim", dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - -- {"3rd/image.nvim", opts = {}}, + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim" }, - lazy = false, - opts = {}, + version = false, + config = function() + require("telescope").load_extension "file_browser" + end, } } -- cgit v1.2.3 From 6847b133c3d131f6195e316bd05f8589ef97aa93 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 20 May 2025 12:41:19 -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 5eee803..93a3ef2 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -3,7 +3,7 @@ "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" }, + "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, -- cgit v1.2.3 From c3465bef27510c36afc7147a1c88d863391035dd Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 27 May 2025 19:20:34 -0400 Subject: adjust nvim config --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/config/autocmds.lua | 2 +- nvim/.config/nvim/lua/config/filetypes.lua | 4 +- nvim/.config/nvim/lua/plugins/blink.lua | 3 +- nvim/.config/nvim/lua/plugins/conform.lua | 56 +++++++++++++++++++------ nvim/.config/nvim/lua/plugins/debug.lua | 21 +++------- nvim/.config/nvim/lua/plugins/indent_line.lua | 4 +- nvim/.config/nvim/lua/plugins/lint.lua | 27 +++++------- nvim/.config/nvim/lua/plugins/lsp.lua | 2 +- nvim/.config/nvim/lua/plugins/mini.lua | 4 +- nvim/.config/nvim/lua/plugins/telescope.lua | 14 ++----- nvim/.config/nvim/lua/plugins/todo-comments.lua | 2 +- nvim/.config/nvim/lua/plugins/tokyonight.lua | 8 ++-- nvim/.config/nvim/lua/plugins/tree-sitter.lua | 4 +- nvim/.config/nvim/lua/plugins/vim-sleuth.lua | 5 ++- nvim/.config/nvim/lua/plugins/which-key.lua | 3 +- 16 files changed, 86 insertions(+), 74 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 74bb628..ea24cea 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -19,6 +19,7 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, + "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" }, "nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" }, diff --git a/nvim/.config/nvim/lua/config/autocmds.lua b/nvim/.config/nvim/lua/config/autocmds.lua index 4b210af..1e8b533 100644 --- a/nvim/.config/nvim/lua/config/autocmds.lua +++ b/nvim/.config/nvim/lua/config/autocmds.lua @@ -7,7 +7,7 @@ local autocmd = vim.api.nvim_create_autocmd -- See `:help vim.highlight.on_yank()` autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + 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 index 428cb14..38ae06f 100644 --- a/nvim/.config/nvim/lua/config/filetypes.lua +++ b/nvim/.config/nvim/lua/config/filetypes.lua @@ -7,8 +7,8 @@ vim.api.nvim_create_autocmd('FileType', { vim.opt_local.shiftwidth = 4 vim.opt_local.expandtab = true - -- 88 character length lines for Black formatter - vim.opt_local.colorcolumn = '88' + -- 120 character length lines for Black formatter + vim.opt_local.colorcolumn = '120' -- Google-style docstrings vim.g.python_style = 'google' diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua index 2a7bd69..d83ee7f 100644 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -72,7 +72,7 @@ return { 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 = false, auto_show_delay_ms = 500 }, + documentation = { auto_show = true, auto_show_delay_ms = 500 }, }, sources = { @@ -97,5 +97,4 @@ return { signature = { enabled = true }, }, }, - } diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 37dba09..ee2777c 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -13,28 +13,58 @@ return { desc = '[F]ormat buffer', }, }, + config = function() + vim.api.nvim_create_user_command('FormatDisable', function(args) + if args.bang then + -- FormatDisable! will disable formatting just for this buffer + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end + end, { + desc = 'Disable autoformat-on-save', + bang = true, + }) + + 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, opts = { notify_on_error = false, format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + -- 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 = { sql = true, c = true, cpp = true } if disable_filetypes[vim.bo[bufnr].filetype] then return nil - else - return { - timeout_ms = 500, - lsp_format = 'fallback', - } end + + return { + timeout_ms = 500, + lsp_format = 'fallback', + } end, formatters_by_ft = { lua = { 'stylua' }, - python = { "isort", "black" }, - -- 'stop_after_first' will run the first available - -- formatter from the list - javascript = { "prettierd", "prettier", stop_after_first = true }, + go = { 'goimports', 'gofmt' }, + python = { 'isort', 'black' }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + }, + formatters = { + isort = { + prepend_args = { '--profile', 'black' }, + }, + black = { + prepend_args = { '--line-length', '120' }, + }, }, }, }, diff --git a/nvim/.config/nvim/lua/plugins/debug.lua b/nvim/.config/nvim/lua/plugins/debug.lua index 753cb0c..fb59be1 100644 --- a/nvim/.config/nvim/lua/plugins/debug.lua +++ b/nvim/.config/nvim/lua/plugins/debug.lua @@ -1,15 +1,9 @@ -- debug.lua -- -- Shows how to use the DAP plugin to debug your code. --- --- Primarily focused on configuring the debugger for Go, but can --- be extended to other languages as well. That's why it's called --- kickstart.nvim and not kitchen-sink.nvim ;) return { - -- NOTE: Yes, you can install new plugins here! 'mfussenegger/nvim-dap', - -- NOTE: And you can specify dependencies as well dependencies = { -- Creates a beautiful debugger UI 'rcarriga/nvim-dap-ui', @@ -17,15 +11,15 @@ return { -- Required dependency for nvim-dap-ui 'nvim-neotest/nvim-nio', - -- Installs the debug adapters for you + -- Installs the debug adapters 'williamboman/mason.nvim', 'jay-babu/mason-nvim-dap.nvim', - -- Add your own debuggers here + -- Debugger adapters 'leoluz/nvim-dap-go', + 'mfussenegger/nvim-dap-python', }, keys = { - -- Basic debugging keymaps, feel free to change to your liking! { '', function() @@ -86,24 +80,19 @@ return { -- reasonable debug configurations automatic_installation = true, - -- You can provide additional configuration to the handlers, -- see mason-nvim-dap README for more information handlers = {}, - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want 'delve', + 'python', }, } -- Dap UI setup -- For more information, see |:help nvim-dap-ui| dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, controls = { icons = { @@ -144,5 +133,7 @@ return { detached = vim.fn.has 'win32' == 0, }, } + + require('dap-python').setup 'python3' end, } diff --git a/nvim/.config/nvim/lua/plugins/indent_line.lua b/nvim/.config/nvim/lua/plugins/indent_line.lua index ed7f269..041ba40 100644 --- a/nvim/.config/nvim/lua/plugins/indent_line.lua +++ b/nvim/.config/nvim/lua/plugins/indent_line.lua @@ -1,5 +1,7 @@ +-- Add indentation guides even on blank lines + return { - { -- Add indentation guides even on blank lines + { 'lukas-reineke/indent-blankline.nvim', -- Enable `lukas-reineke/indent-blankline.nvim` -- See `:help ibl` diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index df2b809..a4b6c05 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -1,25 +1,18 @@ return { - - { -- Linting + { 'mfussenegger/nvim-lint', event = { 'BufReadPre', 'BufNewFile' }, config = function() local lint = require 'lint' - lint.linters_by_ft = { - cpp = { 'cppcheck' }, - dockerfile = { 'hadolint' }, - json = { 'jsonlint' }, - terraform = { 'tflint' }, - python = { 'ruff', 'bandit' }, - } + 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' } + lint.linters_by_ft['python'] = { 'ruff', 'bandit' } + lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- To allow other plugins to add linters to require('lint').linters_by_ft, - -- instead set linters_by_ft like this: - -- lint.linters_by_ft = lint.linters_by_ft or {} - -- lint.linters_by_ft['markdown'] = { 'markdownlint' } - -- - -- However, note that this will enable a set of default linters, - -- which will cause errors unless these tools are available: + -- Default linters, which will cause errors unless these tools are available: -- { -- clojure = { "clj-kondo" }, -- dockerfile = { "hadolint" }, @@ -33,7 +26,7 @@ return { -- text = { "vale" } -- } -- - -- You can disable the default linters by setting their filetypes to nil: + -- 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 diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index f7c9b90..a4cbc18 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -1,5 +1,5 @@ +-- LSP Plugins return { - -- LSP Plugins { -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis diff --git a/nvim/.config/nvim/lua/plugins/mini.lua b/nvim/.config/nvim/lua/plugins/mini.lua index b8d78b5..0138e29 100644 --- a/nvim/.config/nvim/lua/plugins/mini.lua +++ b/nvim/.config/nvim/lua/plugins/mini.lua @@ -1,5 +1,7 @@ +-- Collection of various small independent plugins/modules + return { - { -- Collection of various small independent plugins/modules + { 'echasnovski/mini.nvim', config = function() -- Better Around/Inside textobjects diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 4256675..8ca3d26 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -1,25 +1,19 @@ +-- Fuzzy Finder (files, lsp, etc) + return { - { -- Fuzzy Finder (files, lsp, etc) + { 'nvim-telescope/telescope.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim', - { -- If encountering errors, see telescope-fzf-native README for installation instructions + { 'nvim-telescope/telescope-fzf-native.nvim', - - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. build = 'make', - - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. cond = function() return vim.fn.executable 'make' == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, - - -- Useful for getting pretty icons, but requires a Nerd Font. { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() diff --git a/nvim/.config/nvim/lua/plugins/todo-comments.lua b/nvim/.config/nvim/lua/plugins/todo-comments.lua index 485da8c..8dc2cc7 100644 --- a/nvim/.config/nvim/lua/plugins/todo-comments.lua +++ b/nvim/.config/nvim/lua/plugins/todo-comments.lua @@ -1,5 +1,5 @@ +-- Highlight todo, notes, etc in comments return { - -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', diff --git a/nvim/.config/nvim/lua/plugins/tokyonight.lua b/nvim/.config/nvim/lua/plugins/tokyonight.lua index b19aecb..aae2d30 100644 --- a/nvim/.config/nvim/lua/plugins/tokyonight.lua +++ b/nvim/.config/nvim/lua/plugins/tokyonight.lua @@ -1,4 +1,6 @@ --- To see what colorschemes are already installed, you can use `:Telescope colorscheme`. +-- Setup the tokyonight color scheme. +-- +-- To see what colorschemes are already installed: `:Telescope colorscheme`. return { { @@ -11,9 +13,7 @@ return { }, } - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. + -- Other styles: 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. vim.cmd.colorscheme 'tokyonight' end, }, diff --git a/nvim/.config/nvim/lua/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/plugins/tree-sitter.lua index cdcf66f..ea68249 100644 --- a/nvim/.config/nvim/lua/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/plugins/tree-sitter.lua @@ -1,4 +1,5 @@ -- Highlight, edit, and navigate code + return { { 'nvim-treesitter/nvim-treesitter', @@ -18,8 +19,7 @@ return { }, indent = { enable = true, disable = { 'ruby', 'cpp' } }, }, - -- There are additional nvim-treesitter modules that you can use to interact - -- with nvim-treesitter. You should go explore a few and see what interests you: + -- 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 diff --git a/nvim/.config/nvim/lua/plugins/vim-sleuth.lua b/nvim/.config/nvim/lua/plugins/vim-sleuth.lua index 07e73d3..93904da 100644 --- a/nvim/.config/nvim/lua/plugins/vim-sleuth.lua +++ b/nvim/.config/nvim/lua/plugins/vim-sleuth.lua @@ -1,4 +1,5 @@ +-- Detect tabstop and shiftwidth automatically + return { - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', } - diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua index 896100a..ca43c7a 100644 --- a/nvim/.config/nvim/lua/plugins/which-key.lua +++ b/nvim/.config/nvim/lua/plugins/which-key.lua @@ -3,13 +3,12 @@ return { { 'folke/which-key.nvim', - event = 'VimEnter', -- Set the loading event to 'VimEnter' + event = 'VimEnter', opts = { -- delay between pressing a key and opening which-key (milliseconds) -- this setting is independent of vim.opt.timeoutlen delay = 0, icons = { - -- set icon mappings to true if you have a Nerd Font 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 -- cgit v1.2.3 From 275a75a1cad41e9fcfab48f643a1e3026b7e493b Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 2 Jun 2025 09:15:22 -0400 Subject: add experiment with pytest lsp to get monolith lsp working --- nvim/.config/nvim/lua/plugins/lsp.lua | 24 +++++++++++++++++++----- nvim/.config/nvim/lua/plugins/mini.lua | 7 ------- 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index a4cbc18..55fc34e 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -202,7 +202,7 @@ return { local capabilities = require('blink.cmp').get_lsp_capabilities() -- Enable the following language servers - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- Feel free to add/remove any LSPs that you want here. 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 @@ -228,6 +228,7 @@ return { }, }, }, + stylua = {} } -- Ensure the servers and tools above are installed @@ -244,11 +245,7 @@ return { -- 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, @@ -260,6 +257,23 @@ return { -- 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 {}) + + -- When we're editing the monolith project, the dependencies are so old + -- we can't install them locally on an ARM mac. Therefore, we want to use + -- a pyright server *within* the docker container. + print("[DEBUG] server_name: " .. server_name) + if server_name == "pyright" then + local cwd = vim.loop.cwd() + print("[DEBUG] cwd: " .. cwd) + if cwd and cwd:match("monolith") then + print("[DEBUG] Using Dockerized Pyright setup") + vim.notify("[LSP] Using Docker for pyright in " .. cwd, vim.log.levels.INFO) + server.cmd = { + "docker", "exec", "-i", "monolith-web", "pyright-langserver", "--stdio" + } + end + end + require('lspconfig')[server_name].setup(server) end, }, diff --git a/nvim/.config/nvim/lua/plugins/mini.lua b/nvim/.config/nvim/lua/plugins/mini.lua index 0138e29..4048fae 100644 --- a/nvim/.config/nvim/lua/plugins/mini.lua +++ b/nvim/.config/nvim/lua/plugins/mini.lua @@ -19,11 +19,7 @@ return { -- - 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 @@ -33,9 +29,6 @@ return { statusline.section_location = function() return '%2l:%-2v' end - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim end, }, } -- cgit v1.2.3 From 009b318b164c0a84fa4c12f92b8deb3ecfe5953c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 2 Jun 2025 09:17:20 -0400 Subject: disable netrw --- nvim/.config/nvim/lua/config/global.lua | 4 ++++ nvim/.config/nvim/lua/plugins/neo-tree.lua | 1 + 2 files changed, 5 insertions(+) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/config/global.lua b/nvim/.config/nvim/lua/config/global.lua index 26d1265..8769e85 100644 --- a/nvim/.config/nvim/lua/config/global.lua +++ b/nvim/.config/nvim/lua/config/global.lua @@ -5,3 +5,7 @@ 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 diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua index a87c878..556111b 100644 --- a/nvim/.config/nvim/lua/plugins/neo-tree.lua +++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua @@ -4,6 +4,7 @@ return { 'nvim-neo-tree/neo-tree.nvim', version = '*', + lazy = false, dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons', -- cgit v1.2.3 From eca9bcc645f73a0275b94c8ce6084c3bb0e4ae37 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 2 Jun 2025 09:25:50 -0400 Subject: add conform keys/formatters and cleanup lsp config --- nvim/.config/nvim/lua/plugins/conform.lua | 38 ++++++++++++++++++++- nvim/.config/nvim/lua/plugins/lsp.lua | 55 ++++--------------------------- 2 files changed, 44 insertions(+), 49 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index ee2777c..0f5af02 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -3,6 +3,7 @@ return { 'stevearc/conform.nvim', event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, + lazy = false, keys = { { 'f', @@ -12,6 +13,36 @@ return { 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', + }, }, config = function() vim.api.nvim_create_user_command('FormatDisable', function(args) @@ -55,8 +86,13 @@ return { formatters_by_ft = { lua = { 'stylua' }, go = { 'goimports', 'gofmt' }, - python = { 'isort', 'black' }, + python = { '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 }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 55fc34e..f7b9a2a 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -30,31 +30,6 @@ return { 'saghen/blink.cmp', }, config = function() - -- Brief aside: **What is LSP?** - -- - -- LSP is an initialism you've probably heard, but might not understand what it is. - -- - -- LSP stands for Language Server Protocol. It's a protocol that helps editors - -- and language tooling communicate in a standardized fashion. - -- - -- In general, you have a "server" which is some tool built to understand a particular - -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers - -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone - -- processes that communicate with some "client" - in this case, Neovim! - -- - -- LSP provides Neovim with features like: - -- - Go to definition - -- - Find references - -- - Autocompletion - -- - Symbol Search - -- - and more! - -- - -- Thus, Language Servers are external tools that must be installed separately from - -- Neovim. This is where `mason` and related plugins come into play. - -- - -- If you're wondering about lsp vs treesitter, you can check out the wonderfully - -- and elegantly composed help section, `:help lsp-vs-treesitter` - -- 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 @@ -62,9 +37,6 @@ return { vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), callback = function(event) - -- NOTE: Remember that Lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself. - -- -- In this case, we create a function that lets us 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) @@ -109,19 +81,6 @@ return { -- the definition of its *type*, not where it was *defined*. map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) - ---@param client vim.lsp.Client - ---@param method vim.lsp.protocol.Method - ---@param bufnr? integer some lsp support methods only in specific files - ---@return boolean - local function client_supports_method(client, method, bufnr) - if vim.fn.has 'nvim-0.11' == 1 then - return client:supports_method(method, bufnr) - else - return client.supports_method(method, { bufnr = bufnr }) - end - end - -- 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 @@ -130,7 +89,7 @@ return { local client = vim.lsp.get_client_by_id(event.data.client_id) if client - and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) + 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' }, { @@ -158,7 +117,7 @@ return { -- 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(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + 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') @@ -196,13 +155,13 @@ return { } -- 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. + -- + -- 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 - -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- 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 -- cgit v1.2.3 From 838688f2449e2e61f6d19ea11b8812ba784e0745 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 2 Jun 2025 09:27:41 -0400 Subject: add barbar for tabs --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/barbar.lua | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) 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 ea24cea..c61ca2b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,5 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, 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 c45579674c8ea5c1022e614774a979e11a367983 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 14 Jun 2025 16:58:18 -0400 Subject: update dotfiles --- nvim/.config/nvim/lazy-lock.json | 20 ++++++++++---------- nvim/.config/nvim/lua/config/keymaps.lua | 11 +++++++++++ nvim/.config/nvim/lua/plugins/lsp.lua | 27 +++++++++------------------ nvim/.config/nvim/lua/plugins/telescope.lua | 1 + 4 files changed, 31 insertions(+), 28 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index c61ca2b..3d93509 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -2,28 +2,28 @@ "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, - "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, + "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" }, + "gitsigns.nvim": { "branch": "main", "commit": "731b581428ec6c1ccb451b95190ebbc6d7006db7" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d3ada78a941ff09d21dd9b4c2ec36f0cf44a4ccb" }, + "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "75d60a8f928decd8b38897f80849768b7c540a5b" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "ecbb9b1e2223a04171388887765e7695f5a0c132" }, + "mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, - "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" }, + "nvim-dap": { "branch": "master", "commit": "40a8189b8a57664a1850b0823fdcb3ac95b9f635" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" }, - "nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" }, + "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, + "nvim-lspconfig": { "branch": "master", "commit": "7ad4a11cc5742774877c529fcfb2702f7caf75e4" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua index 617f3b9..baa81f8 100644 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -40,3 +40,14 @@ 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' }) + +local function confirm_and_delete_buffer() + local confirm = vim.fn.confirm("Delete buffer and file?", "&Y\n&N", 2) + + if confirm == 1 then + os.remove(vim.fn.expand "%") + vim.api.nvim_buf_delete(0, { force = true }) + end +end + +map('n', 'df', confirm_and_delete_buffer) diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index f7b9a2a..ced27a2 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -173,7 +173,15 @@ return { -- See `:help lspconfig-all` for a list of all the pre-configured LSPs clangd = {}, gopls = {}, - pyright = {}, + pyright = { + settings = { + python = { + analysis = { + autoImportCompletions = true, + }, + }, + }, + }, rust_analyzer = {}, -- NOTE: https://github.com/pmizio/typescript-tools.nvim may be a better -- LSP to use here at some point. @@ -216,23 +224,6 @@ return { -- 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 {}) - - -- When we're editing the monolith project, the dependencies are so old - -- we can't install them locally on an ARM mac. Therefore, we want to use - -- a pyright server *within* the docker container. - print("[DEBUG] server_name: " .. server_name) - if server_name == "pyright" then - local cwd = vim.loop.cwd() - print("[DEBUG] cwd: " .. cwd) - if cwd and cwd:match("monolith") then - print("[DEBUG] Using Dockerized Pyright setup") - vim.notify("[LSP] Using Docker for pyright in " .. cwd, vim.log.levels.INFO) - server.cmd = { - "docker", "exec", "-i", "monolith-web", "pyright-langserver", "--stdio" - } - end - end - require('lspconfig')[server_name].setup(server) end, }, diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 8ca3d26..5157aea 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -64,6 +64,7 @@ return { 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', 'sc', builtin.commands, { desc = '[S]earch [C]ommands'}) 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' }) -- cgit v1.2.3 From 3c5bbbd9843e3dc53fc2a598740ca0d3a10a8fac Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 28 Jun 2025 11:12:43 -0400 Subject: tweak linters --- nvim/.config/nvim/lazy-lock.json | 16 ++++++++-------- nvim/.config/nvim/lua/plugins/barbar.lua | 2 +- nvim/.config/nvim/lua/plugins/conform.lua | 3 ++- nvim/.config/nvim/lua/plugins/lint.lua | 3 ++- 4 files changed, 13 insertions(+), 11 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 3d93509..3fdaa00 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,32 +1,32 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, + "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "731b581428ec6c1ccb451b95190ebbc6d7006db7" }, + "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, "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": "bef29b653ba71d442816bf56286c2a686210be04" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" }, + "mini.nvim": { "branch": "main", "commit": "1b32a3f61f1f649cadc748bd4b7a32b4b4785d29" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "40a8189b8a57664a1850b0823fdcb3ac95b9f635" }, + "nvim-dap": { "branch": "master", "commit": "2edd6375692d9ac1053d50acfe415c1eb2ba92d0" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, - "nvim-lspconfig": { "branch": "master", "commit": "7ad4a11cc5742774877c529fcfb2702f7caf75e4" }, + "nvim-lspconfig": { "branch": "master", "commit": "5e0e9c00d51fcb7efef0d4c49023f9593b38661e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, diff --git a/nvim/.config/nvim/lua/plugins/barbar.lua b/nvim/.config/nvim/lua/plugins/barbar.lua index 9787b05..f7e0252 100644 --- a/nvim/.config/nvim/lua/plugins/barbar.lua +++ b/nvim/.config/nvim/lua/plugins/barbar.lua @@ -68,7 +68,7 @@ return { -- Other: -- :BarbarEnable - enables barbar (enabled by default) - -- :BarbarDisable - very bad command, should never be used + -- :BarbarDisable - disables barbar end, }, } diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 0f5af02..54d14d2 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -86,8 +86,9 @@ return { formatters_by_ft = { lua = { 'stylua' }, go = { 'goimports', 'gofmt' }, - python = { 'black' }, + python = { 'black', 'isort' }, rust = { 'rustfmt' }, + sh = { 'shfmt' }, javascript = { 'prettierd', 'prettier', stop_after_first = true }, typescript = { 'prettierd', 'prettier', stop_after_first = true }, javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index a4b6c05..1361816 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -10,7 +10,8 @@ return { lint.linters_by_ft['json'] = { 'jsonlint' } lint.linters_by_ft['terraform'] = { 'tflint' } lint.linters_by_ft['python'] = { 'ruff', 'bandit' } - lint.linters_by_ft['markdown'] = { 'markdownlint' } + lint.linters_by_ft['markdown'] = nil + lint.linters_by_ft['sh'] = { 'shellcheck' } -- Default linters, which will cause errors unless these tools are available: -- { -- cgit v1.2.3 From 7105184334a5cbbb8cb030ec699dd8fecdba481d Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 28 Jun 2025 11:22:34 -0400 Subject: fix lsp syntax error --- nvim/.config/nvim/lua/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index c184284..4ef0c2f 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -192,7 +192,7 @@ return { }, }, }, - stylua = {} + stylua = {}, tailwindcss = {}, mesonlsp = {}, } -- cgit v1.2.3 From c9f114223b6f61313b46446967f1a208977c4f20 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 28 Jun 2025 11:22:48 -0400 Subject: update lockfile --- nvim/.config/nvim/lazy-lock.json | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 652413b..a6af74e 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -6,12 +6,15 @@ "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, + "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, "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": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, "mini.nvim": { "branch": "main", "commit": "8ca3965e68edfee5f438d4063f5adf5afa255884" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, @@ -23,6 +26,7 @@ "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, + "nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, -- cgit v1.2.3 From a82ad13b00bae490bfc8468d7ecf646b020c4e9a Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 2 Jul 2025 07:03:47 -0400 Subject: Add -x to shellcheck --- nvim/.config/nvim/lua/plugins/lint.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index 66923a7..32a3f65 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -13,6 +13,7 @@ return { 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: -- { -- cgit v1.2.3 From c7d7e6a06802dcc725ac4c2c773a018bb007464e Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 3 Jul 2025 23:44:16 -0400 Subject: tweak nvim config --- nvim/.config/nvim/.gitignore | 2 ++ nvim/.config/nvim/lazy-lock.json | 11 ++++++----- nvim/.config/nvim/lua/plugins/conform.lua | 3 +++ nvim/.config/nvim/lua/plugins/copilot.lua | 8 +++++--- nvim/.config/nvim/lua/plugins/lazygit.lua | 18 ++++++++++++++++++ 5 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 nvim/.config/nvim/.gitignore create mode 100644 nvim/.config/nvim/lua/plugins/lazygit.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/.gitignore b/nvim/.config/nvim/.gitignore new file mode 100644 index 0000000..8b8b7d9 --- /dev/null +++ b/nvim/.config/nvim/.gitignore @@ -0,0 +1,2 @@ +/venv + diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index a6af74e..9db9f24 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -4,29 +4,30 @@ "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, - "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, + "conform.nvim": { "branch": "master", "commit": "f54259518695178168fbad442468e25f121230d4" }, "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, + "gitsigns.nvim": { "branch": "main", "commit": "588264bee92993df92535b6742576f5655c91b1c" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lazygit.nvim": { "branch": "main", "commit": "4839ab642962cc76bb1bf278427dc4c59be15072" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "8ca3965e68edfee5f438d4063f5adf5afa255884" }, + "mini.nvim": { "branch": "main", "commit": "48f48e4b3f317e9da34ee7a01958b4c5018e2d34" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, + "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-dap": { "branch": "master", "commit": "14fe46ae16eb272629144a93f7738f5279665a4f" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, - "nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" }, + "nvim-lspconfig": { "branch": "master", "commit": "1cb30b1bafe5a63a5c6ac20dc39f83487df38855" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 627607f..93e4fcb 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -106,6 +106,9 @@ return { black = { prepend_args = { '--line-length', '120' }, }, + shfmt = { + args = { '-i', '2' }, + }, }, }, config = function(_, opts) diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua index 4d16709..23ee23e 100644 --- a/nvim/.config/nvim/lua/plugins/copilot.lua +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -18,10 +18,12 @@ return { }, build = 'make tiktoken', -- Only on MacOS or Linux config = function() - require('CopilotChat').setup {} - vim.keymap.set('n', 'cc', function() + require('CopilotChat').setup { + model = 'gpt-4o', + } + vim.keymap.set('n', 'tc', function() vim.cmd 'CopilotChatToggle' - end, { desc = '[Copilot] Toggle Copilot Chat' }) + end, { desc = '[T]oggle [C]opilot Chat' }) end, }, } diff --git a/nvim/.config/nvim/lua/plugins/lazygit.lua b/nvim/.config/nvim/lua/plugins/lazygit.lua new file mode 100644 index 0000000..a4e50c0 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/lazygit.lua @@ -0,0 +1,18 @@ +return { + 'kdheepak/lazygit.nvim', + lazy = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + dependencies = { + -- For floating window border decoration + 'nvim-lua/plenary.nvim', + }, + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, +} -- cgit v1.2.3 From f787c39a467afa0ef2b968e7e7bdb9a32da28e0b Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 21 Jul 2025 07:17:39 -0400 Subject: up conform timeout and remove merge conflict code --- nvim/.config/nvim/lazy-lock.json | 30 +++++++++++++++--------------- nvim/.config/nvim/lua/plugins/conform.lua | 22 +--------------------- nvim/.config/nvim/lua/plugins/lsp.lua | 1 + 3 files changed, 17 insertions(+), 36 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index e5f0f12..3542cf6 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,35 +1,35 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "55f2162c36901224e22ff8424fd60ecef670b8fc" }, + "CopilotChat.nvim": { "branch": "main", "commit": "f7eb423baccbb27f5b5608fb91acee2d6bc769c7" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, - "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, + "blink.cmp": { "branch": "main", "commit": "586ee87534f5bf65f1c8dea2d1da2a57e8cddd36" }, "conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" }, - "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, + "copilot.lua": { "branch": "master", "commit": "14bf786180b2ca4578915c56989b6d676dddc6f3" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "362fe61f9f19e9bceff178792780df5cce118a7d" }, + "gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lazygit.nvim": { "branch": "main", "commit": "4839ab642962cc76bb1bf278427dc4c59be15072" }, + "lazygit.nvim": { "branch": "main", "commit": "ac4a400b256a63ae9d533b022db9b98d3358ef55" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c2465eb07db648026eee81005a659abe26e6d077" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "5fcd0dfdcf55d8a1c1a02cccc14ee5d79728a496" }, "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": "48f48e4b3f317e9da34ee7a01958b4c5018e2d34" }, + "mini.nvim": { "branch": "main", "commit": "77e20cd6ed80fdf1738c116c35da81e7d9ad997e" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "1c75a797b4017fec6491f509cf196c8c8833f26f" }, - "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, + "nvim-dap": { "branch": "master", "commit": "5dd4d50f2e6a2eaf9e57fad023d294ef371bda35" }, + "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, - "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-lint": { "branch": "master", "commit": "3c5e34c24834a67b1cb37600ab7663eefd2b0390" }, - "nvim-lspconfig": { "branch": "master", "commit": "7fac9025a967a4d0846660f751cd392fac6bb788" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, + "nvim-lint": { "branch": "master", "commit": "52e603c4b66f2fb4f268916725076e6c3ae412fd" }, + "nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, + "nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, @@ -39,6 +39,6 @@ "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" }, + "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 93e4fcb..e6c9f66 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -46,26 +46,6 @@ return { desc = 'Toggle autoformat globally', }, }, - config = function() - vim.api.nvim_create_user_command('FormatDisable', function(args) - if args.bang then - -- FormatDisable! will disable formatting just for this buffer - vim.b.disable_autoformat = true - else - vim.g.disable_autoformat = true - end - end, { - desc = 'Disable autoformat-on-save', - bang = true, - }) - - 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, opts = { notify_on_error = false, format_on_save = function(bufnr) @@ -81,7 +61,7 @@ return { end return { - timeout_ms = 500, + timeout_ms = 3000, lsp_format = 'fallback', } end, diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index 4ef0c2f..65093f6 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -195,6 +195,7 @@ return { stylua = {}, tailwindcss = {}, mesonlsp = {}, + terraformls = {}, } -- Ensure the servers and tools above are installed -- cgit v1.2.3 From 978be6568576fedbadf52a66d8b17987bd2dd073 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 21 Jul 2025 09:35:18 -0400 Subject: Add tf fmt and tf validate --- nvim/.config/nvim/lua/plugins/conform.lua | 1 + nvim/.config/nvim/lua/plugins/lint.lua | 2 +- 2 files changed, 2 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 e6c9f66..0d34e85 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -78,6 +78,7 @@ return { css = { 'prettierd', 'prettier', stop_after_first = true }, htmldjango = { 'prettierd', 'prettier', stop_after_first = true }, html = { 'prettierd', 'prettier', stop_after_first = true }, + tf = { 'terraform_fmt' }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index 32a3f65..d7d5c7f 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -8,7 +8,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 -- cgit v1.2.3 From 6f8984669b01eeb23bf1ada58c3e4bf213caf6f4 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 6 Aug 2025 07:51:29 -0400 Subject: Add back barbar --- nvim/.config/nvim/lazy-lock.json | 34 ++++++++------- nvim/.config/nvim/lua/plugins/barbar.lua | 74 ++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 16 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 80f1d34..87055c6 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,37 +1,39 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "f7eb423baccbb27f5b5608fb91acee2d6bc769c7" }, + "CopilotChat.nvim": { "branch": "main", "commit": "06e54538c24cbeb341301418dabaf598ae8e7e60" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "blink.cmp": { "branch": "main", "commit": "586ee87534f5bf65f1c8dea2d1da2a57e8cddd36" }, - "copilot.lua": { "branch": "master", "commit": "14bf786180b2ca4578915c56989b6d676dddc6f3" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "0cb5a7753d3c4b8e9cfdc9d88d9110cb8d4b1544" }, + "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" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "lazygit.nvim": { "branch": "main", "commit": "ac4a400b256a63ae9d533b022db9b98d3358ef55" }, + "lazygit.nvim": { "branch": "main", "commit": "cdd3527e251f96eb0527162b156ad839286fcd97" }, "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": "52e603c4b66f2fb4f268916725076e6c3ae412fd" }, - "nvim-lspconfig": { "branch": "master", "commit": "f47cd681d7cb6048876a2e908b6d8ba1e530d152" }, + "nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" }, + "nvim-lspconfig": { "branch": "master", "commit": "63a38440989c58e1f100373ab603fd24665bdc9a" }, "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 491c3b73068f7bc853b401166fb13bc7040bee80 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 9 Aug 2025 07:52:21 -0400 Subject: Configure spell checking for markdown --- nvim/.config/nvim/after/ftplugin/markdown.lua | 20 ++++++++++++++++++++ nvim/.config/nvim/lazy-lock.json | 5 +++-- nvim/.config/nvim/lua/config/options.lua | 2 ++ nvim/.config/nvim/spell/en.utf-8.add | 9 +++++++++ nvim/.config/nvim/spell/en.utf-8.add.spl | Bin 0 -> 151 bytes 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 nvim/.config/nvim/after/ftplugin/markdown.lua create mode 100644 nvim/.config/nvim/spell/en.utf-8.add create mode 100644 nvim/.config/nvim/spell/en.utf-8.add.spl (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..84f7c11 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -0,0 +1,20 @@ +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.conceallevel = 3 + +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/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 87055c6..8488412 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -14,7 +14,7 @@ "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lazygit.nvim": { "branch": "main", "commit": "cdd3527e251f96eb0527162b156ad839286fcd97" }, "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" }, @@ -27,7 +27,8 @@ "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": "63a38440989c58e1f100373ab603fd24665bdc9a" }, + "nvim-lspconfig": { "branch": "master", "commit": "9141be4c1332afc83bdf1b0278dbb030f75ff8e3" }, + "nvim-navic": { "branch": "master", "commit": "f887d794a0f4594882814d7780980a949200a238" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" }, 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..b30f5c9 --- /dev/null +++ b/nvim/.config/nvim/spell/en.utf-8.add @@ -0,0 +1,9 @@ +PaymentWorks +CLI +AWS +SSO +SSM +pipx +aws +config +MacOS diff --git a/nvim/.config/nvim/spell/en.utf-8.add.spl b/nvim/.config/nvim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..4613cc9 Binary files /dev/null and b/nvim/.config/nvim/spell/en.utf-8.add.spl differ -- cgit v1.2.3 From bdecca1f9cac8e0c91068a53869750bda0e93db5 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 11 Aug 2025 07:40:47 -0400 Subject: Remove black args --- nvim/.config/nvim/lua/plugins/conform.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 0d34e85..cb43b27 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -84,9 +84,6 @@ return { isort = { prepend_args = { '--profile', 'black' }, }, - black = { - prepend_args = { '--line-length', '120' }, - }, shfmt = { args = { '-i', '2' }, }, -- cgit v1.2.3 From 5c28806ae20fbff5f5ab46c742b71e6cc67bc0ce Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 11 Aug 2025 07:40:59 -0400 Subject: remove markdown conceal level and add more words to spellfile --- nvim/.config/nvim/after/ftplugin/markdown.lua | 1 - nvim/.config/nvim/spell/en.utf-8.add | 4 ++++ nvim/.config/nvim/spell/en.utf-8.add.spl | Bin 151 -> 214 bytes 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/after/ftplugin/markdown.lua b/nvim/.config/nvim/after/ftplugin/markdown.lua index 84f7c11..4f56524 100644 --- a/nvim/.config/nvim/after/ftplugin/markdown.lua +++ b/nvim/.config/nvim/after/ftplugin/markdown.lua @@ -7,7 +7,6 @@ opt_local.formatoptions:remove { 'l' } opt_local.wrap = true opt_local.linebreak = true opt_local.breakindent = true -opt_local.conceallevel = 3 opt_local.spell = true opt_local.spelllang = 'en_us' diff --git a/nvim/.config/nvim/spell/en.utf-8.add b/nvim/.config/nvim/spell/en.utf-8.add index b30f5c9..6a405b9 100644 --- a/nvim/.config/nvim/spell/en.utf-8.add +++ b/nvim/.config/nvim/spell/en.utf-8.add @@ -7,3 +7,7 @@ pipx aws config MacOS +Changelog +Versioning +Ctrl +Django diff --git a/nvim/.config/nvim/spell/en.utf-8.add.spl b/nvim/.config/nvim/spell/en.utf-8.add.spl index 4613cc9..c296281 100644 Binary files a/nvim/.config/nvim/spell/en.utf-8.add.spl and b/nvim/.config/nvim/spell/en.utf-8.add.spl differ -- cgit v1.2.3 From a9f2a20357df7959b83c0a7b0bb87ee9c9d3ef9a Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 12 Aug 2025 08:06:08 -0400 Subject: Fix typo --- nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua index 930acbd..9e640b6 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua @@ -71,7 +71,7 @@ require('blink.cmp').setup { } vim.api.nvim_create_user_command('BlinkBuild', function() - local utils = require 'eugenetirguba.utils' + local utils = require 'eugenetriguba.utils' local blink_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/blink.cmp' utils.build_with_job({ 'cargo', '+nightly', 'build', '--release' }, blink_path, 'blink.cmp') end, { desc = 'Build blink.cmp' }) @@ -81,7 +81,7 @@ vim.api.nvim_create_user_command('LuaSnipBuild', function() vim.notify 'LuaSnip build not supported on this system' return end - local utils = require 'eugenetirguba.utils' + local utils = require 'eugenetriguba.utils' local luasnip_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/LuaSnip' utils.build_with_job({ 'make', 'install_jsregexp' }, luasnip_path, 'LuaSnip') end, { desc = 'Build LuaSnip jsregexp' }) -- cgit v1.2.3 From 02670c751a46bc1daa4f52f1740dc1792bef49cc Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 14 Aug 2025 10:26:56 -0400 Subject: update config --- nvim/.config/nvim/lua/eugenetriguba/autocmds.lua | 7 +++++++ nvim/.config/nvim/lua/eugenetriguba/keymaps.lua | 12 ++++++------ nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua | 2 +- nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua | 4 ++++ nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua index 145d00a..01d6aff 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/autocmds.lua @@ -6,3 +6,10 @@ vim.api.nvim_create_autocmd('TextYankPost', { vim.hl.on_yank() end, }) + +vim.api.nvim_create_autocmd('FileType', { + callback = function() + vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, +}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua b/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua index 763d184..212c8f4 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua @@ -1,7 +1,7 @@ local map = vim.keymap.set -map("n", "sh", ":split") -map("n", "sv", ":vsplit") +map('n', 'sh', ':split') +map('n', 'sv', ':vsplit') -- Clear highlights on search when pressing in normal mode map('n', '', 'nohlsearch') @@ -23,14 +23,14 @@ map('n', '', '', { desc = 'Move focus to the lower window' }) map('n', '', '', { desc = 'Move focus to the upper window' }) -- Keybindings to cycle through open tabs easier -map('n', '', 'tabprevious', { desc = 'Open tab to the left' }) -map('n', '', 'tabnext', { desc = 'Open tab to the right' }) +map('n', '', 'bprevious', { desc = 'Open buffer to the left' }) +map('n', '', 'bnext', { desc = 'Open buffer to the right' }) local function confirm_and_delete_buffer() - local confirm = vim.fn.confirm("Delete buffer and file?", "&Y\n&N", 2) + local confirm = vim.fn.confirm('Delete buffer and file?', '&Y\n&N', 2) if confirm == 1 then - os.remove(vim.fn.expand "%") + os.remove(vim.fn.expand '%') vim.api.nvim_buf_delete(0, { force = true }) end end diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua index d177759..c11d4f9 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua @@ -35,7 +35,7 @@ vim.api.nvim_create_autocmd('VimEnter', { sh = { 'shfmt' }, cpp = { 'clang-format' }, c = { 'clang-format' }, - tf = { 'terraformfmt' }, + tf = { 'terraform_fmt' }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua index 6d3b050..d3ac276 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua @@ -36,6 +36,10 @@ vim.api.nvim_create_autocmd('VimEnter', { harpoon:list():select(4) end) + vim.keymap.set('n', '', function() + harpoon:list():clear() + end, { desc = 'Clear Harpoon list' }) + vim.keymap.set('n', 'hp', function() harpoon:list():prev() end) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua index 07c8157..3fb452c 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -10,6 +10,7 @@ vim.pack.add { }, } +require 'nvim-treesitter' require('nvim-treesitter.configs').setup { ensure_installed = 'all', auto_install = true, -- cgit v1.2.3 From 34f33ae017bc8fadd7fc674bd8894b1bc5bba3b3 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 14 Aug 2025 16:49:58 -0400 Subject: update nvim config --- nvim/.config/nvim/ftdetect/tpl.lua | 6 + nvim/.config/nvim/lazy-lock.json | 38 +++++ nvim/.config/nvim/lua/eugenetriguba/init.lua | 2 +- nvim/.config/nvim/lua/eugenetriguba/keymaps.lua | 4 - nvim/.config/nvim/lua/eugenetriguba/lazy.lua | 23 +++ .../nvim/lua/eugenetriguba/plugins/barbar.lua | 70 +++++++++ .../nvim/lua/eugenetriguba/plugins/blink.lua | 131 +++++++---------- .../nvim/lua/eugenetriguba/plugins/colorizer.lua | 6 + .../lua/eugenetriguba/plugins/colorschemes.lua | 22 +-- .../nvim/lua/eugenetriguba/plugins/conform.lua | 163 ++++++++++++--------- .../nvim/lua/eugenetriguba/plugins/copilot.lua | 57 ++++--- .../nvim/lua/eugenetriguba/plugins/fzf-lua.lua | 30 ---- .../nvim/lua/eugenetriguba/plugins/gitsigns.lua | 118 ++++++++------- .../nvim/lua/eugenetriguba/plugins/harpoon.lua | 22 +-- .../nvim/lua/eugenetriguba/plugins/indent_line.lua | 9 +- .../nvim/lua/eugenetriguba/plugins/init.lua | 22 --- .../nvim/lua/eugenetriguba/plugins/lazygit.lua | 41 ++---- .../nvim/lua/eugenetriguba/plugins/lint.lua | 95 ++++++------ .../.config/nvim/lua/eugenetriguba/plugins/lsp.lua | 152 +++++++++++++++++++ .../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/lualine.lua | 14 ++ .../nvim/lua/eugenetriguba/plugins/mini.lua | 52 +++---- .../.config/nvim/lua/eugenetriguba/plugins/oil.lua | 29 ++-- .../nvim/lua/eugenetriguba/plugins/telescope.lua | 80 ++++++++++ .../lua/eugenetriguba/plugins/tmux-navigator.lua | 20 ++- .../nvim/lua/eugenetriguba/plugins/tree-sitter.lua | 52 +++---- .../nvim/lua/eugenetriguba/plugins/which-key.lua | 15 +- nvim/.config/nvim/lua/eugenetriguba/utils.lua | 23 --- 31 files changed, 773 insertions(+), 686 deletions(-) create mode 100644 nvim/.config/nvim/ftdetect/tpl.lua create mode 100644 nvim/.config/nvim/lazy-lock.json create mode 100644 nvim/.config/nvim/lua/eugenetriguba/lazy.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/barbar.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/colorizer.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/lualine.lua create mode 100644 nvim/.config/nvim/lua/eugenetriguba/plugins/telescope.lua delete mode 100644 nvim/.config/nvim/lua/eugenetriguba/utils.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/ftdetect/tpl.lua b/nvim/.config/nvim/ftdetect/tpl.lua new file mode 100644 index 0000000..f1ec161 --- /dev/null +++ b/nvim/.config/nvim/ftdetect/tpl.lua @@ -0,0 +1,6 @@ +vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { + pattern = '*.sh.tpl', + callback = function() + vim.bo.filetype = 'sh' + end, +}) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..daf8d2d --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,38 @@ +{ + "CopilotChat.nvim": { "branch": "main", "commit": "76cc41653d63cfdb653f584624b4bf5e721f9514" }, + "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": "2cb5edb2dd6700a958a446b20bb2be04d318da9d" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "fzf-lua": { "branch": "main", "commit": "2f9e1af8cbff922543c2f259040d518517b8e294" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, + "lazygit.nvim": { "branch": "main", "commit": "3c524ebec6072568064235c407195e9f9fd0cb8a" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, + "mini.icons": { "branch": "main", "commit": "b8f6fa6f5a3fd0c56936252edcd691184e5aac0c" }, + "mini.nvim": { "branch": "main", "commit": "0e9d1f972a91acf5a0513319099ba41f7c09c30a" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lint": { "branch": "master", "commit": "7ef127aaede2a4d5ad8df8321e2eb4e567f29594" }, + "nvim-lspconfig": { "branch": "master", "commit": "45ff1914044de7dbd4cd85053dc09f47312a2f4d" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "dca8726fea2c14e1ce6adbaa76a04816fbfaff61" }, + "nvim-web-devicons": { "branch": "master", "commit": "c2599a81ecabaae07c49ff9b45dcd032a8d90f1a" }, + "oil.nvim": { "branch": "master", "commit": "bbad9a76b2617ce1221d49619e4e4b659b3c61fc" }, + "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" }, + "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "vim-tmux-navigator": { "branch": "master", "commit": "c45243dc1f32ac6bcf6068e5300f3b2b237e576a" }, + "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/init.lua b/nvim/.config/nvim/lua/eugenetriguba/init.lua index d372afd..ac79aec 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/init.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/init.lua @@ -1,5 +1,5 @@ require 'eugenetriguba.global' +require 'eugenetriguba.lazy' 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 index 212c8f4..e952e0f 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/keymaps.lua @@ -22,10 +22,6 @@ 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' }) --- Keybindings to cycle through open tabs easier -map('n', '', 'bprevious', { desc = 'Open buffer to the left' }) -map('n', '', 'bnext', { desc = 'Open buffer to the right' }) - local function confirm_and_delete_buffer() local confirm = vim.fn.confirm('Delete buffer and file?', '&Y\n&N', 2) diff --git a/nvim/.config/nvim/lua/eugenetriguba/lazy.lua b/nvim/.config/nvim/lua/eugenetriguba/lazy.lua new file mode 100644 index 0000000..ff5b33d --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/lazy.lua @@ -0,0 +1,23 @@ +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) + +require('lazy').setup { + spec = { + { import = 'eugenetriguba.plugins' }, + }, + install = { colorscheme = { 'tokyonight' } }, + checker = { enabled = true, notify = false }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/barbar.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/barbar.lua new file mode 100644 index 0000000..7056c97 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/barbar.lua @@ -0,0 +1,70 @@ +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) + end, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua index 9e640b6..a4fd085 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/blink.lua @@ -1,87 +1,62 @@ -vim.pack.add { +return { { - 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' } }, + 'https://github.com/saghen/blink.cmp', + build = 'cargo +nightly build --release', + event = 'VimEnter', + version = '*', + dependencies = { + { + 'https://github.com/L3MON4D3/LuaSnip', + version = '2.*', + build = (function() + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + dependencies = { + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, + }, + opts = {}, + }, + 'https://github.com/folke/lazydev.nvim', + 'https://github.com/giuxtaposition/blink-cmp-copilot', + }, + --- @module 'blink.cmp' + --- @type blink.cmp.Config + opts = { + keymap = { + preset = 'default', }, - } - 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', - }, + appearance = { + nerd_font_variant = 'mono', + }, - completion = { - documentation = { - auto_show = true, - auto_show_delay_ms = 500, - }, - }, + 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, + 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' }, + fuzzy = { implementation = 'prefer_rust_with_warning' }, + signature = { enabled = true }, }, }, - snippets = { preset = 'luasnip' }, - fuzzy = { implementation = 'prefer_rust_with_warning' }, - signature = { enabled = true }, } - -vim.api.nvim_create_user_command('BlinkBuild', function() - local utils = require 'eugenetriguba.utils' - local blink_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/blink.cmp' - utils.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 utils = require 'eugenetriguba.utils' - local luasnip_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/LuaSnip' - utils.build_with_job({ 'make', 'install_jsregexp' }, luasnip_path, 'LuaSnip') -end, { desc = 'Build LuaSnip jsregexp' }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/colorizer.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorizer.lua new file mode 100644 index 0000000..199c59e --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorizer.lua @@ -0,0 +1,6 @@ +return { + { + 'norcalli/nvim-colorizer.lua', + opts = {}, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua index 63e3cf8..8e4a07a 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/colorschemes.lua @@ -1,14 +1,14 @@ -vim.pack.add { +return { { - name = 'tokyonight', - src = 'https://github.com/folke/tokyonight.nvim', + 'folke/tokyonight.nvim', + priority = 1000, + config = function() + require('tokyonight').setup { + styles = { + comments = { italic = false }, + }, + } + vim.cmd.colorscheme 'tokyonight' + end, }, } - - -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 index c11d4f9..f2a62be 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/conform.lua @@ -1,95 +1,114 @@ -vim.pack.add({ +return { { - 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, + 'https://github.com/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 = { sql = true, c = true, cpp = true } + if disable_filetypes[vim.bo[bufnr].filetype] then + return nil + end + return { - timeout_ms = 500, + timeout_ms = 3000, lsp_format = 'fallback', } end, formatters_by_ft = { lua = { 'stylua' }, go = { 'goimports', 'gofmt' }, - python = { 'isort', 'black' }, + python = { 'black', 'isort' }, 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' }, + 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 }, tf = { 'terraform_fmt' }, }, formatters = { isort = { prepend_args = { '--profile', 'black' }, }, + shfmt = { + args = { '-i', '2' }, + }, }, - } - 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' }) + }, + config = function(_, opts) + require('conform').setup(opts) --- 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, -}) + 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 + }) --- :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', -}) + 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/eugenetriguba/plugins/copilot.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/copilot.lua index c6e3a03..fbd1ecb 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/copilot.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/copilot.lua @@ -1,32 +1,29 @@ -vim.pack.add({ - { name = 'copilot.lua', src = 'https://github.com/zbirenbaum/copilot.lua' }, - { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' }, +return { { - name = 'CopilotChat.nvim', - src = 'https://github.com/CopilotC-Nvim/CopilotChat.nvim', + 'https://github.com/zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + config = function() + require('copilot').setup { + suggestion = { enabled = false }, + panel = { enabled = false }, + } + end, }, -}, { load = false }) - -vim.api.nvim_create_autocmd('VimEnter', { - once = true, - callback = function() - require('copilot').setup { - suggestion = { enabled = false }, - panel = { enabled = false }, - } - - require('CopilotChat').setup { - model = 'claude-3.5-sonnet', - } - - vim.keymap.set('n', 'tc', function() - vim.cmd 'CopilotChatToggle' - end, { desc = '[T]oggle [C]opilot Chat' }) - end, -}) - -vim.api.nvim_create_user_command('CopilotChatBuild', function() - local utils = require 'eugenetriguba.utils' - local copilot_path = vim.fn.stdpath 'data' .. '/site/pack/core/opt/CopilotChat.nvim' - utils.build_with_job({ 'make', 'tiktoken' }, copilot_path, 'CopilotChat.nvim') -end, { desc = 'Build CopilotChat' }) + { + 'https://github.com/CopilotC-Nvim/CopilotChat.nvim', + dependencies = { + { 'https://github.com/zbirenbaum/copilot.lua' }, + { 'https://github.com/nvim-lua/plenary.nvim', branch = 'master' }, + }, + build = 'make tiktoken', + config = function() + require('CopilotChat').setup { + model = 'claude-3.5-sonnet', + vim.keymap.set('n', 'tc', function() + vim.cmd 'CopilotChatToggle' + end, { desc = '[T]oggle [C]opilot Chat' }), + } + end, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua deleted file mode 100644 index 0b7029d..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/fzf-lua.lua +++ /dev/null @@ -1,30 +0,0 @@ -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 {} - 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 index a3fd83a..341b947 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/gitsigns.lua @@ -1,66 +1,64 @@ -vim.pack.add { +return { { - name = 'gitsigns', - src = 'https://github.com/lewis6991/gitsigns.nvim', - }, -} + 'https://github.com/lewis6991/gitsigns.nvim', + opts = { + signs = { + add = { text = '+' }, + change = { text = '~' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + }, + on_attach = function(bufnr) + local gitsigns = require 'gitsigns' -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 - 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' }) - -- 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' }) - 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, + -- 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/eugenetriguba/plugins/harpoon.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua index d3ac276..bb2dad2 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/harpoon.lua @@ -1,18 +1,8 @@ -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() +return { + 'https://github.com/ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'https://github.com/nvim-lua/plenary.nvim' }, + config = function() local harpoon = require 'harpoon' harpoon:setup() @@ -47,4 +37,4 @@ vim.api.nvim_create_autocmd('VimEnter', { 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 index f6c0e8f..c098a80 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/indent_line.lua @@ -1,8 +1,7 @@ -vim.pack.add { +return { { - name = 'indent-blankline', - src = 'https://github.com/lukas-reineke/indent-blankline.nvim', + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + opts = {}, }, } - -require('ibl').setup() diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua deleted file mode 100644 index 40e52f0..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/init.lua +++ /dev/null @@ -1,22 +0,0 @@ -local plugins = { - 'tree-sitter', - 'colorschemes', - 'which-key', - 'indent_line', - 'conform', - 'fzf-lua', - 'gitsigns', - 'harpoon', - 'lint', - 'mini', - 'oil', - 'lsp', - 'blink', - 'tmux-navigator', - 'copilot', - 'lazygit', -} - -for _, plugin in ipairs(plugins) do - pcall(require, 'eugenetriguba.plugins.' .. plugin) -end diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lazygit.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lazygit.lua index e998657..17cb1c2 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lazygit.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lazygit.lua @@ -1,26 +1,17 @@ -vim.pack.add { - { name = 'lazygit.nvim', src = 'https://github.com/kdheepak/lazygit.nvim' }, - { name = 'plenary.nvim', src = 'https://github.com/nvim-lua/plenary.nvim' }, +return { + 'https://github.com/kdheepak/lazygit.nvim', + lazy = true, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + dependencies = { + 'https://github.com/nvim-lua/plenary.nvim', + }, + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, } - -vim.api.nvim_create_user_command('LazyGit', function() - require('lazygit').lazygit() -end, {}) - -vim.api.nvim_create_user_command('LazyGitConfig', function() - require('lazygit').lazygit_config() -end, {}) - -vim.api.nvim_create_user_command('LazyGitCurrentFile', function() - require('lazygit').lazygit_current_file() -end, {}) - -vim.api.nvim_create_user_command('LazyGitFilter', function() - require('lazygit').lazygit_filter() -end, {}) - -vim.api.nvim_create_user_command('LazyGitFilterCurrentFile', function() - require('lazygit').lazygit_filter_current_file() -end, {}) - -vim.keymap.set('n', 'lg', 'LazyGit', { desc = 'LazyGit' }) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua index 72f9a51..eb152ec 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lint.lua @@ -1,52 +1,49 @@ -vim.pack.add({ +return { { - 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 + 'https://github.com/mfussenegger/nvim-lint', + event = { 'BufReadPre', 'BufNewFile' }, + config = 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 = 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, -}) + 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.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp.lua new file mode 100644 index 0000000..55794ff --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp.lua @@ -0,0 +1,152 @@ +return { + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + }, + }, + }, + { + 'neovim/nvim-lspconfig', + dependencies = { + { 'williamboman/mason.nvim', opts = {} }, + 'williamboman/mason-lspconfig.nvim', + 'WhoIsSethDaniel/mason-tool-installer.nvim', + { 'j-hui/fidget.nvim', opts = {} }, + 'saghen/blink.cmp', + }, + config = function() + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), + callback = function(event) + 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('telescope.builtin').lsp_references, '[G]oto [R]eferences') + map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') + map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') + 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 + + 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, + }) + + 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, + }, + } + + local capabilities = require('blink.cmp').get_lsp_capabilities() + local servers = { + clangd = {}, + gopls = {}, + pyright = { + settings = { + python = { + analysis = { + autoImportCompletions = true, + }, + }, + }, + }, + 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', + }, + }, + }, + }, + stylua = {}, + tailwindcss = {}, + mesonlsp = {}, + terraformls = {}, + } + + local ensure_installed = vim.tbl_keys(servers or {}) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + require('mason-lspconfig').setup { + ensure_installed = {}, + 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, + }, + } + end, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua deleted file mode 100644 index 4ea0673..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/diagnostics.lua +++ /dev/null @@ -1,27 +0,0 @@ --- 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 deleted file mode 100644 index 065f34c..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 2ce6198..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/lspconfig.lua +++ /dev/null @@ -1,71 +0,0 @@ -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 deleted file mode 100644 index 2c2bde1..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/lsp/mason.lua +++ /dev/null @@ -1,62 +0,0 @@ -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/lualine.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/lualine.lua new file mode 100644 index 0000000..d7b5c70 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/lualine.lua @@ -0,0 +1,14 @@ +return { + { + 'https://github.com/nvim-lualine/lualine.nvim', + event = 'VeryLazy', + dependencies = { 'https://github.com/nvim-tree/nvim-web-devicons' }, + opts = { + options = { + theme = 'tokyonight', + component_separators = { left = '|', right = '|' }, + section_separators = { left = '', right = '' }, + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua index d00b8de..af67bcc 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/mini.lua @@ -1,34 +1,24 @@ -vim.pack.add { +return { { - name = 'mini', - src = 'https://github.com/echasnovski/mini.nvim', + 'https://github.com/echasnovski/mini.nvim', + config = function() + require('mini.pairs').setup() + require('mini.git').setup() + require('mini.tabline').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() + end, }, } - -require('mini.pairs').setup() -require('mini.git').setup() -require('mini.tabline').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 index e7d39c6..11c4981 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/oil.lua @@ -1,18 +1,13 @@ -vim.pack.add { - { - name = 'oil', - src = 'https://github.com/stevearc/oil.nvim', - }, - { - name = 'mini.icons', - src = 'https://github.com/echasnovski/mini.icons', - }, +return { + 'https://github.com/stevearc/oil.nvim', + ---@module 'oil' + ---@type oil.SetupOpts + opts = {}, + dependencies = { { 'https://github.com/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, } - -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/telescope.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/telescope.lua new file mode 100644 index 0000000..8072b95 --- /dev/null +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/telescope.lua @@ -0,0 +1,80 @@ +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() + 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(), + }, + }, + } + + pcall(require('telescope').load_extension, 'fzf') + pcall(require('telescope').load_extension, 'ui-select') + + 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', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) + 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' }) + + vim.keymap.set('n', '/', function() + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) + end, { desc = '[/] Fuzzily search in current buffer' }) + + 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' }) + + 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/eugenetriguba/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua index 2ec0035..a92a2f7 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tmux-navigator.lua @@ -1,6 +1,18 @@ -vim.pack.add { - { - name = 'vim-tmux-navigator', - src = 'https://github.com/christoomey/vim-tmux-navigator', +return { + 'https://github.com/christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, }, } diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua index 3fb452c..c89d962 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/tree-sitter.lua @@ -1,40 +1,24 @@ -vim.pack.add { +return { { - name = 'nvim-treesitter', - src = 'https://github.com/nvim-treesitter/nvim-treesitter', + 'https://github.com/nvim-treesitter/nvim-treesitter', version = 'main', + main = 'nvim-treesitter.configs', + build = ':TSUpdate', + opts = { + ensure_installed = 'all', + auto_install = true, + 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 }, + }, }, { - name = 'nvim-treesitter-context', - src = 'https://github.com/nvim-treesitter/nvim-treesitter-context', + 'https://github.com/nvim-treesitter/nvim-treesitter-context', }, } - -require '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 }, -} - -local nts = require 'nvim-treesitter' -vim.api.nvim_create_autocmd('PackChanged', { - 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, -}) diff --git a/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua b/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua index 47c789d..28c73d7 100644 --- a/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua +++ b/nvim/.config/nvim/lua/eugenetriguba/plugins/which-key.lua @@ -1,13 +1,6 @@ -vim.pack.add({ +return { { - name = 'which-key', - src = 'https://github.com/folke/which-key.nvim', + 'https://github.com/folke/which-key.nvim', + event = 'VimEnter', }, -}, { load = false }) - -vim.api.nvim_create_autocmd('VimEnter', { - once = true, - callback = function() - require('which-key').setup {} - end, -}) +} diff --git a/nvim/.config/nvim/lua/eugenetriguba/utils.lua b/nvim/.config/nvim/lua/eugenetriguba/utils.lua deleted file mode 100644 index de95803..0000000 --- a/nvim/.config/nvim/lua/eugenetriguba/utils.lua +++ /dev/null @@ -1,23 +0,0 @@ -local M = {} - -M.build_with_job = function(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 - -return M -- cgit v1.2.3