In your $HOME, make .vim/ directory (or vimfiles/ on Windows), in it make ftplugin/ directory, and in it keep files named "perl.vim" or "python.vim" or "html.vim" or ...
These should be loaded automatically when you open/create new file of given filetype as long as you don't forget to add :filetype plugin on
in your .vimrc (or _vimrc under windows)
Then, vim options should be defined with :setlocal
(and not :set
, otherwise their definition will override the default global setting).
Mappings are defined with :n/i/v(nore)map <buffer>
, as well as the abbreviations. Commands are defined with the -b
option. Menus can't be made local without the help of a plugin.
local
, <buffer>
, and -b
are important to prevent side effects.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…