Compare commits

...

5 commits

2 changed files with 87 additions and 27 deletions

View file

@ -17,7 +17,7 @@
enableSshSupport = true;
maxCacheTtl = 72000;
maxCacheTtlSsh = 72000;
pinentryPackage = pkgs.pinentry.tty;
pinentryPackage = if config.minimal then pkgs.pinentry.tty else pkgs.pinentry.qt;
};
home.shellAliases = {
s = "sudo -A";

View file

@ -73,9 +73,11 @@
luasnip = REQ "luasnip";
plugins = let ps = pkgs.vimPlugins; in [
ps.vim-svelte
{ plugin = ps.vim-svelte; }
# vim-nix isn't necessary for syntax highlighting, but it improves overall editing experience
ps.vim-nix
{ plugin = ps.vim-nix; }
# the latest version of vscode-nvim has breaking changes and i'm too lazy to migrate
# FIXME: migrate
{ plugin = pkgs.vimUtils.buildVimPlugin {
pname = "vscode-nvim";
version = "2023-02-10";
@ -109,14 +111,12 @@
bg = "NONE";
})
]; }
{ plugin = ps.nvim-web-devicons;
config = ((REQ "nvim-web-devicons").setup { }); }
{ plugin = ps.nvim-tree-lua;
{ settings.plugins.web-devicons.enable = true; }
{ settings.plugins.nvim-tree.enable = true;
settings.globalOpts.termguicolors = true;
settings.globals.loaded_netrw = 1;
settings.globals.loaded_netrwPlugin = 1;
config = (LET (REQ "nvim-tree") (REQ "nvim-tree.api") (nvim-tree: nvim-tree-api: [
(SET (vimg "loaded_netrw") 1)
(SET (vimg "loaded_netrwPlugin") 1)
(SET vim.o.termguicolors true)
(nvim-tree.setup { }) # :help nvim-tree-setup
(kmSetNs {
"<C-N>" = {
rhs = nvim-tree-api.tree.toggle;
@ -124,9 +124,10 @@
};
})
])); }
ps.vim-sleuth
ps.luasnip
{ settings.plugins.sleuth.enable = true; }
{ settings.plugins.luasnip.enable = true; }
{ plugin = ps.nvim-cmp;
settings.plugins.cmp.enable = false;
config = let
border = (name: [
[ "" name ]
@ -197,13 +198,15 @@
sources = cmp.config.sources [
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{ name = "neorg"; }
];
}
)); }
ps.lspkind-nvim
ps.cmp_luasnip
ps.cmp-nvim-lsp
{ settings.plugins.lspkind.enable = true; }
{ settings.plugins.cmp_luasnip.enable = true; }
{ settings.plugins.cmp-nvim-lsp.enable = true; }
{ plugin = ps.nvim-autopairs;
settings.plugins.nvim-autopairs.enable = false;
config = (LET
(REQ "cmp") (REQ "nvim-autopairs.completion.cmp") (REQ "nvim-autopairs")
(cmp: cmp-autopairs: nvim-autopairs:
@ -213,9 +216,9 @@
})
(cmp.event.on cmp.event "confirm_done" (cmp-autopairs.on_confirm_done { }))
])); }
{ plugin = ps.comment-nvim;
{ settings.plugins.comment.enable = true;
config = [
((REQ "Comment").setup { })
# ((REQ "Comment").setup { })
(kmSetNs {
"<space>/" = {
# metatables......
@ -231,6 +234,7 @@
})
]; }
{ plugin = ps.nvim-lspconfig;
settings.plugins.lsp.enable = false;
config = (
let lsp = name: builtins.seq
# ensure an lsp exists (otherwise lspconfig will still create an empty config for some reason)
@ -374,14 +378,70 @@
]) # END
)) # END
]); }
{ plugin = ps.which-key-nvim;
config = [
(SET vim.o.timeout true)
(SET vim.o.timeoutlen 500)
(which-key.setup { })
]; }
{ settings.plugins.which-key.enable = true;
settings.globalOpts.timeout = true;
settings.globalOpts.timeoutlen = 500; }
{ settings.plugins.treesitter = {
enable = true;
grammarPackages = with pkgs.tree-sitter-grammars; [
tree-sitter-norg
tree-sitter-norg-meta
];
settings.highlight.enable = true;
}; }
{ settings.plugins.image = {
enable = true;
backend = "kitty";
integrations = {
markdown = {
enabled = true;
downloadRemoteImages = false;
};
neorg = {
enabled = true;
downloadRemoteImages = true;
};
};
}; }
{ settings.plugins.telescope.enable = true; }
{ plugin = ps.neorg;
# TODO: remove when bumping inputs https://github.com/nix-community/nixvim/issues/1395
settings.extraLuaPackages = (x: with x; [
lua-utils-nvim
pathlib-nvim
nvim-nio
]);
config = (REQ "neorg").setup {
load = {
"core.defaults" = { };
"core.completion".config = {
engine = "nvim-cmp";
};
"core.concealer" = { };
"core.dirman".config = {
workspaces.ws = "~/notes";
default_workspace = "ws";
};
"core.esupports.metagen".config = {
author = "chayleaf";
timezone = "utc";
type = "empty";
};
"core.integrations.nvim-cmp" = { };
"core.integrations.image" = { };
"core.integrations.treesitter".config = {
# install_parsers = false;
};
"core.journal".config = {
workspace = "ws";
};
"core.keybinds" = { };
"core.latex.renderer" = { };
};
}; }
{ plugin = ps.neorg-telescope; }
];
in {
in lib.mkMerge ((builtins.concatLists (map (x: lib.toList (x.settings or [ ])) plugins)) ++ lib.toList {
enable = true;
defaultEditor = true;
package = pkgs.neovim-unwrapped;
@ -413,7 +473,7 @@
vimdiffAlias = true;
extraConfigLua = compile "main" (
builtins.concatLists (map (x: if x?plugin then lib.toList x.config else [ ]) plugins) ++ [
builtins.concatLists (map (x: if x?plugin && x?config then lib.toList x.config else [ ]) plugins) ++ [
(kmSetNs {
"<C-X>" = {
rhs = DEFUN (vim.fn.system [ "chmod" "+x" (vim.fn.expand "%") ]);
@ -475,6 +535,6 @@
}
))
]);
extraPlugins = map (x: x.plugin or x) plugins;
};
extraPlugins = builtins.filter (x: x != null) (map (x: x.plugin or null) plugins);
});
}