diff --git a/init.lua b/init.lua index 55ec1f26ae5..2afe06f32ae 100644 --- a/init.lua +++ b/init.lua @@ -12,12 +12,15 @@ vim.opt.tabstop = 4 -- Tab width = 4 spaces vim.opt.shiftwidth = 4 -- Indentation width = 4 spaces vim.opt.softtabstop = 4 -- Backspace deletes 4 spaces vim.opt.expandtab = true -- Convert tabs to spaces +vim.keymap.set("n", "wf", "(WayfinderOpen)", { desc = "Wayfinder" }) -- let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -l -g ""' - -- Don't show the mode, since it's already in the status line vim.opt.showmode = false -vim.api.nvim_set_keymap('n', 'F', 'lua vim.lsp.buf.format()', { noremap = true, silent = true }) +vim.keymap.set({ 'n', 'v' }, 'F', function() + vim.lsp.buf.format({ async = true }) +end, { noremap = true, silent = true, desc = '[F]ormat buffer/range' }) +vim.api.nvim_set_keymap('v', 'F', 'lua vim.lsp.buf.format()', { noremap = true, silent = true }) -- vim.api.nvim_set_keymap('n', 'pf', 'lua require("null-ls").formatting.black()', { noremap = true, silent = true, desc = 'Format Python with Black' }) @@ -74,6 +77,38 @@ if vim.env.TMUX ~= nil then } end +-- Debug command: :DebugAttach +-- Deferred to after dap plugin loads +-- vim.api.nvim_create_autocmd('User', { +-- pattern = 'VeryLazy', +-- callback = function() +-- vim.api.nvim_create_user_command('DebugAttach', function(opts) +-- local name = opts.args +-- local pid = vim.fn.system('pidof ' .. name):gsub('%s+', '') +-- if pid == '' then +-- vim.notify('Process not found: ' .. name, vim.log.levels.ERROR) +-- return +-- end +-- -- Get the executable path from /proc +-- local exe_path = vim.fn.resolve('/proc/' .. pid .. '/exe') +-- if exe_path == '' or exe_path:match('No such file') then +-- exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') +-- end +-- require('dap').run({ +-- name = 'Attach to ' .. name, +-- type = 'cppdbg', +-- request = 'attach', +-- processId = tonumber(pid), +-- program = exe_path, +-- cwd = vim.fn.getcwd(), +-- MIMode = 'gdb', +-- miDebuggerPath = '/usr/bin/gdb', +-- }) +-- end, { nargs = 1 }) +-- end, +-- }) + + vim.opt.breakindent = true vim.opt.undofile = true @@ -211,81 +246,134 @@ require('lazy').setup({ }, spec = { - { 'c', group = '[C]ode', mode = { 'n', 'x' } }, - { 'd', group = '[D]ocument' }, + { 'c', group = '[C]ode', mode = { 'n', 'x' } }, + { 'd', group = '[D]ebug' }, { 'r', group = '[R]ename' }, { 's', group = '[S]earch' }, { 'w', group = '[W]orkspace' }, { 't', group = '[T]oggle' }, - { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, + { 'm', group = '[M]arks/Bookmarks', mode = { 'n', 'v' } }, }, }, }, + -- { + -- 'nvim-telescope/telescope.nvim', + -- event = 'VimEnter', + -- branch = '0.1.x', + -- 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 { + -- extensions = { + -- ['ui-select'] = { + -- require('telescope.themes').get_dropdown(), + -- }, + -- }, + -- } + -- + -- pcall(require('telescope').load_extension, 'fzf') + -- pcall(require('telescope').load_extension, 'ui-select') + -- + -- local builtin = require 'snacks.picker' + -- vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) + -- vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) + -- vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) + -- vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) + -- vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) + -- vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + -- vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) + -- vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) + -- vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + -- vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + -- vim.keymap.set('n', 'sc', builtin.lsp_document_symbols, { desc = '[S]earch do[c]ument symbols' }) + -- + -- 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, + -- }, { - 'nvim-telescope/telescope.nvim', - event = 'VimEnter', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { - 'nvim-telescope/telescope-fzf-native.nvim', - - build = 'make', - - cond = function() - return vim.fn.executable 'make' == 1 - end, + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { + enabled = true, + jump = { reuse_win = true }, }, - { 'nvim-telescope/telescope-ui-select.nvim' }, - - { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = true }, + words = { enabled = true }, }, config = function() - require('telescope').setup { - 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' }) + local builtin = require 'snacks.picker' + vim.keymap.set('n', 'sh', builtin.help, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sf', builtin.files, { desc = '[S]earch [F]iles' }) + vim.keymap.set('n', 'ss', builtin.pickers, { desc = '[S]earch [S]elect Pickers' }) + vim.keymap.set('n', 'sw', builtin.grep_word, { desc = '[S]earch current [W]ord' }) + vim.keymap.set('n', 'sg', builtin.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', 's.', builtin.recent, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - vim.keymap.set('n', 'sc', builtin.lsp_document_symbols, { desc = '[S]earch do[c]ument symbols' }) + vim.keymap.set('n', 'sc', builtin.lsp_symbols, { desc = '[S]earch do[c]ument symbols' }) + vim.keymap.set("n", "SC", builtin.colorschemes, { desc = "Select colorscheme" }) vim.keymap.set('n', '/', function() - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) + builtin.lines() 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', - } + builtin.grep_buffers() end, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } + builtin.files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' }) end, }, - { 'folke/lazydev.nvim', ft = 'lua', @@ -295,7 +383,7 @@ require('lazy').setup({ }, }, }, - { 'Bilal2453/luvit-meta', lazy = true }, + { 'Bilal2453/luvit-meta', lazy = true }, { 'neovim/nvim-lspconfig', dependencies = { @@ -316,17 +404,12 @@ require('lazy').setup({ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - map('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - - map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + map('gd', require('snacks.picker').lsp_definitions, '[G]oto [D]efinition') + map('gr', require('snacks.picker').lsp_references, '[G]oto [R]eferences') + map('gI', require('snacks.picker').lsp_implementations, '[G]oto [I]mplementation') + map('D', require('snacks.picker').lsp_type_definitions, 'Type [D]efinition') + map('ds', require('snacks.picker').lsp_symbols, '[D]ocument [S]ymbols') + map('ws', require('snacks.picker').lsp_workspace_symbols, '[W]orkspace [S]ymbols') map('rn', vim.lsp.buf.rename, '[R]e[n]ame') @@ -359,10 +442,21 @@ require('lazy').setup({ end if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then + -- Enable inlay hints by default + vim.lsp.inlay_hint.enable(true, { bufnr = event.buf }) + 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 + + -- Signature help when typing function arguments + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_signatureHelp) then + map('', vim.lsp.buf.signature_help, 'Signature Help', 'i') + end + + -- Hover documentation + map('K', vim.lsp.buf.hover, 'Hover Documentation') end, }) @@ -370,8 +464,8 @@ require('lazy').setup({ capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) local servers = { - clangd = { - cmd = { "clangd", "--background-index", "-j=62", "--pch-storage=memory", "--clang-tidy" }, + clangd = { + cmd = { "clangd", "--background-index", "-j=4", "--pch-storage=memory", "--clang-tidy" }, root_dir = require('lspconfig.util').root_pattern('compile_commands.json', '.git'), settings = { clangd = { @@ -383,8 +477,8 @@ require('lazy').setup({ -- gopls = {}, -- ocamllsp = {}, -- pyright = {}, - basedpyright = {}, - ruff = {}, + basedpyright = {}, + ruff = {}, -- perlnavigator = {}, -- pylsp = {}, -- pylsp = { @@ -404,25 +498,13 @@ require('lazy').setup({ -- cssls = {}, -- tailwindcss = {}, - -- rust_analyzer = { - -- cmd = vim.lsp.rpc.connect("127.0.0.1", 27631), - -- settings = { - -- ["rust-analyzer"] = { - -- lspMux = { - -- version = "1", - -- method = "connect", - -- server = "rust-analyzer", - -- }, - -- }, - -- }, - -- - -- }, + rust_analyzer = {}, -- omnisharp = {}, -- csharpier = {}, -- netcoredbg = {}, -- fantomas = {}, - bashls = {}, - lua_ls = { + bashls = {}, + lua_ls = { settings = { Lua = { completion = { @@ -528,27 +610,49 @@ require('lazy').setup({ end, }, + -- { + -- "sainnhe/everforest", + -- config = function() + -- -- Set contrast: 'hard', 'medium' (default), or 'soft' + -- vim.g.everforest_background = "soft" + -- -- Optional: enable italic/bold + -- -- vim.g.everforest_enable_italic = 1 + -- -- Load the colorscheme + -- vim.cmd([[colorscheme everforest]]) + -- end, + -- }, + { 'folke/tokyonight.nvim', priority = 1000, + -- init = function() + -- vim.cmd.colorscheme 'tokyonight-night' + -- + -- vim.cmd.hi 'Comment gui=none' + -- end, + }, + { + "rebelot/kanagawa.nvim", + name = "kanagawa", + priority = 1000, init = function() - vim.cmd.colorscheme 'tokyonight-night' - + vim.cmd.colorscheme 'kanagawa' vim.cmd.hi 'Comment gui=none' + vim.o.background = "dark" end, }, - { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, - { "sainnhe/everforest", name = "everforest", priority = 1000 }, + + -- { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, { "EdenEast/nightfox.nvim", name = "nightfox", - priority = 999, - init = function() - -- vim.cmd.colorscheme 'dayfox' - - vim.cmd.hi 'Comment gui=none' - end, + -- priority = 999, + -- init = function() + -- vim.cmd.colorscheme 'dayfox' + -- + -- vim.cmd.hi 'Comment gui=none' + -- end, }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, @@ -583,9 +687,13 @@ require('lazy').setup({ }, }, { - 'nvim-treesitter/nvim-treesitter-context' + 'nvim-treesitter/nvim-treesitter-context', + opts = { + max_lines = 3, + }, }, + { import = 'kickstart.plugins' }, { import = 'custom.plugins' }, }, { ui = { diff --git a/lazy-lock.json b/lazy-lock.json index 3ed440298fc..1f0866cbe23 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,47 +1,48 @@ { - "LuaSnip": { "branch": "master", "commit": "5271933f7cea9f6b1c7de953379469010ed4553a" }, + "LuaSnip": { "branch": "master", "commit": "a62e1083a3cfe8b6b206e7d3d33a51091df25357" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "everforest": { "branch": "master", "commit": "c4bb2ae687ae21938775f436cf213492702a0cf3" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "gitlinker.nvim": { "branch": "master", "commit": "23982c86f50a9c3f4bc531d41b7a4a68ddd12355" }, + "everforest-nvim": { "branch": "main", "commit": "d235ca0aa6a29546e661a020e2618612acbbffbe" }, + "fidget.nvim": { "branch": "main", "commit": "889e2e96edef4e144965571d46f7a77bcc4d0ddf" }, + "gitlinker.nvim": { "branch": "master", "commit": "d7adb5e4ba5bab4fd443a3f4c46af3f4c864685d" }, "gitsigns.nvim": { "branch": "main", "commit": "9b36d497495436c135659902054ee637e0ba6021" }, - "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, - "luvit-meta": { "branch": "main", "commit": "1df30b60b1b4aecfebc785aa98943db6c6989716" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, - "mini.nvim": { "branch": "main", "commit": "35e1767f4cd7dde51256eabae7349a5283a43cba" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "kanagawa": { "branch": "master", "commit": "8ad3b4cdcc804b332c32db8f9743667e1bb82b99" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, + "luvit-meta": { "branch": "main", "commit": "cc9b2d412d2fbd30b94a70cfc214c2a3be27a0a2" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0c2823e0418f3d9230ff8b201c976e84de1cb401" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "12ddd182d9efbdc848b540f16484a583d52da0fb" }, + "mini.icons": { "branch": "main", "commit": "bac6317300e205335df425296570d84322730067" }, + "mini.nvim": { "branch": "main", "commit": "4f6f84a96b076747b736d100388a8d7844771d7d" }, + "neo-tree.nvim": { "branch": "main", "commit": "84c75e7a7e443586f60508d12fc50f90d9aee14e" }, "nightfox": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, - "nvim-ufo": { "branch": "main", "commit": "3c7a3570e9c9dc198a2ad4491b0b0e51c4d4ba08" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, - "octo.nvim": { "branch": "master", "commit": "fded71669b61c6ccae9d8ade30f667c3c4962b48" }, - "oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-lint": { "branch": "master", "commit": "eab58b48eb11d7745c11c505e0f3057165902461" }, + "nvim-lspconfig": { "branch": "master", "commit": "8fde495949782bb61c2605174e231d145a048d8c" }, + "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b0c45cefe2c8f7b55fc46f34e563bc428ef99636" }, + "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, + "nvim-web-devicons": { "branch": "master", "commit": "c72328a5494b4502947a022fe69c0c47e53b6aa6" }, + "octo.nvim": { "branch": "master", "commit": "34e67cc2d247e9b9271e2b54baeb6d4f6d1035bb" }, + "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "python-type-stubs": { "branch": "main", "commit": "692c37c3969d22612b295ddf7e7af5907204a386" }, - "roslyn.nvim": { "branch": "main", "commit": "7ba2dd0a5628c5ad3d8cc5a22e66ece3efc371bc" }, - "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "47a50525c251fe1195fc59443504f11fba2d5d3c" }, - "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "147af4e49f51dd48f41972de26552872b8ba7b25" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, - "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } + "vscode-diff.nvim": { "branch": "main", "commit": "8afc229d38dc13ce71b2ffbb860084b2c726e061" }, + "wayfinder.nvim": { "branch": "main", "commit": "8325497cb6403e648ec60e6ede7a2c3946184b4a" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, + "yanky.nvim": { "branch": "main", "commit": "784188e0a7363e762e53140f39124d786aec0832" } } diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index e373873dc73..c8cffc57916 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -4,68 +4,6 @@ -- See the kickstart.nvim README for more information return { - -- { - -- 'yetone/avante.nvim', - -- event = 'VeryLazy', - -- lazy = true, - -- version = false, -- set this if you want to always pull the latest change - -- opts = { - -- provider = 'copilot', - -- copilot = { - -- model = "gemini-2.5-pro", - -- }, - -- auto_suggestions_provider = 'copilot', - -- behaviour = { - -- auto_suggestions = false, -- Experimental stage - -- }, - -- }, - -- -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - -- build = 'make', - -- -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - -- dependencies = { - -- 'nvim-treesitter/nvim-treesitter', - -- 'stevearc/dressing.nvim', - -- 'nvim-lua/plenary.nvim', - -- 'MunifTanjim/nui.nvim', - -- --- The below dependencies are optional, - -- 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons - -- { - -- 'zbirenbaum/copilot.lua', - -- opts = {}, - -- }, -- for providers='copilot' - -- { - -- -- support for image pasting - -- 'HakonHarnes/img-clip.nvim', - -- event = 'VeryLazy', - -- opts = { - -- -- recommended settings - -- default = { - -- embed_image_as_base64 = false, - -- prompt_for_file_name = false, - -- drag_and_drop = { - -- insert_mode = true, - -- }, - -- -- required for Windows users - -- use_absolute_path = true, - -- }, - -- }, - -- }, - -- { - -- -- Make sure to set this up properly if you have lazy=true - -- 'MeanderingProgrammer/render-markdown.nvim', - -- opts = { - -- file_types = { 'markdown', 'Avante' }, - -- }, - -- ft = { 'markdown', 'Avante' }, - -- }, - -- }, - -- }, - -- { -- Leap plugin for enhanced navigation - -- 'ggandor/leap.nvim', - -- config = function() - -- require('leap').add_default_mappings() - -- end, - -- }, { 'linrongbin16/gitlinker.nvim', cmd = 'GitLink', @@ -131,6 +69,8 @@ return { vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 vim.o.foldenable = true + -- vim.o.foldcolumn = 'auto:8' + vim.o.foldcolumn = "0" -- Keymaps for opening/closing all folds vim.keymap.set('n', 'zR', require('ufo').openAllFolds) @@ -142,13 +82,13 @@ return { return { 'treesitter', 'indent' } end, -- Optional: Configure preview for folds - preview = { - win_config = { - border = { '', '─', '', '', '', '─', '', '' }, - winhighlight = 'Normal:Folded', - winblend = 0 - } - } + -- preview = { + -- win_config = { + -- border = { '', '─', '', '', '', '─', '', '' }, + -- winhighlight = 'Normal:Folded', + -- winblend = 0 + -- } + -- } }) end }, @@ -229,14 +169,14 @@ return { dashboard = { enabled = true }, explorer = { enabled = true }, indent = { enabled = true }, - input = { enabled = false }, + input = { enabled = true }, picker = { enabled = true }, notifier = { enabled = true }, quickfile = { enabled = true }, scope = { enabled = true }, scroll = { enabled = false }, statuscolumn = { enabled = true }, - words = { enabled = false }, + words = { enabled = true }, }, }, { @@ -254,19 +194,6 @@ return { }, }, }, - -- { - -- "CopilotC-Nvim/CopilotChat.nvim", - -- dependencies = { - -- { "github/copilot.vim" }, -- or zbirenbaum/copilot.lua - -- { "nvim-lua/plenary.nvim", branch = "master" }, -- for curl, log and async functions - -- }, - -- build = "make tiktoken", -- Only on MacOS or Linux - -- opts = { - -- -- See Configuration section for options - -- model = 'claude-3.5-sonnet', - -- }, - -- -- See Commands section for default commands if you want to lazy load on them - -- }, { 'romgrk/barbar.nvim', dependencies = { @@ -318,55 +245,63 @@ return { }, + -- { + -- "seblyng/roslyn.nvim", + -- dependencies = { + -- "microsoft/python-type-stubs", -- Optional: for better Python interop if needed + -- }, + -- ft = "cs", -- Only load for C# files + -- opts = { + -- config = { + -- -- Specify your manual Roslyn installation + -- cmd = { + -- "dotnet", + -- "/usr/local/roslyn/lib/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll", + -- "--logLevel=Information", + -- "--extensionLogDirectory=" .. vim.fs.joinpath(vim.uv.os_tmpdir(), "roslyn_ls/logs"), + -- }, + -- + -- -- Unity-specific settings + -- settings = { + -- ["csharp|inlay_hints"] = { + -- csharp_enable_inlay_hints_for_implicit_object_creation = true, + -- csharp_enable_inlay_hints_for_implicit_variable_types = true, + -- csharp_enable_inlay_hints_for_lambda_parameter_types = true, + -- csharp_enable_inlay_hints_for_types = true, + -- dotnet_enable_inlay_hints_for_parameters = true, + -- }, + -- ["csharp|code_lens"] = { + -- dotnet_enable_references_code_lens = true, + -- }, + -- ["csharp|completion"] = { + -- dotnet_show_completion_items_from_unimported_namespaces = true, + -- dotnet_show_name_completion_suggestions = true, + -- }, + -- }, + -- + -- -- Important for Unity: find the .sln file + -- -- root_dir = require("roslyn.config").root_dir, + -- root_dir = function(fname) + -- return require("lspconfig.util").root_pattern("*.sln")(fname) + -- or require("lspconfig.util").root_pattern("*.csproj")(fname) + -- end, + -- + -- }, + -- + -- -- Unity assemblies - add Unity's reference assemblies + -- exe = { + -- "dotnet", + -- "/usr/local/roslyn/lib/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll", + -- }, + -- }, + -- }, { - "seblyng/roslyn.nvim", - dependencies = { - "microsoft/python-type-stubs", -- Optional: for better Python interop if needed - }, - ft = "cs", -- Only load for C# files - opts = { - config = { - -- Specify your manual Roslyn installation - cmd = { - "dotnet", - "/usr/local/roslyn/lib/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll", - "--logLevel=Information", - "--extensionLogDirectory=" .. vim.fs.joinpath(vim.uv.os_tmpdir(), "roslyn_ls/logs"), - }, - - -- Unity-specific settings - settings = { - ["csharp|inlay_hints"] = { - csharp_enable_inlay_hints_for_implicit_object_creation = true, - csharp_enable_inlay_hints_for_implicit_variable_types = true, - csharp_enable_inlay_hints_for_lambda_parameter_types = true, - csharp_enable_inlay_hints_for_types = true, - dotnet_enable_inlay_hints_for_parameters = true, - }, - ["csharp|code_lens"] = { - dotnet_enable_references_code_lens = true, - }, - ["csharp|completion"] = { - dotnet_show_completion_items_from_unimported_namespaces = true, - dotnet_show_name_completion_suggestions = true, - }, - }, - - -- Important for Unity: find the .sln file - -- root_dir = require("roslyn.config").root_dir, - root_dir = function(fname) - return require("lspconfig.util").root_pattern("*.sln")(fname) - or require("lspconfig.util").root_pattern("*.csproj")(fname) - end, - - }, - - -- Unity assemblies - add Unity's reference assemblies - exe = { - "dotnet", - "/usr/local/roslyn/lib/net9.0/Microsoft.CodeAnalysis.LanguageServer.dll", - }, - }, - } + "esmuellert/vscode-diff.nvim", + dependencies = { "MunifTanjim/nui.nvim" }, + }, + { + "JoshuaGabriel/wayfinder.nvim", + opts = {}, +} } diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 87a7e5ffa2e..aba3b1f6e8c 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -6,9 +6,10 @@ return { event = 'InsertEnter', -- Optional dependency dependencies = { 'hrsh7th/nvim-cmp' }, - config = function() - require('nvim-autopairs').setup {} - -- If you want to automatically add `(` after selecting a function or method + opts = {}, + config = function(_, opts) + local autopairs = require 'nvim-autopairs' + autopairs.setup(opts) local cmp_autopairs = require 'nvim-autopairs.completion.cmp' local cmp = require 'cmp' cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 196f2c6dbd6..3258c841e08 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -6,100 +6,194 @@ -- 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 - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - - -- Add your own debuggers here - 'leoluz/nvim-dap-go', - }, - keys = function(_, keys) - local dap = require 'dap' - local dapui = require 'dapui' - return { - -- Basic debugging keymaps, feel free to change to your liking! - { '', dap.continue, desc = 'Debug: Start/Continue' }, - { '', dap.step_into, desc = 'Debug: Step Into' }, - { '', dap.step_over, desc = 'Debug: Step Over' }, - { '', dap.step_out, desc = 'Debug: Step Out' }, - { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, - { - 'B', - function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { '', dapui.toggle, desc = 'Debug: See last session result.' }, - unpack(keys), - } - end, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' - - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- 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', - }, - } - - -- 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 = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - 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, - }, - } - end, -} +return {} +-- 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 +-- 'williamboman/mason.nvim', +-- 'jay-babu/mason-nvim-dap.nvim', +-- +-- -- Add your own debuggers here +-- 'leoluz/nvim-dap-go', +-- }, +-- keys = function(_, keys) +-- local dap = require 'dap' +-- local dapui = require 'dapui' +-- return { +-- -- Basic debugging keymaps +-- { '6', dap.continue, desc = 'Debug: Continue' }, +-- { '7', dap.step_over, desc = 'Debug: Step Over (Next Line)' }, +-- { '8', dap.step_into, desc = 'Debug: Step Into' }, +-- { '9', dap.step_out, desc = 'Debug: Step Out' }, +-- { '0', dapui.toggle, desc = 'Debug: Toggle DAP UI' }, +-- { 'b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, +-- { +-- 'B', +-- function() +-- dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') +-- end, +-- desc = 'Debug: Set Breakpoint', +-- }, +-- -- Attach to process by picking from list +-- { +-- 'dp', +-- function() +-- local handle = io.popen('ps -eo pid,comm --no-headers 2>/dev/null') +-- if not handle then +-- vim.notify('Failed to get process list', vim.log.levels.ERROR) +-- return +-- end +-- local result = handle:read('*a') +-- handle:close() +-- +-- local items = {} +-- for line in result:gmatch('[^\n]+') do +-- local pid, name = line:match('%s*(%d+)%s+(.+)') +-- if pid and name then +-- table.insert(items, { +-- text = pid .. ' - ' .. name, +-- pid = pid, +-- name = name, +-- }) +-- end +-- end +-- +-- Snacks.picker({ +-- title = 'Attach Debugger to Process', +-- items = items, +-- format = function(item) +-- return { { item.text } } +-- end, +-- confirm = function(picker, item) +-- picker:close() +-- if item then +-- -- Get the executable path from /proc +-- local exe_path = vim.fn.resolve('/proc/' .. item.pid .. '/exe') +-- if exe_path == '' or exe_path:match('No such file') then +-- exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') +-- end +-- dap.run({ +-- name = 'Attach to ' .. item.name, +-- type = 'cppdbg', +-- request = 'attach', +-- processId = tonumber(item.pid), +-- program = exe_path, +-- cwd = vim.fn.getcwd(), +-- MIMode = 'gdb', +-- miDebuggerPath = '/usr/bin/gdb', +-- }) +-- end +-- end, +-- }) +-- end, +-- desc = 'Debug: [P]ick process to attach', +-- }, +-- -- Attach to process by entering PID +-- { +-- 'da', +-- function() +-- vim.ui.input({ prompt = 'Enter PID: ' }, function(pid) +-- if pid and pid ~= '' then +-- -- Get the executable path from /proc +-- local exe_path = vim.fn.resolve('/proc/' .. pid .. '/exe') +-- if exe_path == '' or exe_path:match('No such file') then +-- exe_path = vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') +-- end +-- dap.run({ +-- name = 'Attach to PID ' .. pid, +-- type = 'cppdbg', +-- request = 'attach', +-- processId = tonumber(pid), +-- program = exe_path, +-- cwd = vim.fn.getcwd(), +-- MIMode = 'gdb', +-- miDebuggerPath = '/usr/bin/gdb', +-- }) +-- end +-- end) +-- end, +-- desc = 'Debug: [A]ttach to PID', +-- }, +-- unpack(keys), +-- } +-- end, +-- config = function() +-- local dap = require 'dap' +-- local dapui = require 'dapui' +-- +-- require('mason-nvim-dap').setup { +-- -- Makes a best effort to setup the various debuggers with +-- -- 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', +-- 'cppdbg', -- For C/C++ debugging with GDB < 14 +-- }, +-- } +-- +-- -- 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 = { +-- pause = '⏸', +-- play = '▶', +-- step_into = '⏎', +-- step_over = '⏭', +-- step_out = '⏮', +-- step_back = 'b', +-- run_last = '▶▶', +-- terminate = '⏹', +-- disconnect = '⏏', +-- }, +-- }, +-- } +-- +-- dap.adapters.gdb = { +-- type = 'executable', +-- command = 'gdb', +-- args = { '-i', 'dap' }, +-- } +-- +-- -- cppdbg adapter for GDB < 14 (uses vscode-cpptools) +-- dap.adapters.cppdbg = { +-- id = 'cppdbg', +-- type = 'executable', +-- command = vim.fn.stdpath('data') .. '/mason/bin/OpenDebugAD7', +-- } +-- +-- 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, +-- }, +-- } +-- end, +-- } diff --git a/lua/kickstart/plugins/indent_line.lua b/lua/kickstart/plugins/indent_line.lua index ed7f269399f..1a6cd9c58a0 100644 --- a/lua/kickstart/plugins/indent_line.lua +++ b/lua/kickstart/plugins/indent_line.lua @@ -1,8 +1,8 @@ return { { -- Add indentation guides even on blank lines 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help ibl` + -- Disabled: snacks.nvim indent module handles this now + enabled = false, main = 'ibl', opts = {}, }, diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index a6cdae617e4..72c128266e4 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -4,9 +4,9 @@ return { 'mfussenegger/nvim-lint', event = { 'BufReadPre', 'BufNewFile' }, config = function() - local lint = require 'lint' + local lint = require('lint') lint.linters_by_ft = { - markdown = { 'markdownlint' }, + -- markdown = { 'markdownlint' }, python = { 'flake8' }, -- Add flake8 for Python }