On Feb 6, 7:31 am, Miklos Somogyi <[email protected]> wrote:
> I got interested in vim's abbreviations.
>
> I can do double quotes for groff in insert mode, but I can not master 
> normal/command mode.
> E.g.
>
> cabbrev ;; :q!<CR>
>
> should quit a session but it does not. What's wrong?

You seem to be confused as to what an cabbrev command does. Youc
cabbrev command will work, when entered from command-line mode, and
when the abbreviation is expanded.

So, for example, with your above abbreviation, I would type:

:;;<space>

and Vim would quit. Note that I must first enter command-line mode
(cabbr defines command-line abbreviations) and that I must
additionally enter a character like <space> or press <Enter> myself to
trigger the abbreviation expansion.

You probably intended to use a mapping instead of an abbreviation.
Abbreviations are more useful for expanding long text sequences you
don't want to type repeatedly, for example:

:cabbrev md C:\Documents\ and\ Settings\{username}\My\ Documents

This allows you to type :e md/filename and you'll see it automatically
expand to a file in the My Documents directory.

Or, you can use them to correct typos:

:cabbrev q@ q!
:cabbrev Qa qa
etc.

All of these need an additional keypress to expand them, they don't
take expand on their own when you just type the characters in the
abbreviation.

-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to