Mercurial > vim
diff runtime/doc/usr_43.txt @ 7183:ffad29dc7eee
commit https://github.com/vim/vim/commit/a0f849ee40cbea3c889345256786b640b0becca2
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Oct 30 14:37:44 2015 +0100
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 30 Oct 2015 14:45:04 +0100 |
parents | 359743c1f59a |
children | 9f48eab77d62 |
line wrap: on
line diff
--- a/runtime/doc/usr_43.txt +++ b/runtime/doc/usr_43.txt @@ -1,4 +1,4 @@ -*usr_43.txt* For Vim version 7.4. Last change: 2008 Dec 28 +*usr_43.txt* For Vim version 7.4. Last change: 2015 Oct 23 VIM USER MANUAL - by Bram Moolenaar @@ -46,6 +46,7 @@ 2. Create the file "~/.vim/ftplugin/c.vi setlocal softtabstop=4 noremap <buffer> <LocalLeader>c o/**************<CR><CR>/<Esc> + let b:undo_ftplugin = "setl softtabstop< | unmap <buffer> <LocalLeader>c" Try editing a C file. You should notice that the 'softtabstop' option is set to 4. But when you edit another file it's reset to the default zero. That is @@ -60,6 +61,11 @@ buffer. This works with any mapping com |<LocalLeader>| in the mapping is replaced with the value of the "maplocalleader" variable. +The line to set b:undo_ftplugin is for when the filetype is set to another +value. In that case you will want to undo your preferences. The +b:undo_ftplugin variable is executed as a command. Watch out for characters +with a special meaning inside a string, such as a backslash. + You can find examples for filetype plugins in this directory: > $VIMRUNTIME/ftplugin/