diff --git a/users/tacocat/programs/vim.nix b/users/tacocat/programs/vim.nix index 2a28f4d..5aa85f8 100644 --- a/users/tacocat/programs/vim.nix +++ b/users/tacocat/programs/vim.nix @@ -1,4 +1,37 @@ -{pkgs, ...}: { +{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 = { @@ -15,31 +48,55 @@ tabstop = 2; }; plugins = with pkgs.vimPlugins; [ - onedark-vim everforest - gruvbox + catppuccin-vim + sonokai vim-colors-solarized + rose-pine-vim terminus vim-fugitive vim-gitgutter + tabular + vim-markdown ]; extraConfig = '' + if has('termguicolors') + set termguicolors + endif + set background=dark + let g:everforest_background = 'soft' + colorscheme everforest + set scrolloff=5 set hlsearch - set background=dark set signcolumn=yes - colorscheme gruvbox set updatetime=100 set cursorline set autoindent set belloff=all + nnoremap :call system("wl-copy", @") nnoremap :nohlsearch + + 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; }