nix-config/users/tacocat/programs/vim.nix

100 lines
2.7 KiB
Nix

{pkgs, ...}: let
rose-pine-vim = pkgs.vimUtils.buildVimPlugin {
name = "rose-pine-vim";
src = pkgs.fetchFromGitHub {
owner = "rose-pine";
repo = "vim";
rev = "d149980cfa5cdec487df23b2e9963c3256f3a9f3";
sha256 = "a+RCmgSG+snwBVQCzSnp8wVxSoQcLqoJjnTiDviTGqc=";
};
};
vim-spell-en-utf8-dictionary = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/en.utf-8.spl";
sha256 = "0w1h9lw2c52is553r8yh5qzyc9dbbraa57w9q0r9v8xn974vvjpy";
};
vim-spell-en-utf8-suggestions = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/en.utf-8.sug";
sha256 = "1v1jr4rsjaxaq8bmvi92c93p4b14x2y1z95zl7bjybaqcmhmwvjv";
};
vim-spell-en-latin1-dictionary = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/en.latin1.spl";
sha256 = "0i8q2si2bm8c0556j3c0gjin3bixgs055yqqk1irvz4wszy9w3b2";
};
vim-spell-en-latin1-suggestions = builtins.fetchurl {
url = "http://ftp.vim.org/vim/runtime/spell/en.latin1.sug";
sha256 = "00ibcbj2b2krwd5zl9zl671db44k3fl59sz1yymb9ydkpkj9gpp6";
};
in {
programs.vim = {
enable = true;
settings = {
copyindent = true;
expandtab = false;
hidden = true;
history = 100;
ignorecase = false;
modeline = true;
mousefocus = false;
number = true;
relativenumber = true;
shiftwidth = 2;
tabstop = 2;
};
plugins = with pkgs.vimPlugins; [
everforest
catppuccin-vim
sonokai
vim-colors-solarized
gruvbox
rose-pine-vim
terminus
vim-fugitive
vim-gitgutter
tabular
vim-markdown
];
extraConfig = ''
if has('termguicolors')
set termguicolors
endif
set background=dark
colorscheme rosepine_moon
set scrolloff=5
set hlsearch
set signcolumn=yes
set updatetime=100
set cursorline
set autoindent
set belloff=all
nnoremap <C-@> :call system("wl-copy", @")<CR>
nnoremap <C-q> :nohlsearch<CR>
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_math = 1
'';
};
home.file.".vim/after/plugin/terminus.vim".text = ''
let &t_SI="\e[6 q"
let &t_EI="\e[2 q"
let &t_Cs = "\e[4:3m"
let &t_Ce = "\e[4:0m"
'';
home.file.".vim/after/ftplugin/markdown.vim".text = ''
setlocal spell spelllang=en_us
setlocal nomodeline
'';
home.file."/.vim/spell/en.utf-8.spl".source = vim-spell-en-utf8-dictionary;
home.file."/.vim/spell/en.utf-8.sug".source = vim-spell-en-utf8-suggestions;
home.file."/.vim/spell/en.latin1.spl".source = vim-spell-en-latin1-dictionary;
home.file."/.vim/spell/en.latin1.sug".source = vim-spell-en-latin1-suggestions;
}