{ pkgs, ... }: with builtins; { config.my.programs.nvim.plugins = with pkgs.vimPlugins; [ { plugin = formatter-nvim; cmd = [ "Format" "Fmt" ]; keys = [ { key = "="; cmd = "Format"; desc = "format (formatter)"; } ]; conf = readFile ./lua/formatter-nvim.lua; } { plugin = oil-nvim; lazy = false; opts = { }; dependencies = [ { plugin = which-key-nvim; } { plugin = nvim-web-devicons; } ]; } { plugin = mini-nvim; lazy = false; conf = readFile ./lua/mini-nvim.lua; } { plugin = trouble-nvim; keys = [ { key = "xx"; cmd = "TroubleToggle document_diagnostics"; desc = "Document Diagnostics (Trouble)"; } { key = "xX"; cmd = "TroubleToggle workspace_diagnostics"; desc = "Workspace Diagnostics (Troule)"; } { key = "xl"; cmd = "TroubleToggle loclist"; desc = "Location List (Trouble)"; } { key = "xq"; cmd = "TroubleToggle quickfix"; desc = "Quickfix List (Trouble)"; } { key = "xt"; cmd = "TodoTrouble"; desc = "Todo (Trouble)"; } { key = "xT"; cmd = "TodoTrouble keywords=TODO,FIX,FIXME"; desc = "Todo/Fix/Fixme (Trouble)"; } { key = "ft"; cmd = "TodoTelescope"; desc = "Todo"; } { key = "[q"; func = /* lua */ '' function() if require("trouble").is_open() then require("trouble").previous({ skip_groups = true, jump = true }) else vim.cmd.cprev() end end ''; desc = "Previous trouble/quickfix item"; } { key = "]q"; func = /* lua */ '' function() if require("trouble").is_open() then require("trouble").next({ skip_groups = true, jump = true }) else vim.cmd.cnext() end end ''; desc = "Next trouble/quickfix item"; } ]; opts = { }; dependencies = [ { plugin = which-key-nvim; } { plugin = nvim-web-devicons; } ]; } { plugin = nvim-cmp; conf = readFile ./lua/nvim-cmp.lua; event = [ "InsertEnter" ]; dependencies = [ { plugin = nvim-autopairs; opts = { }; } { plugin = cmp-async-path; } { plugin = cmp-buffer; } { plugin = cmp-cmdline; } { plugin = cmp-nvim-lsp; } { plugin = cmp_luasnip; } { plugin = friendly-snippets; } { plugin = lspkind-nvim; } { plugin = luasnip; } ]; } { plugin = direnv-vim; lazy = false; } { plugin = nvim-lspconfig; event = [ "BufRead" "BufNewFile" ]; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ { plugin = lsp_signature-nvim; } { plugin = null-ls-nvim; conf = readFile ./lua/null-ls-nvim.lua; dependencies = [ { plugin = which-key-nvim; } { plugin = plenary-nvim; } ]; } { plugin = which-key-nvim; } { plugin = lsp_lines-nvim; } { plugin = nvim-ufo; conf = readFile ./lua/nvim-ufo.lua; dependencies = [ { plugin = promise-async; } ]; } { plugin = neodev-nvim; conf = readFile ./lua/neodev-nvim.lua; } { plugin = inc-rename-nvim; opts = { input_buffer_type = "dressing"; }; dependencies = [ { plugin = dressing-nvim; } ]; } { plugin = actions-preview-nvim; } ]; } { plugin = vim-fugitive; cmd = [ "G" "Git" "Ggrep" "Glgrep" "Gclog" "Gllog" "Gcd" "Glcd" "Gedit" "Gsplit" "Gvsplit" "Gtabedit" "Gpedit" "Gdrop" "Gread" "Gwrite" "Gwq" "Gdiffsplit" "Gvdiffsplit" "GMove" "GRename" "GDelete" "GBrowse" ]; } { plugin = vim-tmux-navigator; event = [ "VeryLazy" ]; } { plugin = nvim-lastplace; event = [ "BufReadPost" "BufNewFile" ]; opts = { lastplace_ignore_buftype = [ "quickfix" "nofile" "help" ]; lastplace_ignore_filetype = [ "gitcommit" "gitrebase" "svn" "hgcommit" ]; lastplace_open_folds = true; }; } { plugin = telescope-nvim; cmd = [ "Telescope" ]; conf = builtins.readFile ./lua/telescope.lua; keys = [ { key = "ff"; cmd = "Telescope find_files"; desc = "Find files"; } { key = "fb"; cmd = "Telescope buffers"; desc = "Find buffers"; } { key = "fl"; cmd = "Telescope current_buffer_fuzzy_find"; desc = "Search lines"; } { key = "fg"; cmd = "Telescope live_grep"; desc = "Live grep"; } { key = "fh"; cmd = "Telescope help_tags"; desc = "Help tags"; } ]; dependencies = [ { plugin = plenary-nvim; } { plugin = which-key-nvim; } { plugin = telescope-fzf-native-nvim; } ]; } { plugin = vim-startuptime; cmd = [ "StartupTime" ]; conf = readFile ./lua/vim-startuptime.lua; } { plugin = typst-vim; ft = [ "typst" "typ" ]; } { plugin = comment-nvim; event = [ "BufReadPost" "BufNewFile" ]; opts = { }; } { plugin = telekasten-nvim; dependencies = [ { plugin = telescope-nvim; } { plugin = which-key-nvim; } { plugin = markdown-preview-nvim; ft = [ "md" ]; } ]; cmd = [ "Telekasten" ]; keys = [ { key = "z"; cmd = "Telekasten"; desc = "zettelkasten"; } ]; conf = builtins.readFile ./lua/zettelkasten-nvim.lua; } { plugin = nvim-surround; event = [ "BufReadPost" "BufNewFile" ]; opts = { }; } { plugin = zen-mode-nvim; keys = [ { key = "tz"; cmd = "ZenMode"; desc = "Zen mode"; } ]; conf = /* lua */ '' require("zen-mode").setup({ plugins = { tmux = { enabled = true, }, }, }) ''; dependencies = [ { plugin = twilight-nvim; conf = /* lua */ '' require("twilight").setup({ context = 20, expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types "function", "function_definition", "if_statement", "method", "method_definition", "table", }, }) ''; } ]; } { plugin = refactoring-nvim; keys = [ { key = "re"; cmd = ": Refactor eextract "; desc = "Extract"; mode = [ "x" ]; } { key = "rf"; cmd = ": Refactor extract_to_file "; desc = "Extract to file"; mode = [ "x" ]; } { key = "rv"; cmd = ": Refactor extract_var "; desc = "Extract variable"; mode = [ "x" ]; } { key = "ri"; cmd = ": Refactor inline_var"; desc = "Inline variable"; mode = [ "n" "x" ]; } { key = "rI"; cmd = ": Refactor inline_func"; desc = "Inline function"; mode = [ "n" "x" ]; } { key = "rb"; cmd = ": Refactor extract_block"; desc = "Extract block"; mode = [ "n" ]; } { key = "rbf"; cmd = ": Refactor extract_block_to_file"; desc = "Extract block to file"; mode = [ "n" ]; } ]; dependencies = [ { plugin = which-key-nvim; } { plugin = plenary-nvim; } { plugin = nvim-lspconfig; } ]; init = /* lua */ '' require("which-key").register({ ["r"] = { name = "refactoring", }, }) ''; opts = { }; } { plugin = harpoon; keys = [ { key = "ha"; cmd = "lua require('harpoon.mark').add_file()"; desc = "Add file"; } { key = "hh"; cmd = "lua require('harpoon.ui').toggle_quick_menu()"; desc = "Harpoon"; } { key = "h1"; cmd = "lua require('harpoon.ui').nav_file(1)"; desc = "Harpoon file 1"; } { key = "h2"; cmd = "lua require('harpoon.ui').nav_file(2)"; desc = "Harpoon file 2"; } { key = "h3"; cmd = "lua require('harpoon.ui').nav_file(3)"; desc = "Harpoon file 3"; } { key = "h4"; cmd = "lua require('harpoon.ui').nav_file(4)"; desc = "Harpoon file 4"; } ]; opts = { }; } ]; }