Refactore nvim config
This commit is contained in:
@@ -1,87 +1,96 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.dot.nvim;
|
||||
in
|
||||
{
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-repeat
|
||||
vim-surround
|
||||
ts-comments-nvim
|
||||
vim-fugitive
|
||||
gitsigns-nvim
|
||||
nvim-tree-lua
|
||||
targets-vim
|
||||
mini-pairs
|
||||
mini-align
|
||||
mini-bracketed
|
||||
mini-splitjoin
|
||||
mini-move
|
||||
mini-ai
|
||||
mini-icons
|
||||
flash-nvim
|
||||
trouble-nvim
|
||||
conform-nvim
|
||||
nvim-lint
|
||||
promise-async
|
||||
nvim-ufo
|
||||
vim-windowswap
|
||||
plenary-nvim
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
yanky-nvim
|
||||
lualine-nvim
|
||||
undotree
|
||||
luasnip
|
||||
nvim-cmp
|
||||
cmp_luasnip
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
cmp-cmdline
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp_yanky
|
||||
cmp-git
|
||||
nvim-lspconfig
|
||||
lspkind-nvim
|
||||
copilot-lua
|
||||
copilot-cmp
|
||||
CopilotChat-nvim
|
||||
bullets-vim
|
||||
nvim-dap
|
||||
nvim-nio
|
||||
nvim-dap-ui
|
||||
nvim-dap-virtual-text
|
||||
nvim-dap-go
|
||||
nvim-dap-python
|
||||
nvim-dap-lldb
|
||||
todo-comments-nvim
|
||||
vim-markdown
|
||||
zen-mode-nvim
|
||||
plantuml-syntax
|
||||
obsidian-nvim
|
||||
render-markdown-nvim
|
||||
image-nvim
|
||||
img-clip-nvim
|
||||
vim-nix
|
||||
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
|
||||
];
|
||||
|
||||
# Use extraLuaConfig for home-manager 25.11 compatibility
|
||||
# (initLua was renamed from extraLuaConfig in later versions)
|
||||
extraLuaConfig = builtins.concatStringsSep "\n" [
|
||||
(lib.strings.fileContents ../../../nvim/base.lua)
|
||||
(lib.strings.fileContents ../../../nvim/keymaps.lua)
|
||||
(lib.strings.fileContents ../../../nvim/plugins.lua)
|
||||
(lib.strings.fileContents ../../../nvim/filetype.lua)
|
||||
];
|
||||
options.dot.nvim = {
|
||||
workMode = lib.mkEnableOption "work-specific neovim configuration";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
nodejs-slim
|
||||
];
|
||||
config = {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-repeat
|
||||
vim-surround
|
||||
ts-comments-nvim
|
||||
vim-fugitive
|
||||
gitsigns-nvim
|
||||
nvim-tree-lua
|
||||
targets-vim
|
||||
mini-pairs
|
||||
mini-align
|
||||
mini-bracketed
|
||||
mini-splitjoin
|
||||
mini-move
|
||||
mini-ai
|
||||
mini-icons
|
||||
flash-nvim
|
||||
trouble-nvim
|
||||
conform-nvim
|
||||
nvim-lint
|
||||
promise-async
|
||||
nvim-ufo
|
||||
vim-windowswap
|
||||
plenary-nvim
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
yanky-nvim
|
||||
lualine-nvim
|
||||
undotree
|
||||
luasnip
|
||||
nvim-cmp
|
||||
cmp_luasnip
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
cmp-cmdline
|
||||
cmp-nvim-lsp
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp_yanky
|
||||
cmp-git
|
||||
nvim-lspconfig
|
||||
lspkind-nvim
|
||||
copilot-lua
|
||||
copilot-cmp
|
||||
CopilotChat-nvim
|
||||
bullets-vim
|
||||
nvim-dap
|
||||
nvim-nio
|
||||
nvim-dap-ui
|
||||
nvim-dap-virtual-text
|
||||
nvim-dap-go
|
||||
nvim-dap-python
|
||||
nvim-dap-lldb
|
||||
todo-comments-nvim
|
||||
vim-markdown
|
||||
zen-mode-nvim
|
||||
plantuml-syntax
|
||||
obsidian-nvim
|
||||
render-markdown-nvim
|
||||
image-nvim
|
||||
img-clip-nvim
|
||||
vim-nix
|
||||
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
|
||||
];
|
||||
|
||||
extraLuaConfig = ''
|
||||
_G.is_work = ${if cfg.workMode then "true" else "false"}
|
||||
_G.is_mac = ${if pkgs.stdenv.isDarwin then "true" else "false"}
|
||||
'';
|
||||
};
|
||||
|
||||
# Symlink the nvim directory to ~/.config/nvim
|
||||
# This allows for editing the config without a nix rebuild
|
||||
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/dot/nvim";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
nodejs-slim
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user