dotfiles/nixos/vim/home.nix

117 lines
2.7 KiB
Nix
Raw Normal View History

2023-08-13 17:00:41 +01:00
{
config,
pkgs,
lib,
inputs,
system,
...
}: let
2023-03-05 10:13:10 +00:00
unstablePackages = inputs.nixpkgs-nixos-unstable.legacyPackages."${system}";
nil = inputs.nil.packages."${system}".default;
cocPackage = unstablePackages.vimPlugins.coc-nvim;
nvimPackage = unstablePackages.neovim-unwrapped;
in {
home.file.".vimrc".source = ../../.vimrc;
2023-08-13 17:00:41 +01:00
home.packages = with pkgs; [ripgrep];
home.sessionVariables = {
EDITOR = "vim";
VISUAL = "vim";
};
programs.zsh.sessionVariables = {
EDITOR = "vim";
VISUAL = "vim";
};
systemd.user.sessionVariables = {
EDITOR = "vim";
VISUAL = "vim";
};
2023-03-05 10:13:10 +00:00
programs.neovim = {
enable = true;
package = nvimPackage;
coc = {
enable = true;
package = cocPackage;
settings = {
"suggest.noselect" = false;
"suggest.enablePreselect" = true;
"suggest.fixInsertedWord" = true;
"suggest.removeDuplicateItems" = true;
"suggest.virtualText" = true;
languageserver = {
nix = {
command = "${nil}/bin/nil";
2023-08-13 17:00:41 +01:00
rootPatterns = ["flake.nix"];
filetypes = ["nix"];
2023-03-05 10:13:10 +00:00
};
};
};
};
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
plugins = with pkgs;
2023-08-13 17:00:41 +01:00
with pkgs.vimPlugins; [
2023-11-30 21:22:10 +00:00
(vimUtils.buildVimPlugin rec {
2023-08-13 17:00:41 +01:00
pname = "vim-tada";
version = "2022-04-22";
src = fetchFromGitHub {
owner = "dewyze";
repo = pname;
rev = "acfda7229fc487ee6da44650164cb770d1cc608c";
sha256 = "sha256-9kvLbzrVjtBTjbXmhJ7JTggXgFvGVF7sc2YiVW9fUGY=";
};
})
2023-11-30 21:22:10 +00:00
(vimUtils.buildVimPlugin rec {
2023-08-13 17:00:41 +01:00
pname = "srht.vim";
version = "2022-01-04";
src = fetchFromSourcehut {
owner = "~willdurand";
repo = pname;
rev = "825e685f75464cbd41a5f8eded974e46f416355e";
sha256 = "sha256-9/Yeqmq/1ZIIsEgsrLLZ7o0cjOt/wlUgeLEzJoK7eco=";
};
})
ack-vim
coc-go
coc-highlight
coc-rust-analyzer
coc-yaml
committia-vim
ctrlp-vim
editorconfig-vim
fzf-vim
lsp-colors-nvim
nvim-tree-lua
nvim-web-devicons
quickfix-reflector-vim
rainbow
tabular
vim-airline
vim-airline-themes
vim-autoformat
vim-colors-solarized
vim-devicons
vim-dirdiff
vim-dispatch
vim-fugitive
vim-gitgutter
vim-markdown
vim-nix
vim-sensible
vim-startify
vim-surround
vim-toml
];
2023-03-05 10:13:10 +00:00
extraConfig = ''
if filereadable($HOME . "/.vimrc")
source $HOME/.vimrc
endif
'';
};
}