2024-02-12 10:10:32 +01:00
|
|
|
{ pkgs, lib, inputs, ... }:
|
2023-06-10 21:52:57 +02:00
|
|
|
|
|
|
|
with builtins;
|
|
|
|
{
|
2023-09-17 09:35:10 +02:00
|
|
|
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
|
2023-06-10 21:52:57 +02:00
|
|
|
{
|
|
|
|
plugin = oil-nvim;
|
2023-06-11 10:22:19 +02:00
|
|
|
lazy = false;
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = { };
|
2023-06-10 21:52:57 +02:00
|
|
|
dependencies = [
|
2023-06-11 10:22:19 +02:00
|
|
|
{ plugin = which-key-nvim; }
|
|
|
|
{ plugin = nvim-web-devicons; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = mini-nvim;
|
2023-06-11 10:22:19 +02:00
|
|
|
lazy = false;
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/mini-nvim.lua;
|
2023-06-10 21:52:57 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = trouble-nvim;
|
2023-10-28 15:18:59 +02:00
|
|
|
cmd = [ "TodoTelescope" ];
|
2023-06-10 21:52:57 +02:00
|
|
|
keys = [
|
2024-01-11 09:25:31 +01:00
|
|
|
{
|
|
|
|
key = "<leader>cD";
|
|
|
|
cmd = "<cmd>TroubleToggle document_diagnostics<cr>";
|
|
|
|
desc = "Document Diagnostics (Trouble)";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "<leader>cW";
|
|
|
|
cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>";
|
|
|
|
desc = "Workspace Diagnostics (Trouble)";
|
|
|
|
}
|
2023-10-28 15:18:59 +02:00
|
|
|
{ key = "<leader>cl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
|
|
|
|
{ key = "<leader>cq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
|
2023-09-10 13:30:29 +02:00
|
|
|
{ key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
|
2023-06-10 21:52:57 +02:00
|
|
|
{
|
|
|
|
key = "[q";
|
2023-09-10 13:30:29 +02:00
|
|
|
func = /* lua */ ''
|
|
|
|
function()
|
|
|
|
if require("trouble").is_open() then
|
|
|
|
require("trouble").previous({ skip_groups = true, jump = true })
|
|
|
|
else
|
|
|
|
vim.cmd.cprev()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
2023-06-10 21:52:57 +02:00
|
|
|
desc = "Previous trouble/quickfix item";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key = "]q";
|
2023-09-10 13:30:29 +02:00
|
|
|
func = /* lua */ ''
|
|
|
|
function()
|
|
|
|
if require("trouble").is_open() then
|
|
|
|
require("trouble").next({ skip_groups = true, jump = true })
|
|
|
|
else
|
|
|
|
vim.cmd.cnext()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
'';
|
2023-06-10 21:52:57 +02:00
|
|
|
desc = "Next trouble/quickfix item";
|
|
|
|
}
|
|
|
|
];
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = { };
|
2023-06-10 21:52:57 +02:00
|
|
|
dependencies = [
|
2023-06-11 10:22:19 +02:00
|
|
|
{ plugin = nvim-web-devicons; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
2023-09-06 09:19:32 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-cmp;
|
2023-10-26 09:47:21 +02:00
|
|
|
keys = [
|
|
|
|
{ key = "<leader>tc"; cmd = "<cmd>CmpToggle<cr>"; desc = "Toggle Cmp sources"; }
|
|
|
|
];
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/nvim-cmp.lua;
|
2023-09-06 09:19:32 +02:00
|
|
|
event = [ "InsertEnter" ];
|
|
|
|
dependencies = [
|
2023-09-07 08:39:43 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-autopairs;
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = { };
|
2023-09-07 08:39:43 +02:00
|
|
|
}
|
2023-09-06 09:19:32 +02:00
|
|
|
{ plugin = cmp-async-path; }
|
2023-09-06 17:45:31 +02:00
|
|
|
{ plugin = cmp-buffer; }
|
|
|
|
{ plugin = cmp-cmdline; }
|
2023-09-06 09:19:32 +02:00
|
|
|
{ plugin = cmp-nvim-lsp; }
|
|
|
|
{ plugin = cmp_luasnip; }
|
2024-02-01 12:33:35 +01:00
|
|
|
{ plugin = cmp-spell; }
|
|
|
|
{ plugin = cmp-nvim-lsp-signature-help; }
|
2023-10-01 21:15:49 +02:00
|
|
|
{ plugin = friendly-snippets; }
|
|
|
|
{ plugin = lspkind-nvim; }
|
2024-02-10 18:22:09 +01:00
|
|
|
{
|
|
|
|
plugin = luasnip;
|
|
|
|
conf = readFile ./lua/luasnip.lua;
|
|
|
|
}
|
2023-09-06 09:19:32 +02:00
|
|
|
];
|
|
|
|
}
|
2023-06-10 21:52:57 +02:00
|
|
|
{
|
|
|
|
plugin = direnv-vim;
|
2023-06-11 10:22:19 +02:00
|
|
|
lazy = false;
|
2023-06-10 21:52:57 +02:00
|
|
|
}
|
|
|
|
{
|
2024-02-16 11:02:46 +01:00
|
|
|
plugin = pkgs.vimPlugins.nvim-lspconfig.overrideAttrs (_: {
|
|
|
|
version = lib.my.mkVersionInput inputs.nvim-lspconfig;
|
|
|
|
src = inputs.nvim-lspconfig;
|
|
|
|
});
|
2023-08-12 11:50:46 +02:00
|
|
|
event = [ "BufRead" "BufNewFile" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/nvim-lspconfig.lua;
|
2023-06-10 21:52:57 +02:00
|
|
|
dependencies = [
|
|
|
|
{
|
2024-02-12 10:10:32 +01:00
|
|
|
plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: {
|
|
|
|
version = lib.my.mkVersionInput inputs.none-ls-nvim;
|
|
|
|
src = inputs.none-ls-nvim;
|
|
|
|
});
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/null-ls-nvim.lua;
|
2023-06-10 21:52:57 +02:00
|
|
|
dependencies = [
|
2023-06-11 10:22:19 +02:00
|
|
|
{ plugin = which-key-nvim; }
|
|
|
|
{ plugin = plenary-nvim; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
2023-06-11 10:22:19 +02:00
|
|
|
{ plugin = which-key-nvim; }
|
|
|
|
{ plugin = lsp_lines-nvim; }
|
2023-06-10 21:52:57 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-ufo;
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/nvim-ufo.lua;
|
2023-06-10 21:52:57 +02:00
|
|
|
dependencies = [
|
2023-06-11 10:22:19 +02:00
|
|
|
{ plugin = promise-async; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
2023-08-12 08:07:33 +02:00
|
|
|
{
|
|
|
|
plugin = neodev-nvim;
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/neodev-nvim.lua;
|
2023-08-12 08:07:33 +02:00
|
|
|
}
|
2023-08-12 16:46:45 +02:00
|
|
|
{
|
|
|
|
plugin = inc-rename-nvim;
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = {
|
|
|
|
input_buffer_type = "dressing";
|
|
|
|
};
|
2023-08-12 16:46:45 +02:00
|
|
|
dependencies = [
|
2023-09-10 13:30:29 +02:00
|
|
|
{ plugin = dressing-nvim; }
|
2023-08-12 16:46:45 +02:00
|
|
|
];
|
|
|
|
}
|
2024-02-12 10:10:32 +01:00
|
|
|
{
|
|
|
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
|
|
|
pname = "actions-preview-nvim";
|
|
|
|
version = lib.my.mkVersionInput inputs.actions-preview-nvim;
|
|
|
|
src = inputs.actions-preview-nvim;
|
|
|
|
};
|
|
|
|
}
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vim-fugitive;
|
2023-09-07 08:02:32 +02:00
|
|
|
cmd = [
|
|
|
|
"G"
|
|
|
|
"Git"
|
|
|
|
"Ggrep"
|
|
|
|
"Glgrep"
|
|
|
|
"Gclog"
|
|
|
|
"Gllog"
|
|
|
|
"Gcd"
|
|
|
|
"Glcd"
|
|
|
|
"Gedit"
|
|
|
|
"Gsplit"
|
|
|
|
"Gvsplit"
|
|
|
|
"Gtabedit"
|
|
|
|
"Gpedit"
|
|
|
|
"Gdrop"
|
|
|
|
"Gread"
|
|
|
|
"Gwrite"
|
|
|
|
"Gwq"
|
|
|
|
"Gdiffsplit"
|
|
|
|
"Gvdiffsplit"
|
|
|
|
"GMove"
|
|
|
|
"GRename"
|
|
|
|
"GDelete"
|
|
|
|
"GBrowse"
|
|
|
|
];
|
2023-06-10 21:52:57 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = vim-tmux-navigator;
|
2023-06-28 09:15:48 +02:00
|
|
|
event = [ "VeryLazy" ];
|
2023-06-10 21:52:57 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-lastplace;
|
|
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = {
|
|
|
|
lastplace_ignore_buftype = [ "quickfix" "nofile" "help" ];
|
|
|
|
lastplace_ignore_filetype = [ "gitcommit" "gitrebase" "svn" "hgcommit" ];
|
|
|
|
lastplace_open_folds = true;
|
|
|
|
};
|
2023-06-10 21:52:57 +02:00
|
|
|
}
|
|
|
|
{
|
2023-07-15 12:45:11 +02:00
|
|
|
plugin = telescope-nvim;
|
2023-06-23 08:34:00 +02:00
|
|
|
cmd = [ "Telescope" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = builtins.readFile ./lua/telescope.lua;
|
2023-06-10 21:52:57 +02:00
|
|
|
keys = [
|
|
|
|
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
|
|
|
|
{ key = "<leader>fb"; cmd = "<cmd>Telescope buffers<cr>"; desc = "Find buffers"; }
|
2023-09-10 13:30:29 +02:00
|
|
|
{ key = "<leader>fl"; cmd = "<cmd>Telescope current_buffer_fuzzy_find<cr>"; desc = "Search lines"; }
|
2024-01-11 09:25:31 +01:00
|
|
|
{
|
|
|
|
key = "<leader>fl";
|
|
|
|
cmd = "y<ESC>:Telescope current_buffer_fuzzy_find default_text=<c-r>0<CR>";
|
|
|
|
desc = "Search lines (selection)";
|
|
|
|
mode = [ "v" ];
|
|
|
|
}
|
2023-09-10 13:30:29 +02:00
|
|
|
{ key = "<leader>fg"; cmd = "<cmd>Telescope live_grep<cr>"; desc = "Live grep"; }
|
2024-01-11 09:25:31 +01:00
|
|
|
{
|
|
|
|
key = "<leader>fg";
|
|
|
|
cmd = "y<ESC>:Telescope live_grep default_text=<c-r>0<CR>";
|
|
|
|
desc = "Live grep (selection)";
|
|
|
|
mode = [ "v" ];
|
|
|
|
}
|
2023-09-10 13:30:29 +02:00
|
|
|
{ key = "<leader>fh"; cmd = "<cmd>Telescope help_tags<cr>"; desc = "Help tags"; }
|
2024-01-11 09:25:31 +01:00
|
|
|
{ key = "<leader>fr"; cmd = "<cmd>Telescope oldfiles<cr>"; desc = "Recent files"; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
dependencies = [
|
2023-07-15 12:45:11 +02:00
|
|
|
{ plugin = plenary-nvim; }
|
2023-07-25 16:00:51 +02:00
|
|
|
{ plugin = telescope-fzf-native-nvim; }
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|
2023-06-11 10:22:19 +02:00
|
|
|
{
|
|
|
|
plugin = vim-startuptime;
|
|
|
|
cmd = [ "StartupTime" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
conf = readFile ./lua/vim-startuptime.lua;
|
2023-06-11 10:22:19 +02:00
|
|
|
}
|
2023-06-25 11:15:08 +02:00
|
|
|
{
|
|
|
|
plugin = typst-vim;
|
|
|
|
ft = [ "typst" "typ" ];
|
|
|
|
}
|
2023-06-23 08:34:00 +02:00
|
|
|
{
|
|
|
|
plugin = comment-nvim;
|
|
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = { };
|
2023-06-23 08:34:00 +02:00
|
|
|
}
|
2023-07-25 16:15:18 +02:00
|
|
|
{
|
|
|
|
plugin = nvim-surround;
|
|
|
|
event = [ "BufReadPost" "BufNewFile" ];
|
2023-09-10 13:30:29 +02:00
|
|
|
opts = { };
|
2023-08-11 18:59:52 +02:00
|
|
|
}
|
2023-08-16 16:42:26 +02:00
|
|
|
{
|
|
|
|
plugin = zen-mode-nvim;
|
|
|
|
keys = [
|
|
|
|
{ key = "<leader>tz"; cmd = "<cmd>ZenMode<cr>"; desc = "Zen mode"; }
|
|
|
|
];
|
2023-09-07 09:09:12 +02:00
|
|
|
conf = /* lua */ ''
|
|
|
|
require("zen-mode").setup({
|
|
|
|
plugins = {
|
|
|
|
tmux = {
|
|
|
|
enabled = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
'';
|
2023-08-16 16:42:26 +02:00
|
|
|
dependencies = [
|
2023-09-07 09:09:12 +02:00
|
|
|
{
|
|
|
|
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",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
'';
|
|
|
|
}
|
2023-08-16 16:42:26 +02:00
|
|
|
];
|
|
|
|
}
|
2023-11-03 13:48:47 +01:00
|
|
|
{
|
|
|
|
plugin = conform-nvim;
|
|
|
|
keys = [
|
|
|
|
{ key = "="; cmd = "<cmd>lua require('conform').format()<cr>"; desc = "format buffer"; mode = [ "n" "v" ]; }
|
|
|
|
];
|
|
|
|
cmd = [ "ConformInfo" "Format" ];
|
|
|
|
conf = readFile ./lua/conform.lua;
|
|
|
|
}
|
2023-06-10 21:52:57 +02:00
|
|
|
];
|
|
|
|
}
|