324 lines
9.1 KiB
Nix
324 lines
9.1 KiB
Nix
{ lib, pkgs, ... }:
|
|
|
|
with builtins;
|
|
{
|
|
config.my.programs.nvim.plugins = with pkgs.vimPlugins; [
|
|
{
|
|
plugin = which-key-nvim;
|
|
lazy = false;
|
|
conf = readFile ./which-key-nvim.lua;
|
|
}
|
|
{
|
|
plugin = catppuccin-nvim;
|
|
conf = readFile ./catppuccin-nvim.lua;
|
|
lazy = false;
|
|
priority = 99;
|
|
}
|
|
{
|
|
plugin = formatter-nvim;
|
|
keys = [
|
|
{ key = "="; cmd = "<cmd>Format<cr>"; desc = "format (formatter)"; }
|
|
];
|
|
conf = readFile ./formatter-nvim.lua;
|
|
}
|
|
{
|
|
plugin = oil-nvim;
|
|
lazy = false;
|
|
conf = readFile ./oil-nvim.lua;
|
|
dependencies = [
|
|
{ plugin = which-key-nvim; }
|
|
{ plugin = nvim-web-devicons; }
|
|
];
|
|
}
|
|
{
|
|
plugin = mini-nvim;
|
|
lazy = false;
|
|
conf = readFile ./mini-nvim.lua;
|
|
}
|
|
{
|
|
plugin = trouble-nvim;
|
|
keys = [
|
|
{ key = "<leader>xx"; cmd = "<cmd>TroubleToggle document_diagnostics<cr>"; desc = "Document Diagnostics (Trouble)"; }
|
|
{ key = "<leader>xX"; cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>"; desc = "Workspace Diagnostics (Troule)"; }
|
|
{ key = "<leader>xl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
|
|
{ key = "<leader>xq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
|
|
{ key = "<leader>xt"; cmd = "<cmd>TodoTrouble<cr>"; desc = "Todo (Trouble)"; }
|
|
{ key = "<leader>xT"; cmd = "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>"; desc = "Todo/Fix/Fixme (Trouble)"; }
|
|
{ key = "<leader>st"; cmd = "<cmd>TodoTelescope<cr>"; 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";
|
|
}
|
|
];
|
|
conf = readFile ./trouble-nvim.lua;
|
|
dependencies = [
|
|
{ plugin = which-key-nvim; }
|
|
{ plugin = nvim-web-devicons; }
|
|
];
|
|
}
|
|
{
|
|
plugin = nvim-cmp;
|
|
conf = readFile ./nvim-cmp.lua;
|
|
event = [ "InsertEnter" ];
|
|
dependencies = [
|
|
{
|
|
plugin = nvim-autopairs;
|
|
conf = /* lua */ ''
|
|
require("nvim-autopairs").setup({})
|
|
'';
|
|
}
|
|
{ plugin = cmp-async-path; }
|
|
{ plugin = cmp-buffer; }
|
|
{ plugin = cmp-cmdline; }
|
|
{ plugin = cmp-nvim-lsp; }
|
|
{ plugin = cmp_luasnip; }
|
|
{
|
|
plugin = codeium-nvim;
|
|
conf = /* lua */ ''
|
|
require("codeium").setup({})
|
|
'';
|
|
}
|
|
{ plugin = friendly-snippets; }
|
|
{ plugin = lspkind-nvim; }
|
|
{ plugin = luasnip; }
|
|
];
|
|
}
|
|
{
|
|
plugin = todo-comments-nvim;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = readFile ./todo-comments-nvim.lua;
|
|
dependencies = [{ plugin = plenary-nvim; }];
|
|
}
|
|
{
|
|
plugin = direnv-vim;
|
|
lazy = false;
|
|
}
|
|
{
|
|
plugin = nvim-treesitter;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf =
|
|
let
|
|
parserDir = pkgs.symlinkJoin {
|
|
name = "tresitter-grammars-all";
|
|
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
|
|
};
|
|
in
|
|
readFile ./nvim-treesitter.lua + ''
|
|
vim.opt.runtimepath:append("${parserDir}")
|
|
|
|
require'nvim-treesitter.configs'.setup {
|
|
parser_install_dir = "${parserDir}",
|
|
}
|
|
'';
|
|
dependencies = [
|
|
{ plugin = nvim-ts-context-commentstring; }
|
|
];
|
|
}
|
|
{
|
|
plugin = nvim-lspconfig;
|
|
event = [ "BufRead" "BufNewFile" ];
|
|
conf = readFile ./nvim-lspconfig.lua;
|
|
dependencies = [
|
|
{ plugin = lsp_signature-nvim; }
|
|
{
|
|
plugin = null-ls-nvim;
|
|
conf = readFile ./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 ./nvim-ufo.lua;
|
|
dependencies = [
|
|
{ plugin = promise-async; }
|
|
];
|
|
}
|
|
{
|
|
plugin = neodev-nvim;
|
|
conf = readFile ./neodev-nvim.lua;
|
|
}
|
|
{
|
|
plugin = inc-rename-nvim;
|
|
conf = /* lua */ ''
|
|
require("inc_rename").setup {
|
|
input_buffer_type = "dressing",
|
|
}
|
|
'';
|
|
dependencies = [
|
|
{
|
|
plugin = dressing-nvim;
|
|
}
|
|
];
|
|
}
|
|
{ plugin = actions-preview-nvim; }
|
|
];
|
|
}
|
|
{
|
|
plugin = statuscol-nvim;
|
|
event = [ "VeryLazy" ];
|
|
conf = readFile ./statuscol-nvim.lua;
|
|
}
|
|
{
|
|
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 = gitsigns-nvim;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = readFile ./gitsigns-nvim.lua;
|
|
dependencies = [{ plugin = which-key-nvim; }];
|
|
}
|
|
{
|
|
plugin = nvim-lastplace;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = readFile ./nvim-lastplace.lua;
|
|
}
|
|
{
|
|
plugin = nvim-treesitter-textsubjects;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = readFile ./nvim-treesitter-textsubjects.lua;
|
|
}
|
|
{
|
|
plugin = smartcolumn-nvim;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = readFile ./smartcolumn-nvim.lua;
|
|
}
|
|
{
|
|
plugin = telescope-nvim;
|
|
cmd = [ "Telescope" ];
|
|
conf = builtins.readFile ./telescope.lua;
|
|
keys = [
|
|
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
|
|
{ key = "<leader>fb"; cmd = "<cmd>Telescope buffers<cr>"; desc = "Find buffers"; }
|
|
{ key = "<leader>fr"; cmd = "<cmd>Telescope oldfiles<cr>"; desc = "Find recent files"; }
|
|
{ key = "<leader>sl"; cmd = "<cmd>Telescope current_buffer_fuzzy_find<cr>"; desc = "Search lines"; }
|
|
{ key = "<leader>sg"; cmd = "<cmd>Telescope live_grep<cr>"; desc = "Live grep"; }
|
|
{ key = "<leader>sc"; cmd = "<cmd>Telescope command_history<cr>"; desc = "Command history"; }
|
|
{ key = "<leader>sC"; cmd = "<cmd>Telescope commands<cr>"; desc = "Commands"; }
|
|
{ key = "<leader>sd"; cmd = "<cmd>Telescope diagnostics<cr>"; desc = "Diagnostics"; }
|
|
{ key = "<leader>sh"; cmd = "<cmd>Telescope help_tags<cr>"; desc = "Help tags"; }
|
|
{ key = "<leader>sk"; cmd = "<cmd>Telescope keymaps<cr>"; desc = "Keymaps"; }
|
|
{ key = "<leader>ss"; cmd = "<cmd>Telescope lsp_document_symbols<cr>"; desc = "Symbols (Document)"; }
|
|
{ key = "<leader>sS"; cmd = "<cmd>Telescope lsp_workspace_symbols<cr>"; desc = "Symbols (Workspace)"; }
|
|
];
|
|
dependencies = [
|
|
{ plugin = plenary-nvim; }
|
|
{ plugin = which-key-nvim; }
|
|
{ plugin = telescope-fzf-native-nvim; }
|
|
];
|
|
}
|
|
{
|
|
plugin = vim-startuptime;
|
|
cmd = [ "StartupTime" ];
|
|
conf = readFile ./vim-startuptime.lua;
|
|
}
|
|
{
|
|
plugin = typst-vim;
|
|
ft = [ "typst" "typ" ];
|
|
}
|
|
{
|
|
plugin = comment-nvim;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = /* lua */ ''
|
|
require("Comment").setup()
|
|
'';
|
|
}
|
|
{
|
|
plugin = telekasten-nvim;
|
|
dependencies = [
|
|
{ plugin = telescope-nvim; }
|
|
{ plugin = which-key-nvim; }
|
|
];
|
|
cmd = [ "Telekasten" ];
|
|
keys = [
|
|
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; }
|
|
];
|
|
conf = builtins.readFile ./zettelkasten-nvim.lua;
|
|
}
|
|
{
|
|
plugin = markdown-preview-nvim;
|
|
ft = [ "md" ];
|
|
}
|
|
{
|
|
plugin = nvim-surround;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = /* lua */ ''
|
|
require("nvim-surround").setup({})
|
|
'';
|
|
}
|
|
{
|
|
plugin = nvim-treesitter-context;
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
|
conf = /* lua */ ''
|
|
require("treesitter-context").setup({})
|
|
'';
|
|
}
|
|
{
|
|
plugin = dressing-nvim;
|
|
event = [ "VeryLazy" ];
|
|
}
|
|
{
|
|
plugin = hmts-nvim;
|
|
ft = [ "nix" ];
|
|
}
|
|
{
|
|
plugin = zen-mode-nvim;
|
|
keys = [
|
|
{ key = "<leader>tz"; cmd = "<cmd>ZenMode<cr>"; desc = "Zen mode"; }
|
|
];
|
|
dependencies = [
|
|
{ plugin = twilight-nvim; }
|
|
];
|
|
}
|
|
];
|
|
}
|