Re: Aliases in .vimrc?
- You can define a map, which mimics user input. You can define the
modes in which a map is active. For instance, to make it so that
pressing <C-M> in normal mode does your line end replacement, you
could add this to your vimrc:
nmap <C-e> :%s/\r/\r/g <CR>
You can find out more by typing
Also, you can define commands as you suggest below, so that typing at
the command line runs a command (as you suggest below)
command Sub :%s/\r/\r/g
User defined commands conventionally start with a capital letter.
On 7/31/06, Rick Hogg <eulipion2@...> wrote:
> Just wondering if there's a way to make permanent aliases/shortcuts for Vim. For example, I have some documents with improper line breaks with lots of ^M's. The command to correct this is :%s/\r/\r/g so I'm wondering if there's a way to name this action "sub" so all I have to type is :sub to run this. Is this a .vimrc thing?
> How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.