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;
# TODO: enable in next release
# numbertoggle.enable = true;
# successfor to ctrlp and fzf
telescope.enable = true;
todo-comments.enable = true;
toggleterm.enable = true;
treesitter = {
enable = true;
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
bash
json
lua
make
markdown
nix
regex
toml
vim
vimdoc
xml
yaml
];
};
treesitter-context.enable = true;
treesitter-refactor.enable = true;
# This plugin trims trailing whitespace and lines.
trim.enable = true;
};
# plugins = with pkgs;
# [
# # yaml-folds
# { # {
# plugin = vimUtils.buildVimPlugin { # plugin = vimUtils.buildVimPlugin {
# name = "vim-markdown-toc"; # name = "vim-yaml-folds";
# src = fetchFromGitHub { # src = fetchFromGitHub {
# owner = "mzlogin"; # owner = "pedrohdz";
# repo = "vim-markdown-toc"; # repo = "vim-yaml-folds";
# rev = "b7bb6c37033d3a6c93906af48dc0e689bd948638"; # rev = "890ccd8e5370808d569e96dbb06cbeca2cf5993a";
# sha256 = "026xf2gid4qivwawh7if3nfk7zja9di0flhdzdx82lvil9x48lyz"; # sha256 = "018z6xcwrq58q6lj6gwhrifjaxkmrlkkg0n86s6mjjlwkbs2qa4m";
# };
# buildInputs = [zip vim];
# };
# }
# {
# plugin = vimUtils.buildVimPlugin {
# name = "vim-yaml";
# src = fetchFromGitHub {
# owner = "stephpy";
# repo = "vim-yaml";
# rev = "e97e063b16eba4e593d620676a0a15fa98613979";
# sha256 = "0vqahbrnr43lxanpziyrmzaqqb3cmyny8ry1xvmy2xyd1larzfrk";
# }; # };
# }; # };
# } # }
# broken 2021-06-08
# { # {
# plugin = vimUtils.buildVimPlugin { # plugin = vimUtils.buildVimPlugin {
# name = "vim-perl"; # name = "git-blame";
# src = fetchFromGitHub { # src = fetchFromGitHub {
# owner = "vim-perl"; # "owner" = "zivyangll";
# repo = "vim-perl"; # "repo" = "git-blame.vim";
# rev = "f330b5d474c44e6cfae22ba50868093dea3e9adb"; # "rev" = "9d144b7bed5d8f1c9259551768b7f3b3d1294917";
# sha256 = "1dy40ixgixj0536c5ggra51b4yd1lbw4j6l0j5zc3diasb7m2gvr"; # "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
plugin = vimUtils.buildVimPlugin { # ncm2-bufword
name = "git-blame"; # ncm2-path
src = fetchFromGitHub { # ncm2-tmux
"owner" = "zivyangll"; # ncm2-ultisnips
"repo" = "git-blame.vim"; # nvim-yarp
"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 # LanguageClient-neovim
ncm2-bufword
ncm2-path
ncm2-tmux
ncm2-ultisnips
nvim-yarp
LanguageClient-neovim # Improved-AnsiEsc
# tabular
Improved-AnsiEsc # # Nix
tabular # vim-addon-nix
# tlib
# vim-addon-vim2nix
# Nix # # LaTeX
vim-addon-nix # vim-latex-live-preview
tlib # vimtex
vim-addon-vim2nix
# LaTeX # # YAML
vim-latex-live-preview # vim-yaml
vimtex
# YAML # # markdown
vim-yaml # vim-markdown
# vim-markdown-toc
# markdown # # misc syntax support
vim-markdown # vim-bazel
vim-markdown-toc # maktaba
# ]);
# misc syntax support
vim-bazel
maktaba
]);
}; };
} }