Friday, September 21, 2012

Re: increment character under cursor

On 21/09/12 23:21, JP Lew wrote:
>
> Not in-built. You could do something like
>
> :nnoremap <f4> s<c-r>=<c-r>"+1<cr><esc>
>
>
> I see. You're substituting the character, entering expression mode,
> pasting it back then adding 1. How clever.
>
> Part of the problem may have been that vim doesn't discern
> control+{char} from control+shift+{char}, but you have the right
> idea. You just have to map it to something vim recognizes :-)
>
>
> great, thanks Tim, I'll try something else.
>
> Another question. How do I enter that mode where Vim outputs the key
> combination I just pressed? For example if I type CTRL + a on my
> keyboard it spits out "<C-a>". I remember it was really useful for
> writing mappings.
>
> --
> 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

In Insert mode, Ctrl-K followed by a "special key" will insert the <>
representation of that key. If followed by a "normal" (printable) key,
OTOH, it waits for the second key in a digraph.

See :help i_CTRL-K


Best regards,
Tony.
--
"Last night, I came home and realized that everything in my apartment
had been stolen and replaced with an exact duplicate. I told this to
my friend -- he said, `Do I know you?'"
-- Steven Wright

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

No comments: