Compare commits
No commits in common. "29cfce111171c7b0dda6557f5f2238a9ac1879db" and "21bba2e8fd8012061f43a629a2b2585cc6a8944a" have entirely different histories.
29cfce1111
...
21bba2e8fd
6 changed files with 94 additions and 65 deletions
|
@ -26,8 +26,6 @@ in
|
|||
config.nix = {
|
||||
package = pkgs.nix-super;
|
||||
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
|
||||
gc = {
|
||||
automatic = cfg.gc.enable;
|
||||
options = "--max-freed ${cfg.gc.minimumFreedGB} --delete-older-than 14d";
|
||||
|
|
|
@ -9,10 +9,7 @@ let
|
|||
cfg = config.my.programs.nvim;
|
||||
boolToString = bool: if bool then "true" else "false";
|
||||
quote = str: ''"${toString str}"'';
|
||||
id = x: x;
|
||||
listToString = sep: f: list: ''{ ${concatStringsSep sep (map f list)} }'';
|
||||
listToStringOneLine = listToString ", ";
|
||||
listToStringMultiLine = listToString ",\n";
|
||||
listToString = list: ''{ ${concatStringsSep ", " (map quote list)} }'';
|
||||
keybinding =
|
||||
{ key
|
||||
, cmd
|
||||
|
@ -45,23 +42,31 @@ let
|
|||
, priority
|
||||
, keys
|
||||
}:
|
||||
listToStringMultiLine id
|
||||
([
|
||||
"dir = ${quote plugin}"
|
||||
"name = ${quote plugin.name}"
|
||||
"lazy = ${boolToString lazy}"
|
||||
]
|
||||
++ (optional (!enabled) "enabled = ${boolToString enabled}")
|
||||
++ (optional (dependencies != [ ]) "dependencies = ${listToStringMultiLine id (map lazySpecFromPlugin dependencies)}")
|
||||
++ (optional (init != null) "init = function(plugin)\n${toString init}\nend")
|
||||
++ (optional (conf != null) "config = function(plugin, opts)\n${toString conf}\nend")
|
||||
++ (optional (keys != [ ]) "keys = ${listToStringMultiLine id (map keybinding keys)}")
|
||||
++ (optional (event != [ ]) "event = ${listToStringOneLine quote event}")
|
||||
++ (optional (cmd != [ ]) "cmd = ${listToStringOneLine quote cmd}")
|
||||
++ (optional (ft != [ ]) "ft = ${listToStringOneLine quote ft}")
|
||||
++ (optional (priority != 50) "priority = ${toString priority}")
|
||||
);
|
||||
lazySpecs = listToStringMultiLine id (map lazySpecFromPlugin cfg.plugins);
|
||||
''
|
||||
{
|
||||
dir = "${plugin}",
|
||||
name = "${plugin.name}",
|
||||
lazy = ${boolToString lazy},
|
||||
enabled = ${boolToString enabled},
|
||||
dependencies = { ${concatStringsSep ", " (map lazySpecFromPlugin dependencies)} },
|
||||
${optionalString (init != null)
|
||||
"init = function(plugin)
|
||||
${toString init}
|
||||
end,"
|
||||
}
|
||||
${optionalString (conf != null)
|
||||
"config = function(plugin, opts)
|
||||
${toString conf}
|
||||
end,"
|
||||
}
|
||||
keys = { ${concatStringsSep ",\n" (map keybinding keys)} },
|
||||
event = ${listToString event},
|
||||
cmd = ${listToString cmd},
|
||||
ft = ${listToString ft},
|
||||
priority = ${toString priority},
|
||||
}
|
||||
'';
|
||||
lazySpecs = concatStringsSep ", " (map lazySpecFromPlugin cfg.plugins);
|
||||
lazy = ''
|
||||
require("lazy").setup({
|
||||
${lazySpecs}
|
||||
|
@ -112,7 +117,7 @@ in
|
|||
};
|
||||
lazy = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to load the plugin lazily.
|
||||
'';
|
||||
|
|
|
@ -5,46 +5,42 @@ 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;
|
||||
lazy = true;
|
||||
keys = [
|
||||
{ key = "="; cmd = "<cmd>Format<cr>"; desc = "format (formatter)"; }
|
||||
];
|
||||
conf = readFile ./formatter-nvim.lua;
|
||||
dependencies = [{ plugin = which-key-nvim; }];
|
||||
dependencies = [{ plugin = which-key-nvim; lazy = true; }];
|
||||
}
|
||||
{
|
||||
plugin = oil-nvim;
|
||||
lazy = false;
|
||||
conf = readFile ./oil-nvim.lua;
|
||||
dependencies = [
|
||||
{ plugin = which-key-nvim; }
|
||||
{ plugin = nvim-web-devicons; }
|
||||
{ plugin = which-key-nvim; lazy = true; }
|
||||
{ plugin = nvim-web-devicons; lazy = true; }
|
||||
];
|
||||
}
|
||||
{ plugin = nvim-ts-context-commentstring; }
|
||||
{
|
||||
plugin = mini-nvim;
|
||||
lazy = false;
|
||||
conf = readFile ./mini-nvim.lua;
|
||||
}
|
||||
{
|
||||
plugin = noice-nvim;
|
||||
lazy = false;
|
||||
conf = readFile ./noice-nvim.lua;
|
||||
dependencies = [{ plugin = nui-nvim; }];
|
||||
dependencies = [{ plugin = nui-nvim; lazy = true; }];
|
||||
}
|
||||
{
|
||||
plugin = trouble-nvim;
|
||||
lazy = true;
|
||||
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)"; }
|
||||
|
@ -79,12 +75,13 @@ with builtins;
|
|||
conf = readFile ./trouble-nvim.lua;
|
||||
dependencies = [
|
||||
{ plugin = which-key-nvim; }
|
||||
{ plugin = nvim-web-devicons; }
|
||||
{ plugin = nvim-web-devicons; lazy = true; }
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
conf = readFile ./nvim-cmp.lua;
|
||||
lazy = true;
|
||||
event = [ "InsertEnter" ];
|
||||
dependencies = [
|
||||
{ plugin = cmp-async-path; }
|
||||
|
@ -101,94 +98,131 @@ with builtins;
|
|||
];
|
||||
}
|
||||
{ plugin = friendly-snippets; }
|
||||
{ plugin = luasnip; }
|
||||
{ plugin = luasnip; lazy = true; }
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = todo-comments-nvim;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./todo-comments-nvim.lua;
|
||||
dependencies = [{ plugin = plenary-nvim; }];
|
||||
dependencies = [{ plugin = plenary-nvim; lazy = true; }];
|
||||
}
|
||||
{
|
||||
plugin = direnv-vim;
|
||||
lazy = false;
|
||||
}
|
||||
{
|
||||
plugin = nvim-treesitter.withAllGrammars;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./nvim-treesitter.lua;
|
||||
dependencies = [
|
||||
{ plugin = nvim-ts-context-commentstring; }
|
||||
{
|
||||
plugin = orgmode;
|
||||
lazy = true;
|
||||
conf = readFile ./orgmode.lua;
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
lazy = true;
|
||||
event = [ "BufReadPre" "BufNewFile" ];
|
||||
conf = readFile ./nvim-lspconfig.lua;
|
||||
dependencies = [
|
||||
{
|
||||
plugin = null-ls-nvim;
|
||||
lazy = true;
|
||||
conf = readFile ./null-ls-nvim.lua;
|
||||
dependencies = [
|
||||
{ plugin = which-key-nvim; }
|
||||
{ plugin = plenary-nvim; }
|
||||
{ plugin = which-key-nvim; lazy = true; }
|
||||
{ plugin = plenary-nvim; lazy = true; }
|
||||
];
|
||||
}
|
||||
{ plugin = which-key-nvim; }
|
||||
{ plugin = lspkind-nvim; }
|
||||
{ plugin = lsp_lines-nvim; }
|
||||
{
|
||||
plugin = which-key-nvim;
|
||||
lazy = true;
|
||||
}
|
||||
{
|
||||
plugin = lspkind-nvim;
|
||||
lazy = true;
|
||||
}
|
||||
{
|
||||
plugin = lsp_lines-nvim;
|
||||
lazy = true;
|
||||
}
|
||||
{
|
||||
plugin = lspsaga-nvim-original;
|
||||
lazy = true;
|
||||
dependencies = [
|
||||
{ plugin = nvim-web-devicons; }
|
||||
{ plugin = nvim-treesitter.withAllGrammars; }
|
||||
{ plugin = nvim-web-devicons; lazy = true; }
|
||||
{ plugin = nvim-treesitter.withAllGrammars; lazy = true; }
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = nvim-ufo;
|
||||
lazy = true;
|
||||
dependencies = [
|
||||
{ plugin = promise-async; }
|
||||
{ plugin = promise-async; lazy = true; }
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
event = [ "VeryLazy" ];
|
||||
lazy = true;
|
||||
plugin = vim-fugitive;
|
||||
}
|
||||
{
|
||||
plugin = vim-tmux-navigator;
|
||||
lazy = false;
|
||||
}
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./gitsigns-nvim.lua;
|
||||
dependencies = [{ plugin = which-key-nvim; }];
|
||||
}
|
||||
{
|
||||
plugin = nvim-lastplace;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./nvim-lastplace.lua;
|
||||
}
|
||||
{
|
||||
plugin = nvim-treesitter-textsubjects;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./nvim-treesitter-textsubjects.lua;
|
||||
dependencies = [
|
||||
{
|
||||
plugin = nvim-treesitter.withAllGrammars;
|
||||
lazy = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = nvim-ts-context-commentstring;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./nvim-ts-context-commentstring.lua;
|
||||
dependencies = [
|
||||
{
|
||||
plugin = nvim-treesitter.withAllGrammars;
|
||||
lazy = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = smartcolumn-nvim;
|
||||
lazy = true;
|
||||
event = [ "BufReadPost" "BufNewFile" ];
|
||||
conf = readFile ./smartcolumn-nvim.lua;
|
||||
}
|
||||
{
|
||||
plugin = telescope-fzf-native-nvim;
|
||||
conf = readFile ./telescope-fzf-native-nvim.lua;
|
||||
lazy = true;
|
||||
keys = [
|
||||
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
|
||||
{ key = "<leader>fb"; cmd = "<cmd>Telescope buffers<cr>"; desc = "Find buffers"; }
|
||||
|
@ -208,17 +242,13 @@ with builtins;
|
|||
dependencies = [
|
||||
{
|
||||
plugin = telescope-nvim;
|
||||
lazy = true;
|
||||
dependencies = [
|
||||
{ plugin = plenary-nvim; }
|
||||
{ plugin = which-key-nvim; }
|
||||
{ plugin = plenary-nvim; lazy = true; }
|
||||
{ plugin = which-key-nvim; lazy = true; }
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
plugin = vim-startuptime;
|
||||
cmd = [ "StartupTime" ];
|
||||
conf = readFile ./vim-startuptime.lua;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
require("mini.align").setup()
|
||||
require("mini.comment").setup({
|
||||
options = {
|
||||
custom_commentstring = function()
|
||||
return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring
|
||||
end,
|
||||
},
|
||||
})
|
||||
require("mini.comment").setup()
|
||||
require("mini.surround").setup()
|
||||
require("mini.move").setup()
|
||||
require("mini.pairs").setup()
|
||||
|
|
|
@ -9,7 +9,4 @@ require("nvim-treesitter.configs").setup({
|
|||
-- code block highlights that do not have ts grammar
|
||||
additional_vim_regex_highlighting = { "org" },
|
||||
},
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
Loading…
Reference in a new issue