Compare commits
5 commits
34ed24d470
...
8e3d0c90a8
Author | SHA1 | Date | |
---|---|---|---|
chayleaf | 8e3d0c90a8 | ||
chayleaf | a7c43047b3 | ||
chayleaf | 5575582b6d | ||
chayleaf | 4361c9e694 | ||
chayleaf | 7e111b4021 |
|
@ -17,7 +17,7 @@
|
||||||
enableSshSupport = true;
|
enableSshSupport = true;
|
||||||
maxCacheTtl = 72000;
|
maxCacheTtl = 72000;
|
||||||
maxCacheTtlSsh = 72000;
|
maxCacheTtlSsh = 72000;
|
||||||
pinentryPackage = pkgs.pinentry.tty;
|
pinentryPackage = if config.minimal then pkgs.pinentry.tty else pkgs.pinentry.qt;
|
||||||
};
|
};
|
||||||
home.shellAliases = {
|
home.shellAliases = {
|
||||||
s = "sudo -A";
|
s = "sudo -A";
|
||||||
|
|
|
@ -73,9 +73,11 @@
|
||||||
luasnip = REQ "luasnip";
|
luasnip = REQ "luasnip";
|
||||||
|
|
||||||
plugins = let ps = pkgs.vimPlugins; in [
|
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
|
# 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 {
|
{ plugin = pkgs.vimUtils.buildVimPlugin {
|
||||||
pname = "vscode-nvim";
|
pname = "vscode-nvim";
|
||||||
version = "2023-02-10";
|
version = "2023-02-10";
|
||||||
|
@ -109,14 +111,12 @@
|
||||||
bg = "NONE";
|
bg = "NONE";
|
||||||
})
|
})
|
||||||
]; }
|
]; }
|
||||||
{ plugin = ps.nvim-web-devicons;
|
{ settings.plugins.web-devicons.enable = true; }
|
||||||
config = ((REQ "nvim-web-devicons").setup { }); }
|
{ settings.plugins.nvim-tree.enable = true;
|
||||||
{ plugin = ps.nvim-tree-lua;
|
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: [
|
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 {
|
(kmSetNs {
|
||||||
"<C-N>" = {
|
"<C-N>" = {
|
||||||
rhs = nvim-tree-api.tree.toggle;
|
rhs = nvim-tree-api.tree.toggle;
|
||||||
|
@ -124,9 +124,10 @@
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
])); }
|
])); }
|
||||||
ps.vim-sleuth
|
{ settings.plugins.sleuth.enable = true; }
|
||||||
ps.luasnip
|
{ settings.plugins.luasnip.enable = true; }
|
||||||
{ plugin = ps.nvim-cmp;
|
{ plugin = ps.nvim-cmp;
|
||||||
|
settings.plugins.cmp.enable = false;
|
||||||
config = let
|
config = let
|
||||||
border = (name: [
|
border = (name: [
|
||||||
[ "╭" name ]
|
[ "╭" name ]
|
||||||
|
@ -197,13 +198,15 @@
|
||||||
sources = cmp.config.sources [
|
sources = cmp.config.sources [
|
||||||
{ name = "nvim_lsp"; }
|
{ name = "nvim_lsp"; }
|
||||||
{ name = "luasnip"; }
|
{ name = "luasnip"; }
|
||||||
|
{ name = "neorg"; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
)); }
|
)); }
|
||||||
ps.lspkind-nvim
|
{ settings.plugins.lspkind.enable = true; }
|
||||||
ps.cmp_luasnip
|
{ settings.plugins.cmp_luasnip.enable = true; }
|
||||||
ps.cmp-nvim-lsp
|
{ settings.plugins.cmp-nvim-lsp.enable = true; }
|
||||||
{ plugin = ps.nvim-autopairs;
|
{ plugin = ps.nvim-autopairs;
|
||||||
|
settings.plugins.nvim-autopairs.enable = false;
|
||||||
config = (LET
|
config = (LET
|
||||||
(REQ "cmp") (REQ "nvim-autopairs.completion.cmp") (REQ "nvim-autopairs")
|
(REQ "cmp") (REQ "nvim-autopairs.completion.cmp") (REQ "nvim-autopairs")
|
||||||
(cmp: cmp-autopairs: nvim-autopairs:
|
(cmp: cmp-autopairs: nvim-autopairs:
|
||||||
|
@ -213,9 +216,9 @@
|
||||||
})
|
})
|
||||||
(cmp.event.on cmp.event "confirm_done" (cmp-autopairs.on_confirm_done { }))
|
(cmp.event.on cmp.event "confirm_done" (cmp-autopairs.on_confirm_done { }))
|
||||||
])); }
|
])); }
|
||||||
{ plugin = ps.comment-nvim;
|
{ settings.plugins.comment.enable = true;
|
||||||
config = [
|
config = [
|
||||||
((REQ "Comment").setup { })
|
# ((REQ "Comment").setup { })
|
||||||
(kmSetNs {
|
(kmSetNs {
|
||||||
"<space>/" = {
|
"<space>/" = {
|
||||||
# metatables......
|
# metatables......
|
||||||
|
@ -231,6 +234,7 @@
|
||||||
})
|
})
|
||||||
]; }
|
]; }
|
||||||
{ plugin = ps.nvim-lspconfig;
|
{ plugin = ps.nvim-lspconfig;
|
||||||
|
settings.plugins.lsp.enable = false;
|
||||||
config = (
|
config = (
|
||||||
let lsp = name: builtins.seq
|
let lsp = name: builtins.seq
|
||||||
# ensure an lsp exists (otherwise lspconfig will still create an empty config for some reason)
|
# ensure an lsp exists (otherwise lspconfig will still create an empty config for some reason)
|
||||||
|
@ -374,14 +378,70 @@
|
||||||
]) # END
|
]) # END
|
||||||
)) # END
|
)) # END
|
||||||
]); }
|
]); }
|
||||||
{ plugin = ps.which-key-nvim;
|
{ settings.plugins.which-key.enable = true;
|
||||||
config = [
|
settings.globalOpts.timeout = true;
|
||||||
(SET vim.o.timeout true)
|
settings.globalOpts.timeoutlen = 500; }
|
||||||
(SET vim.o.timeoutlen 500)
|
{ settings.plugins.treesitter = {
|
||||||
(which-key.setup { })
|
enable = true;
|
||||||
]; }
|
grammarPackages = with pkgs.tree-sitter-grammars; [
|
||||||
|
tree-sitter-norg
|
||||||
|
tree-sitter-norg-meta
|
||||||
];
|
];
|
||||||
in {
|
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 lib.mkMerge ((builtins.concatLists (map (x: lib.toList (x.settings or [ ])) plugins)) ++ lib.toList {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultEditor = true;
|
defaultEditor = true;
|
||||||
package = pkgs.neovim-unwrapped;
|
package = pkgs.neovim-unwrapped;
|
||||||
|
@ -413,7 +473,7 @@
|
||||||
vimdiffAlias = true;
|
vimdiffAlias = true;
|
||||||
|
|
||||||
extraConfigLua = compile "main" (
|
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 {
|
(kmSetNs {
|
||||||
"<C-X>" = {
|
"<C-X>" = {
|
||||||
rhs = DEFUN (vim.fn.system [ "chmod" "+x" (vim.fn.expand "%") ]);
|
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);
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue