Sunday, June 16, 2013

overriding builtin command and command history

First, I'd like to override an existing built-in command.
I have found discussion about using 'cabbrev' to do this
such as:

cabbrev cp <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'call
g:UserUp()' : 'cp')<CR>

If there is a different way that is "recommended", I'd
like to know.

Second, with this approach, the "call" is placed in to the
command line history. Is there a way to prevent adding
the call to the command history? The end-user does not
really need to do the "call" via the history mechanism.
Even better would be to place "cp" in the command history
rather than the "call".

Thanks

Richard

--
Quis custodiet ipsos custodes

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: