I have found I needed to do the .override
before the .customize
, like the following, in my systemPackages.
For the benefit of other users going for this, since I wasn't able to find other examples online, here's my entire Vim configuration as of now:
((vim_configurable.override {python = python38;}).customize {
name = "vim";
# add custom .vimrc lines like this:
vimrcConfig.customRC = ''
set nocompatible
syntax on
filetype plugin on
" search in subfolders
set path+=**
" tabcomplete files with :find filename
set wildmenu
set relativenumber
set number
set shiftwidth=4 expandtab
set hidden
set ruler
set colorcolumn=80
set backspace=indent,eol,start
'';
vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; {
# loaded on launch
start = [ YouCompleteMe elm-vim vim-nix haskell-vim jedi-vim typescript-vim ];
# manually loadable by calling `:packadd $plugin-name`
# opt = [ elm-vim vim-nix haskell-vim jedi-vim typescript-vim ];
# To automatically load a plugin when opening a filetype, add vimrc lines like:
# autocmd FileType php :packadd phpCompletion
};
})
I now have opt
commented, with the contents placed in start
because lazy loading isn't working with the default loader, and the individual packages loaded with start
are supposed to lazy-load anyhow.
I also removed the autocmd
parts that are supposed to work with opt
(but aren't):
autocmd FileType elm :packadd elm-vim
autocmd FileType nix :packadd vim-nix
autocmd FileType hs :packadd haskell-vim
autocmd FileType py :packadd jedi-vim
autocmd FileType ts :packadd typescript-vim