Vim Recipes
Contents
Vim Recipes¶
One-liners and other useful tricks for Vim.
Table of Contents¶
## Installing .vba / vimball plugins
Open the file in vim and execute
:source %
This will move all of the plugins to their respective directory.
Filetype specific settings¶
A good way of managing file specific settings is to use the filetype plugin: in short, add
filetype plugin on
to your .vimrc file. Then, configure each filetype’s settings in ~/.vim/ftplugin/. For example, a configuration for UNIX Makefiles
" ~/.vim/ftplugin/make.vim
set ts=8
set sw=8
set noexpandtab
More information in the Vim Fandom.
To uppercase¶
We can turn all words uppercase using the search-and-replace regex:
%s/\<./\u&/g
Here
\<matches the start of a word\uis the Vim uppercase modifier, for the character in the substituted string (i.e.&, the LHS)