3
Good afternoon,
I am struggling with Vim mappings. I would like to practice over very basic ones such as "replace a-s with b-s", or "replace ù with /", but I do not succeed.
Here are my trials:
:imap a b
:imap ù /
:imap 'ù' /
:imap 'ù' '/'
Anytime I get into the insertion mode I have a-s when I press a-s, and ù-s when I press ù-s.
(Besides this I have more complex mappings correctly working, such as nnoremap ,<space> :nohlsearch<CR>
or nnoremap <C-H> <C-W><C-H>
.)
I am running the following version of Vim:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Thanks in advance for your help!
Thanks… a… lot. I had set
paste
. Actually I often do so for pasting. Now I will unset it afterwards! Reading the documentation you provided I also see that it solves the abbreviations "not working" ! – Luc – 2019-10-24T09:06:12.890The
'pastetoggle'
option is helpful for quicky changing its value via a key. (You obviously cannot use mappings for that). If you closely observe the lower-left corner, you'll see-- INSERT (paste) --
when this is enabled. If you need a bigger hint, you could also include the paste value in a custom'statusline'
. – Ingo Karkat – 2019-10-24T13:30:14.420