[vim/vim] macros/mappings and 'keymap' or :lmap when iminsert=1 and/or imsearch=1 (#1247)

16 views
Skip to first unread message

Matthew Malcomson

unread,
Nov 11, 2016, 10:01:41 AM11/11/16
to vim/vim

It seems that macros ignore the 'keymap' setting or :lmap mappings, I think it would be preferable to do the same as for :imap mappings.

Test case:
Start vim with vim -N -u NONE

:set iminsert=1
:lmap a l<CR>
qaiaaa<CR><Esc>q@a

You see two lines in the file, the first one is lll and the second one is aaa.
Similar happens for search patterns when 'imsearch' is either -1 or 1, and also for f/F t/T.

If you do the same with an :imap you get two lines of lll, I believe it would be less surprising if :lmap and 'keymap' follow this behaviour.

The same happens for example with :nmap commands that insert some text.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Emilien Breton

unread,
May 24, 2026, 4:40:04 PM (9 hours ago) May 24
to vim/vim, Subscribed
Bricktech2000 left a comment (vim/vim#1247)

Bumping this. I use mappings like:

lnoremap <c-space> <c-k>NS
lnoremap <c-.> <c-k>,.
lnoremap <c-`> <c-k>'6
lnoremap <c-'> <c-k>'9

lmap is nice because the mappings will work in all the right places: insert mode, search, f, t, r... So it's a shame they break in macros.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/1247/4529901447@github.com>

Reply all
Reply to author
Forward
0 new messages