On 08/17/10 04:37, coolesting wrote:
" a abbreviation in .vimrc file
:ab php <?php ?>

" a ex command-line will be issue in vim
:newtab /var/www/index.php

so,  it is not work as i expected when issue the ex command
and press the ENTER key, the word "php" at the end of ex
command sequence will be expanded the "<?php ?>".

As Bill has suggested, to prevent this expansion in the command-line, use ":iab" ("insert-mode abbreviation") instead of ":ab".

when i type the string just like the abbreviation, sometimes ,
we need to comment the code with some words, you maybe type a
word as your abbreviation, if you need the press<enter>  or
<space>  in which the comment, now ,what solution you have,
how to do you will ?

This is one of the reasons I don't often use abbreviations. :) For them to be useful, they have to be unique stretches of text or you have to remember to press control-V to break the abbreviation. I usually throw some 'isk' character into my LHS such as

 :iab _P <?php ?>

to (1) make it something I'm not likely to type unintentionally and (2) to minimize the number of keystrokes (including <shift> going up/down) while remaining memorable enough that I actually use it. So I usually only use abbreviations when there are long stretches of prose with long & frequently repeated phrases (such as the full name or a person or company).

-tim

PS: lamenting that "abbreviation" is such a long word...






--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to