diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-09-21 06:23:56 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-09-21 06:23:56 +0000 |
commit | e8e01073071369d33ab4cf61be05bebe5a65566e (patch) | |
tree | 2c29b23bfb933e0fa40619f7d1fae430ff2c247e /usr.bin/vim/doc/vim_tips.txt | |
parent | 584e4bbf452da2934dbaf4b9dc09bd131a1d4cd7 (diff) |
update to vim 4.4beta
Diffstat (limited to 'usr.bin/vim/doc/vim_tips.txt')
-rw-r--r-- | usr.bin/vim/doc/vim_tips.txt | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/vim/doc/vim_tips.txt b/usr.bin/vim/doc/vim_tips.txt index 28ac34e8610..95c44523a76 100644 --- a/usr.bin/vim/doc/vim_tips.txt +++ b/usr.bin/vim/doc/vim_tips.txt @@ -1,4 +1,4 @@ -*vim_tips.txt* For Vim version 4.2. Last modification: 1996 June 16 +*vim_tips.txt* For Vim version 4.4. Last modification: 1996 Aug 30 Contents: @@ -15,6 +15,7 @@ Useful mappings |useful-mappings| Compressing the help files |gzip-helpfile| Executing shell commands in a window |shell_window| Pseudo-Ex mode |pseudo-Q| +Using <> notation in autocommands |autocmd-<>| Editing C programs *C-editing* @@ -304,4 +305,23 @@ cabbrev visual cunmap <C-V><CR><NL> In a following version of Vim the "Q" command will be made Vi compatible. Use "gq" for formatting text. + +Using <> notation in autocommands *autocmd-<>* +================================= + +The <> notation is not recognized in the argument for :autocmd. To avoid +having to use special characters, you could use a mapping to get the <> +notation and then call the mapping from the autocmd. Example: + + *buffer-menu* +" +" This is for automatically adding the name of the file to the menu list +" first we use the normal mode to convert the 'dots' in the filename to +" \., store that in register '"' and then add that name to the Buffers menu +" list. WARNING: this does have some side effects, like overwriting the +" current register contents. +" +nmap _xaddbufmenu O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><C-M><C-M> +autocmd BufNewFile,BufReadPre * normal _xaddbufmenu + vim:ts=8:sw=8:js:tw=78: |