[Vim-l] Cleaning up "replace builtin command" tip

John Beckett johnb.beckett at gmail.com
Wed Apr 9 23:48:15 UTC 2008


Benjamin Fritz wrote:
> http://vim.wikia.com/wiki/Replace_a_builtin_command_using_cabbrev
> 
> I'm considering replacing the example in the tip (replacing the 'e'
> command) with the function defined in the comments and the 
> abbreviation of the function for itself (CommandCabbr ccab 
> CommandCabbr).

That would be great. It's probably a failure of my imagination, but I can't
think of when the example with 'e' would help (it's not often that the
current buffer is empty here). And if you're going to have a tip to replace
a builtin command, you should have a couple of useful examples.

If anyone can suggest some simple-but-useful examples for abbreviations that
might illustrate this tip, please post.

As a confirmed curmudgeon, I personally would avoid redefining builtin
commands - life is sufficiently exciting without wondering what's going to
happen when I use ':e ...' on different systems. The comment shows a useful
'wx' abbreviation, and I'm thinking that the tip could have a slight change
in emphasis to say you can define abbreviations for commands, and you can
even redefine builtin commands. At any rate, I would not bother trying to
make a reliable replacement for ':e' that works as wanted in the tip.

The tip might also mention the reasoning: Whereas you could map a key to
perform a useful operation, it can be easier to type a command with a name
that you can remember, rather than have lots of complex and essentially
meaningless key combinations for different operations.

There might be a ==See also== for:
http://vim.wikia.com/wiki/VimTip22   Handle common command typos
http://vim.wikia.com/wiki/VimTip352  Disabling cabbrev

> I'd like to clean this tip up and feature it next month.

Magnificent - I was getting worried<g>.

John



More information about the Vim-l mailing list