Vim logo vim online Vim Book Ad

basic Tip #267: selectively displaying abbreviations

 tip karma   Rating 13/6, Viewed by 411 

created:   June 27, 2002 6:42      complexity:   basic
author:   zzapper      as of Vim:   5.7

Hi Vimmers,
abbreviations have always been one of the most useful parts of vi(m), trouble is when you've got too many you forgot what you called them.

You can of course list the whole lot with

:ab<cr>

But did you know that you can type the first few letters of your abbreviations and get a list of just thos abs eg

:ab php<cr>
gives me all my php abs
&
:ab perl<cr>
gives me all my perls

also try control-D instrad of <cr>

zzapper

 rate this tip  Life Changing Helpful Unfulfilling 

<<use -S command line switch | Get cursor position as byte percentage instead of line percentage >>

Additional Notes

[email protected], June 28, 2002 4:45
Hi Just found out that it works for maps as well
eg all my maps beginning with a comma

:map ,

displays
  ,z            :redir @*|sil exec 'g@<\(input\|select\|textarea\|/\=form\)\>@p
'|redir END<CR>
   ,y            "yyy@y<CR>
   ,x            :%s#<script\_.*/script>#<script>^M</script>#g
   ,v            :e $VIM/_vimrc
   ,s            :source $VIM/_vimrc
   ,r            :redir! > c:/aaa/xxx
   ,i            :update<CR>: !start c:\progra~1\intern~1\iexplore.exe <cWORD><C
R>
   ,f            :update<CR>:silent !start c:\progra~1\intern~1\iexplore.exe fil
e://%:p<CR>
   ,c            c/["'<;)]<CR>
v  ,h            "zda<h1><C-R>z</h1> <Esc>2F>
Anonymous, July 20, 2002 11:32
You can use Tab- and Ctrl-D-completion on the vim commandline for just about everything. Play around. Commands, filenames, maps, abbreviations, buffernames and whatnot. It's context sensitive, so it completes the right thing at the right place. Extraordinarily useful and an extreme speed boost.

--
Regards,
A.P.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo