Reputation: 1007
My vim used ctrl-v as paste short-cut, which conflict with commands need ctrl-v as shortcut prefix.
For example, ^M
need ctrl-v ctrl-m
. I can do that in vim command line, and vim without intialization. But the symbol won't go to buffer from vim command line. :s/aaa/^M/g
doesn't work.
Although, I can use echo -e "\r"
or no-initialized vim to work around it.
But how to type this symbol in my current vim configuration?
Upvotes: 3
Views: 5727
Reputation:
try Ctrl-Q Enter
(This solution also works when you try to enter digraphs by number in Vim)
Upvotes: 1
Reputation: 9273
You could try using a mapping to the original function of ctrl-v
:
noremap! <C-Q> <C-V>
But as explained on :h CTRL-V-alternative
and noted by ZyX on the comments, your issues may be that your terminal is capturing the ctrl-q
(more details here). If the mapping above doesn't works you could try mapping to something else:
noremap! <leader><C-V> <C-V>
Then hitting leader
(usually \
) followed by ctrl-v
ctrl-m
should insert ^M
on both insert
and command
mode.
Upvotes: 1
Reputation: 195169
to input ^M
you can try followings:
Ctrl-V Enter
Ctrl-V Ctrl-M
Ctrl-K C R
, C R
means CR.Upvotes: 4