Vim: Difference between revisions
imported>Mic92 |
imported>Mic92 |
||
| Line 2: | Line 2: | ||
= Examples = | = Examples = | ||
== Using vim's builtin packaging capability == | |||
<syntaxHighlight lang="nix"> | |||
vim_configurable.customize { | |||
vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { | |||
# loaded on launch | |||
start = [ youcompleteme fugitive ]; | |||
# manually loadable by calling `:packadd $plugin-name` | |||
opt = [ phpCompletion elm-vim ]; | |||
# To automatically load a plugin when opening a filetype, add vimrc lines like: | |||
# autocmd FileType php :packadd phpCompletion | |||
} | |||
}; | |||
</syntaxHighlight> | |||
== Using VAM as manager == | == Using VAM as manager == | ||
You can add this to you nix configuration to get vim with custom <code>.vimrc</code> and listed plugins. | You can add this to you nix configuration to get vim with custom <code>.vimrc</code> and listed plugins. | ||
< | <syntaxHighlight lang="nix"> | ||
vim_configurable.customize { | vim_configurable.customize { | ||
name = "vim-with-plugins"; | name = "vim-with-plugins"; | ||
| Line 24: | Line 40: | ||
]; | ]; | ||
}; | }; | ||
</ | </syntaxHighlight> | ||
Full documentation at [https://github.com/MarcWeber/vim-addon-manager VAM homepage]. | Full documentation at [https://github.com/MarcWeber/vim-addon-manager VAM homepage]. | ||
== Using Pathogen as manager == | == Using Pathogen as manager == | ||
There is a pathogen implementation as well, but its startup is slower and [VAM] has more features. | There is a pathogen implementation as well, but its startup is slower and [VAM] has more features. | ||
| Line 32: | Line 49: | ||
vimrcConfig.pathogen.pluginNames = [ "vim-addon-nix" "youcompleteme" ]; | vimrcConfig.pathogen.pluginNames = [ "vim-addon-nix" "youcompleteme" ]; | ||
</pre> | </pre> | ||
= Adding new plugins = | = Adding new plugins = | ||