On 28/10/08 04:59, Allegory Bill wrote:
> Hi gang,
>
> I'll be messing around on a remote ftp://ftp.myserver.com/mystuff/
> address for the next few days, and tried to set the following shortcut
> in .vimrc:
>
> cmap myserver ftp://ftp.myserver.com/mystuff/
>
> When I type :myserver, I get a continuing line of recursive "ftp://
> ftp://ftp://ftp://......." that keeps going until I Ctrl-C.
>
> cmapping a command, such as 'cmap myserver tabnew ftp://ftp.myserver...'
> works fine.
>
> Any suggestions as to how I can cmap just an address? I assume there's
> some sort of 'blank' argument I'll need to give between 'cmap' and the
> address, but I'm not sure what that is.
>
> Any help appreciated.
>
> Cheers,
> - JB
Try an abbreviation instead:
cnoreabbrev myserver ftp://ftp.myserver.com/mystuff
Notice that I didn't include the final slash, because you would type
tabnew myserver/index.htm
to get
tabnew ftp://ftp.myserver.com/mystuff/index.htm
(Abbreviations are not recursive).
Alternately, use ":cnoremap" instead of ":cmap" in order to avoid
recursively remapping the "myserver" contained in the expantion of the
mapping.
Note that mappings are applied to the {rhs} of abbreviations unless you
use noreabbrev/cnoreabbrev/inoreabbrev (just like they are for mappings
except with the "noremap" family of commands).
Best regards,
Tony.
--
Due to lack of disk space, this fortune database has been
discontinued.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---