nix/neovim: switch to using nixvim and partially migrate

This commit is contained in:
steveej 2024-11-11 21:46:26 +01:00
parent 0e1ddd4fd3
commit 70401e484a

View file

@ -1,131 +1,167 @@
{ {
repoFlake,
pkgs, pkgs,
lib, lib,
... ...
}: let }: {
in { imports = [
# FIXME: this doesn't work repoFlake.inputs.nixvim.homeManagerModules.nixvim
home.sessionVariables.EDITOR = "nvim"; ];
programs.neovim = { programs.nixvim = {
enable = true; enable = true;
defaultEditor = true;
vimdiffAlias = true;
vimAlias = true;
extraPython3Packages = ps: with ps; []; extraPython3Packages = ps: with ps; [];
extraConfig = builtins.readFile ./neovim/vimrc; # extraConfigVim = builtins.readFile ./neovim/vimrc;
plugins = with pkgs; clipboard = {
[ register = "unnamedplus";
# yaml-folds providers.wl-copy.enable = true;
{ };
plugin = vimUtils.buildVimPlugin {
name = "vim-yaml-folds";
src = fetchFromGitHub {
owner = "pedrohdz";
repo = "vim-yaml-folds";
rev = "890ccd8e5370808d569e96dbb06cbeca2cf5993a";
sha256 = "018z6xcwrq58q6lj6gwhrifjaxkmrlkkg0n86s6mjjlwkbs2qa4m";
};
buildInputs = [zip vim];
};
}
{ plugins = {
plugin = vimUtils.buildVimPlugin { airline = {
name = "vim-yaml"; enable = true;
src = fetchFromGitHub { settings = {
owner = "stephpy"; powerline_fonts = true;
repo = "vim-yaml"; skip_empty_sections = true;
rev = "e97e063b16eba4e593d620676a0a15fa98613979"; theme = "papercolor";
sha256 = "0vqahbrnr43lxanpziyrmzaqqb3cmyny8ry1xvmy2xyd1larzfrk"; };
}; };
}; fugitive.enable = true;
} gitblame.enable = true;
lsp = {
enable = true;
};
# broken 2021-06-08 nix.enable = true;
# {
# plugin = vimUtils.buildVimPlugin {
# name = "vim-markdown-toc";
# src = fetchFromGitHub {
# owner = "mzlogin";
# repo = "vim-markdown-toc";
# rev = "b7bb6c37033d3a6c93906af48dc0e689bd948638";
# sha256 = "026xf2gid4qivwawh7if3nfk7zja9di0flhdzdx82lvil9x48lyz";
# };
# };
# }
# broken 2021-06-08 # TODO: enable in next release
# { # numbertoggle.enable = true;
# plugin = vimUtils.buildVimPlugin {
# name = "vim-perl";
# src = fetchFromGitHub {
# owner = "vim-perl";
# repo = "vim-perl";
# rev = "f330b5d474c44e6cfae22ba50868093dea3e9adb";
# sha256 = "1dy40ixgixj0536c5ggra51b4yd1lbw4j6l0j5zc3diasb7m2gvr";
# };
# };
# }
{ # successfor to ctrlp and fzf
plugin = vimUtils.buildVimPlugin { telescope.enable = true;
name = "git-blame";
src = fetchFromGitHub {
"owner" = "zivyangll";
"repo" = "git-blame.vim";
"rev" = "9d144b7bed5d8f1c9259551768b7f3b3d1294917";
"sha256" = "06zb5xcc59k25rpwl46j82fcqckiznmj97v6i0mwlb8jhqqrhy9j";
};
};
}
]
++ (with pkgs.vimPlugins; [
delimitMate
vim-airline
vim-airline-themes
ctrlp
vim-css-color
rainbow_parentheses
vim-colorschemes
vim-colorstepper
vim-signify
fugitive
vim-indent-guides
UltiSnips
fzfWrapper
ncm2 todo-comments.enable = true;
ncm2-bufword
ncm2-path
ncm2-tmux
ncm2-ultisnips
nvim-yarp
LanguageClient-neovim toggleterm.enable = true;
Improved-AnsiEsc treesitter = {
tabular enable = true;
# Nix grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
vim-addon-nix bash
tlib json
vim-addon-vim2nix lua
make
markdown
nix
regex
toml
vim
vimdoc
xml
yaml
];
};
# LaTeX treesitter-context.enable = true;
vim-latex-live-preview treesitter-refactor.enable = true;
vimtex
# YAML # This plugin trims trailing whitespace and lines.
vim-yaml trim.enable = true;
};
# markdown # plugins = with pkgs;
vim-markdown # [
vim-markdown-toc # # yaml-folds
# {
# plugin = vimUtils.buildVimPlugin {
# name = "vim-yaml-folds";
# src = fetchFromGitHub {
# owner = "pedrohdz";
# repo = "vim-yaml-folds";
# rev = "890ccd8e5370808d569e96dbb06cbeca2cf5993a";
# sha256 = "018z6xcwrq58q6lj6gwhrifjaxkmrlkkg0n86s6mjjlwkbs2qa4m";
# };
# buildInputs = [zip vim];
# };
# }
# misc syntax support # {
vim-bazel # plugin = vimUtils.buildVimPlugin {
maktaba # name = "vim-yaml";
]); # src = fetchFromGitHub {
# owner = "stephpy";
# repo = "vim-yaml";
# rev = "e97e063b16eba4e593d620676a0a15fa98613979";
# sha256 = "0vqahbrnr43lxanpziyrmzaqqb3cmyny8ry1xvmy2xyd1larzfrk";
# };
# };
# }
# {
# plugin = vimUtils.buildVimPlugin {
# name = "git-blame";
# src = fetchFromGitHub {
# "owner" = "zivyangll";
# "repo" = "git-blame.vim";
# "rev" = "9d144b7bed5d8f1c9259551768b7f3b3d1294917";
# "sha256" = "06zb5xcc59k25rpwl46j82fcqckiznmj97v6i0mwlb8jhqqrhy9j";
# };
# };
# }
# ]
# ++ (with pkgs.vimPlugins; [
# delimitMate
# vim-airline
# vim-airline-themes
# ctrlp
# vim-css-color
# rainbow_parentheses
# vim-colorschemes
# vim-colorstepper
# vim-signify
# fugitive
# vim-indent-guides
# UltiSnips
# fzfWrapper
# ncm2
# ncm2-bufword
# ncm2-path
# ncm2-tmux
# ncm2-ultisnips
# nvim-yarp
# LanguageClient-neovim
# Improved-AnsiEsc
# tabular
# # Nix
# vim-addon-nix
# tlib
# vim-addon-vim2nix
# # LaTeX
# vim-latex-live-preview
# vimtex
# # YAML
# vim-yaml
# # markdown
# vim-markdown
# vim-markdown-toc
# # misc syntax support
# vim-bazel
# maktaba
# ]);
}; };
} }