From 84a66939acf04785a23798b02e4891b33ca5f52d Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 27 May 2025 20:47:23 -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 4bab538344e2cb7d82f6c729dc4bde49c5dd3c78 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Tue, 27 May 2025 21:16:24 -0400 Subject: update neovim configuration --- nvim/.config/nvim/lazy-lock.json | 7 +- nvim/.config/nvim/lua/config/autocmds.lua | 2 +- nvim/.config/nvim/lua/plugins/blink.lua | 3 +- nvim/.config/nvim/lua/plugins/conform.lua | 94 +++++++++++++++++++++---- nvim/.config/nvim/lua/plugins/debug.lua | 24 ++----- nvim/.config/nvim/lua/plugins/indent_line.lua | 4 +- nvim/.config/nvim/lua/plugins/lint.lua | 28 ++++---- nvim/.config/nvim/lua/plugins/lsp.lua | 3 +- nvim/.config/nvim/lua/plugins/mini.lua | 4 +- nvim/.config/nvim/lua/plugins/telescope.lua | 14 ++-- nvim/.config/nvim/lua/plugins/todo-comments.lua | 3 +- 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 | 4 +- nvim/.config/nvim/lua/plugins/which-key.lua | 3 +- 15 files changed, 127 insertions(+), 78 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index d465408..ea24cea 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -8,20 +8,21 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "87888865fa1ce1928a25b9abbea8c8f7839bf522" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "d3ada78a941ff09d21dd9b4c2ec36f0cf44a4ccb" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "75d60a8f928decd8b38897f80849768b7c540a5b" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "d90adc96b68b310cf17d8ebcc8e2e4626c6bb8cc" }, + "mini.nvim": { "branch": "main", "commit": "ecbb9b1e2223a04171388887765e7695f5a0c132" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "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": "d45702594afc661a9dfa95e96acf18c56006d4d9" }, + "nvim-lspconfig": { "branch": "master", "commit": "b8e7957bde4cbb3cb25a13a62548f7c273b026e9" }, "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/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/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..8c69f30 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -1,8 +1,11 @@ +-- Conform adds code autoformatting funcionality. + return { { 'stevearc/conform.nvim', event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, + lazy = false, keys = { { 'f', @@ -12,30 +15,95 @@ 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', + }, }, 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' }, + 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 = { + prepend_args = { '--profile', 'black' }, + }, }, }, + config = function(_, opts) + require('conform').setup(opts) + + vim.api.nvim_create_user_command('FormatDisable', function(args) + if args.bang then + -- :FormatDisable! disables autoformat for this buffer only + vim.b.disable_autoformat = true + else + -- :FormatDisable disables autoformat globally + vim.g.disable_autoformat = true + end + end, { + desc = 'Disable autoformat-on-save', + bang = true, -- allows the ! variant + }) + + vim.api.nvim_create_user_command('FormatEnable', function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false + end, { + desc = 'Re-enable autoformat-on-save', + }) + end, }, } diff --git a/nvim/.config/nvim/lua/plugins/debug.lua b/nvim/.config/nvim/lua/plugins/debug.lua index 753cb0c..239410f 100644 --- a/nvim/.config/nvim/lua/plugins/debug.lua +++ b/nvim/.config/nvim/lua/plugins/debug.lua @@ -1,31 +1,22 @@ -- 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', - -- 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 +77,18 @@ 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 +129,6 @@ 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..c72efc2 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -1,25 +1,21 @@ +-- Linting + 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 +29,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..e6e77f9 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -1,5 +1,6 @@ +-- 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..70f72d0 100644 --- a/nvim/.config/nvim/lua/plugins/todo-comments.lua +++ b/nvim/.config/nvim/lua/plugins/todo-comments.lua @@ -1,5 +1,6 @@ +-- 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..d9a0887 100644 --- a/nvim/.config/nvim/lua/plugins/vim-sleuth.lua +++ b/nvim/.config/nvim/lua/plugins/vim-sleuth.lua @@ -1,4 +1,4 @@ +-- 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 8f4c022f37992f990754b2b2ff87b50aacb761d4 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 29 May 2025 22:01:08 -0400 Subject: add barbar and tweak conform/lsp --- nvim/.config/nvim/lazy-lock.json | 2 + nvim/.config/nvim/lua/plugins/barbar.lua | 74 +++++++++++++++++++++++++++++++ nvim/.config/nvim/lua/plugins/conform.lua | 2 + nvim/.config/nvim/lua/plugins/lsp.lua | 63 +++++--------------------- 4 files changed, 88 insertions(+), 53 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 ea24cea..9dcafb4 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" }, @@ -26,6 +27,7 @@ "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, "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 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, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 8c69f30..169a0cd 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -75,6 +75,8 @@ return { 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 }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index e6e77f9..b5a68c3 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -31,31 +31,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 @@ -63,11 +38,8 @@ 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. + -- 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 }) @@ -110,29 +82,13 @@ 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 -- -- 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(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) - then + 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, @@ -159,7 +115,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') @@ -197,13 +153,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 @@ -229,6 +185,7 @@ return { }, }, }, + tailwindcss = {}, } -- Ensure the servers and tools above are installed -- cgit v1.2.3 From 5792bb0aa065fba31f41930ddd04657eae58325c Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 7 Jun 2025 16:04:58 -0400 Subject: turn off md lint and use livegrep with history --- nvim/.config/nvim/lazy-lock.json | 18 +++++++++--------- nvim/.config/nvim/lua/plugins/lint.lua | 2 +- nvim/.config/nvim/lua/plugins/lsp.lua | 1 + nvim/.config/nvim/lua/plugins/telescope.lua | 9 ++++++++- 4 files changed, 19 insertions(+), 11 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 9dcafb4..de760c3 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -2,34 +2,34 @@ "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": "0e93e0d12d2f7ebdea9e3e444dfaff0050cefbe6" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" }, + "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, "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" }, + "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": "35e1767f4cd7dde51256eabae7349a5283a43cba" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" }, + "nvim-dap": { "branch": "master", "commit": "ea82027c3447dc1a022be9a9884de276c05cd33a" }, "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": "cc26ae6a620298bb3f33b0e0681f99a10ae57781" }, + "nvim-lspconfig": { "branch": "master", "commit": "036885e8e5456d3907626b634693234f628afef6" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, - "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, + "telescope-livegrep-history.nvim": { "branch": "main", "commit": "f714efc5a227955409b9b794df90d39a38b8d324" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index c72efc2..3b39c05 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -13,7 +13,7 @@ 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 -- Default linters, which will cause errors unless these tools are available: -- { diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index b5a68c3..f3c51ad 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -186,6 +186,7 @@ return { }, }, tailwindcss = {}, + mesonlsp = {}, } -- Ensure the servers and tools above are installed diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 8ca3d26..0f8ad7f 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -15,6 +15,7 @@ return { }, { 'nvim-telescope/telescope-ui-select.nvim' }, { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + { 'happy663/telescope-livegrep-history.nvim' }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -58,6 +59,7 @@ return { -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') + pcall(require('telescope').load_extension, 'livegrep_history') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -66,7 +68,12 @@ return { vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set( + 'n', + 'sg', + require('telescope').extensions.livegrep_history.live_grep_with_history, + { 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)' }) -- cgit v1.2.3 From 841b8e08579cc3bbd186f775ea2a06670908a4c1 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 15 Jun 2025 13:54:11 -0400 Subject: add obsidian plugin and tweak bat shell settings --- nvim/.config/nvim/lazy-lock.json | 5 +++-- nvim/.config/nvim/lua/plugins/obsidian.lua | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 nvim/.config/nvim/lua/plugins/obsidian.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index de760c3..0245e0c 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -8,7 +8,7 @@ "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" }, + "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": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, @@ -23,10 +23,11 @@ "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "cc26ae6a620298bb3f33b0e0681f99a10ae57781" }, - "nvim-lspconfig": { "branch": "master", "commit": "036885e8e5456d3907626b634693234f628afef6" }, + "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-livegrep-history.nvim": { "branch": "main", "commit": "f714efc5a227955409b9b794df90d39a38b8d324" }, diff --git a/nvim/.config/nvim/lua/plugins/obsidian.lua b/nvim/.config/nvim/lua/plugins/obsidian.lua new file mode 100644 index 0000000..a29e9f8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/obsidian.lua @@ -0,0 +1,20 @@ +return { + 'epwalsh/obsidian.nvim', + version = '*', + lazy = true, + event = { + 'BufReadPre ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', + 'BufNewFile ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', + }, + dependencies = { + 'nvim-lua/plenary.nvim', + }, + opts = { + workspaces = { + { + name = 'personal', + path = '~/Documents/Notes', + }, + }, + }, +} -- cgit v1.2.3 From 43ee67b74b1661e6ed92e750643e80f51c6dfaa4 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Wed, 18 Jun 2025 19:12:20 -0400 Subject: Update deps and set python3 host prog in neovim --- nvim/.config/nvim/lazy-lock.json | 20 ++++++++++---------- nvim/.config/nvim/lua/config/global.lua | 4 ++++ 2 files changed, 14 insertions(+), 10 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 0245e0c..5bf7009 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,29 +1,29 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" }, - "conform.nvim": { "branch": "master", "commit": "0e93e0d12d2f7ebdea9e3e444dfaff0050cefbe6" }, + "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, + "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, + "gitsigns.nvim": { "branch": "main", "commit": "88205953bd748322b49b26e1dfb0389932520dc9" }, "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": "be159e939543777bbfe9e1fe5389984c4570afce" }, "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": "35e1767f4cd7dde51256eabae7349a5283a43cba" }, + "mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, - "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, - "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "ea82027c3447dc1a022be9a9884de276c05cd33a" }, + "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": "cc26ae6a620298bb3f33b0e0681f99a10ae57781" }, - "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" }, + "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, + "nvim-lspconfig": { "branch": "master", "commit": "314b35335cc84bc2a085c84c69da955ba22da163" }, "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/global.lua b/nvim/.config/nvim/lua/config/global.lua index 8769e85..f5462f9 100644 --- a/nvim/.config/nvim/lua/config/global.lua +++ b/nvim/.config/nvim/lua/config/global.lua @@ -9,3 +9,7 @@ vim.g.have_nerd_font = true -- Disable netrw vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 + +-- Set Python 3 to a virtual environment with `pynvim` installed +-- to support python plugins. +vim.g.python3_host_prog = vim.fn.expand '~/.config/nvim/venv/bin/python' -- cgit v1.2.3 From 224fb93bb7a5c78b1ae5969dbe075423a49d8991 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 27 Jun 2025 22:01:27 -0400 Subject: Add zig to dap, refactor debug config, and add build to blink --- nvim/.config/nvim/lua/plugins/blink.lua | 3 +- nvim/.config/nvim/lua/plugins/debug.lua | 335 +++++++++++++++++++++----------- 2 files changed, 222 insertions(+), 116 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua index d83ee7f..9df552a 100644 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -1,8 +1,9 @@ return { { -- Autocompletion 'saghen/blink.cmp', + build = 'cargo +nightly build --release', event = 'VimEnter', - version = '1.*', + version = '*', dependencies = { -- Snippet Engine { diff --git a/nvim/.config/nvim/lua/plugins/debug.lua b/nvim/.config/nvim/lua/plugins/debug.lua index 239410f..668323e 100644 --- a/nvim/.config/nvim/lua/plugins/debug.lua +++ b/nvim/.config/nvim/lua/plugins/debug.lua @@ -1,134 +1,239 @@ -- debug.lua -- --- Shows how to use the DAP plugin to debug your code. +-- Configures the DAP plugin to debug code. -return { - 'mfussenegger/nvim-dap', - dependencies = { - -- Creates a beautiful debugger UI - 'rcarriga/nvim-dap-ui', - -- Required dependency for nvim-dap-ui - 'nvim-neotest/nvim-nio', - -- Installs the debug adapters - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - -- Debugger adapters - 'leoluz/nvim-dap-go', - 'mfussenegger/nvim-dap-python', - }, - keys = { - { - '', - function() - require('dap').continue() - end, - desc = 'Debug: Start/Continue', +---@class DapConfig +---@field name string Configuration name +---@field type string Debug adapter type +---@field request string Launch type ('launch' or 'attach') +---@field program function|string Path to executable or function returning path +---@field cwd string Working directory +---@field stopOnEntry boolean Whether to stop at entry point +---@field args table Command line arguments +---@field runInTerminal boolean Whether to run in terminal + +---@class DapAdapter +---@field type string Adapter type ('server', 'executable', etc.) +---@field port string Port configuration +---@field executable table Executable configuration with command and args + +-- Go debugging adapter setup +-- Configures delve debugger for Go with platform-specific settings +---@return nil +local function setup_go_adapter() + require('dap-go').setup { + delve = { + -- On Windows delve must be run attached or it crashes + detached = vim.fn.has 'win32' == 0, }, - { - '', - function() - require('dap').step_into() - end, - desc = 'Debug: Step Into', + } +end + +-- Python debugging adapter setup +-- Configures Python debugger using python3 interpreter +---@return nil +local function setup_python_adapter() + require('dap-python').setup 'python3' +end + +-- CodeLLDB adapter setup +-- Configures LLDB-based debugger for native languages (C, C++, Rust, Zig) +---@param dap table # DAP module instance +---@return nil +local function setup_codelldb_adapter(dap) + ---@type DapAdapter + dap.adapters.codelldb = { + type = 'server', + port = '${port}', + executable = { + command = vim.fn.exepath 'codelldb', + args = { '--port', '${port}' }, }, + } +end + +-- Build and find the newly-built Zig executable by running +-- 'zig build' and attempting to locate the resulting executable. +-- If the executable is unable to be automatically found, the user +-- will be prompted to give the path to the executable. +-- +---@return string|nil # Path to executable or nil if build the failed +local function build_and_find_zig_executable() + local build_result = vim.fn.system 'zig build' + if vim.v.shell_error ~= 0 then + vim.notify('Build failed: ' .. build_result, vim.log.levels.ERROR) + return nil + end + + local exe_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':t') + local possible_paths = { 'zig-out/bin/' .. exe_name } + + for _, path in ipairs(possible_paths) do + local full_path = vim.fn.getcwd() .. '/' .. path + if vim.fn.executable(full_path) == 1 then + return full_path + end + end + + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file') +end + +-- Build and find the Zig test executable by running +-- 'zig build test' and prompting the user for the test +-- executable location. +-- +---@return string # Path to test executable +local function build_and_find_zig_test() + vim.fn.system 'zig build test' + return vim.fn.input('Path to test executable: ', vim.fn.getcwd() .. '/zig-cache/o/', 'file') +end + +-- Zig debugging configuration +-- Sets up debugging configurations for Zig programs and tests +---@param dap table # DAP module instance +---@return nil +local function setup_zig_configuration(dap) + ---@type DapConfig[] + dap.configurations.zig = { { - '', - function() - require('dap').step_over() - end, - desc = 'Debug: Step Over', + name = 'Build and Launch Zig Program', + type = 'codelldb', + request = 'launch', + program = build_and_find_zig_executable, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, }, { - '', - function() - require('dap').step_out() - end, - desc = 'Debug: Step Out', + name = 'Launch Zig Test', + type = 'codelldb', + request = 'launch', + program = build_and_find_zig_test, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, }, - { - 'b', + } +end + +-- Language adapters and configurations +-- Sets up debugging support for all supported languages +---@param dap table # DAP module instance +---@return nil +local function setup_language_adapters(dap) + setup_go_adapter() + setup_python_adapter() + setup_codelldb_adapter(dap) + setup_zig_configuration(dap) +end + +-- Key mappings setup +-- Configures function keys and leader key combinations for debugging actions +---@param dap table # DAP module instance +---@param dapui table # DAP UI module instance +---@return nil +local function setup_keymaps(dap, dapui) + ---@type table + local keymaps = { + [''] = { dap.continue, 'Debug: Start/Continue' }, + [''] = { dap.step_into, 'Debug: Step Into' }, + [''] = { dap.step_over, 'Debug: Step Over' }, + [''] = { dap.step_out, 'Debug: Step Out' }, + [''] = { dapui.toggle, 'Debug: See last session result' }, + ['tb'] = { dap.toggle_breakpoint, 'Debug: Toggle Breakpoint' }, + ['B'] = { function() - require('dap').toggle_breakpoint() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, - desc = 'Debug: Toggle Breakpoint', + 'Debug: Set Breakpoint', }, - { - 'B', - function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', + } + + for key, config in pairs(keymaps) do + vim.keymap.set('n', key, config[1], { desc = config[2] }) + end +end + +-- Event listeners setup +-- Configures automatic UI opening/closing based on debug session events +---@param dap table # DAP module instance +---@param dapui table # DAP UI module instance +---@return nil +local function setup_dap_listeners(dap, dapui) + local dapui_config = 'dapui_config' + dap.listeners.after.event_initialized[dapui_config] = dapui.open + dap.listeners.before.event_terminated[dapui_config] = dapui.close + dap.listeners.before.event_exited[dapui_config] = dapui.close +end + +-- DAP UI configuration +-- Sets up the debugging user interface with custom icons and controls +---@param dapui table # DAP UI module instance +---@return nil +local function setup_dapui_config(dapui) + dapui.setup { + icons = { + expanded = '▾', + collapsed = '▸', + current_frame = '*', }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { - '', - function() - require('dapui').toggle() - end, - desc = 'Debug: See last session result.', + controls = { + icons = { + pause = '⏸', + play = '▶', + step_into = '⏎', + step_over = '⏭', + step_out = '⏮', + step_back = 'b', + run_last = '▶▶', + terminate = '⏹', + disconnect = '⏏', + }, }, - }, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' + } +end - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, +-- Mason DAP configuration +-- Automatically installs and configures debug adapters through Mason +---@return nil +local function setup_mason_dap() + require('mason-nvim-dap').setup { + automatic_installation = true, + handlers = {}, + ensure_installed = { 'delve', 'python', 'codelldb' }, + } +end - -- see mason-nvim-dap README for more information - handlers = {}, +-- Main configuration orchestrator +-- Sets up all debugging components in the correct order +---@return nil +local function setup_dap() + local dap = require 'dap' + local dapui = require 'dapui' - ensure_installed = { - 'delve', - 'python', - }, - } - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } - -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, - } - require('dap-python').setup 'python3' + setup_mason_dap() + setup_dapui_config(dapui) + setup_dap_listeners(dap, dapui) + setup_language_adapters(dap) + setup_keymaps(dap, dapui) +end + +-- Plugin specification +-- Configures nvim-dap with all necessary dependencies for debugging +---@return table # Plugin specification for lazy.nvim +return { + 'mfussenegger/nvim-dap', + dependencies = { + 'rcarriga/nvim-dap-ui', -- Beautiful debugger UI + 'nvim-neotest/nvim-nio', -- Required dependency for nvim-dap-ui + 'williamboman/mason.nvim', -- Package manager for debug adapters + 'jay-babu/mason-nvim-dap.nvim', -- Mason integration for DAP + 'leoluz/nvim-dap-go', -- Go debugging support + 'mfussenegger/nvim-dap-python', -- Python debugging support + }, + config = function() + setup_dap() end, } -- cgit v1.2.3 From 0df7e1836e22f86a20029e28dbd3cae0a2d5f98b Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 27 Jun 2025 23:39:57 -0400 Subject: Remove live grep w/ history, update deps, tweak go settings --- nvim/.config/nvim/lazy-lock.json | 16 ++++++++-------- nvim/.config/nvim/lua/config/filetypes.lua | 8 ++++++++ nvim/.config/nvim/lua/plugins/telescope.lua | 9 +-------- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 5bf7009..328723c 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -3,34 +3,34 @@ "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, "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": "88205953bd748322b49b26e1dfb0389932520dc9" }, + "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": "be159e939543777bbfe9e1fe5389984c4570afce" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "3f5d06a6f710966cb93baaadc4897eeb6d6210e5" }, + "mini.nvim": { "branch": "main", "commit": "145476d74aaa3236db9dc6705d0fa3eb0f4f8352" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "2edd6375692d9ac1053d50acfe415c1eb2ba92d0" }, + "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": "314b35335cc84bc2a085c84c69da955ba22da163" }, + "nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" }, "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" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-livegrep-history.nvim": { "branch": "main", "commit": "f714efc5a227955409b9b794df90d39a38b8d324" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, diff --git a/nvim/.config/nvim/lua/config/filetypes.lua b/nvim/.config/nvim/lua/config/filetypes.lua index 428cb14..3c98c6b 100644 --- a/nvim/.config/nvim/lua/config/filetypes.lua +++ b/nvim/.config/nvim/lua/config/filetypes.lua @@ -31,3 +31,11 @@ vim.api.nvim_create_autocmd('FileType', { vim.opt_local.shiftwidth = 2 end, }) + +vim.api.nvim_create_autocmd('FileType', { + pattern = 'go', + callback = function() + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + end, +}) diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 0f8ad7f..8ca3d26 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -15,7 +15,6 @@ return { }, { 'nvim-telescope/telescope-ui-select.nvim' }, { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, - { 'happy663/telescope-livegrep-history.nvim' }, }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that @@ -59,7 +58,6 @@ return { -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') - pcall(require('telescope').load_extension, 'livegrep_history') -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' @@ -68,12 +66,7 @@ return { vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set( - 'n', - 'sg', - require('telescope').extensions.livegrep_history.live_grep_with_history, - { desc = '[S]earch by [G]rep' } - ) + 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)' }) -- cgit v1.2.3 From 4f051dac80b45a873f36e53c50347814d1b31aeb Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 28 Jun 2025 00:57:12 -0400 Subject: Add copilot --- nvim/.config/nvim/lazy-lock.json | 2 ++ nvim/.config/nvim/lua/plugins/blink.lua | 9 ++++++++- nvim/.config/nvim/lua/plugins/conform.lua | 1 + nvim/.config/nvim/lua/plugins/copilot.lua | 27 +++++++++++++++++++++++++++ nvim/.config/nvim/lua/plugins/lint.lua | 1 + 5 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 nvim/.config/nvim/lua/plugins/copilot.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 328723c..bfee37a 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,6 +1,8 @@ { + "CopilotChat.nvim": { "branch": "main", "commit": "55f2162c36901224e22ff8424fd60ecef670b8fc" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "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" }, "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua index 9df552a..e035292 100644 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -32,6 +32,7 @@ return { opts = {}, }, 'folke/lazydev.nvim', + 'giuxtaposition/blink-cmp-copilot', }, --- @module 'blink.cmp' --- @type blink.cmp.Config @@ -77,9 +78,15 @@ return { }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, + 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, + }, }, }, diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 169a0cd..1d4be80 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -77,6 +77,7 @@ return { css = { 'prettierd', 'prettier', stop_after_first = true }, htmldjango = { 'prettierd', 'prettier', stop_after_first = true }, html = { 'prettierd', 'prettier', stop_after_first = true }, + sh = { 'shfmt' }, }, formatters = { isort = { diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..4d16709 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,27 @@ +return { + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + config = function() + require('copilot').setup { + suggestion = { enabled = false }, + panel = { enabled = false }, + } + end, + }, + { + 'CopilotC-Nvim/CopilotChat.nvim', + dependencies = { + { 'zbirenbaum/copilot.lua' }, + { 'nvim-lua/plenary.nvim', branch = 'master' }, -- for curl, log and async functions + }, + build = 'make tiktoken', -- Only on MacOS or Linux + config = function() + require('CopilotChat').setup {} + vim.keymap.set('n', 'cc', function() + vim.cmd 'CopilotChatToggle' + end, { desc = '[Copilot] Toggle Copilot Chat' }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index 3b39c05..ed5679b 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -14,6 +14,7 @@ return { lint.linters_by_ft['terraform'] = { 'tflint' } lint.linters_by_ft['python'] = { 'ruff', 'bandit' } 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 98cb87ec6fe0db4b614d5eab6702ab1534f0c461 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 28 Jun 2025 10:40:28 -0400 Subject: Add tmux navigator and adjust neotree/telescope filtering/searching --- nvim/.config/nvim/lazy-lock.json | 1 + nvim/.config/nvim/lua/plugins/lint.lua | 1 + nvim/.config/nvim/lua/plugins/neo-tree.lua | 14 ++++++++++++ nvim/.config/nvim/lua/plugins/telescope.lua | 28 ++++++++++++++++-------- nvim/.config/nvim/lua/plugins/tmux-navigator.lua | 20 +++++++++++++++++ 5 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 nvim/.config/nvim/lua/plugins/tmux-navigator.lua (limited to 'nvim') diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index bfee37a..36f1ba8 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -39,5 +39,6 @@ "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index ed5679b..4e41d83 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -14,6 +14,7 @@ return { lint.linters_by_ft['terraform'] = { 'tflint' } 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' } -- Default linters, which will cause errors unless these tools are available: diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua index 556111b..fa2b5db 100644 --- a/nvim/.config/nvim/lua/plugins/neo-tree.lua +++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua @@ -22,5 +22,19 @@ return { }, }, }, + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = true, + hide_by_name = { + '.DS_Store', + 'thumbs.db', + '.git', + }, + always_show_by_pattern = { + '.env*', + '.gitignore', + }, + }, }, } diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 8ca3d26..90064f6 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -39,15 +39,25 @@ return { -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { - -- You can put your default mappings / updates / etc. in here - -- All the info you're looking for is in `:help telescope.setup()` - -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} + 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(), diff --git a/nvim/.config/nvim/lua/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/plugins/tmux-navigator.lua new file mode 100644 index 0000000..a161285 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tmux-navigator.lua @@ -0,0 +1,20 @@ +--- Vim Tmux Navigator is a plugin that allows you to navigate between Vim and Tmux panes seamlessly. + +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +} -- cgit v1.2.3