-
I tried to do the following: vim.api.nvim_exec([[
xnoremap <sid>(std-I) I
xnoremap <sid>(std-A) A
xmap <expr> I mode()=='<c-v>'?'<sid>(std-I)':(v:count?'':'1').'i'
xmap <expr> A mode()=='<c-v>'?'<sid>(std-A)':(v:count?'':'1').'a'
for l:v in ['', 'v', 'V', '<c-v>']
execute 'omap <expr>' l:v.'I%' "(v:count?'':'1').'".l:v."i%'"
execute 'omap <expr>' l:v.'A%' "(v:count?'':'1').'".l:v."a%'"
endfor
]], false) but I get the error:
|
Beta Was this translation helpful? Give feedback.
Answered by
AckslD
Feb 24, 2022
Replies: 2 comments 1 reply
-
Nvm, putting it in a function works :) vim.api.nvim_exec([[
function! s:matchup_convenience_maps()
xnoremap <sid>(std-I) I
xnoremap <sid>(std-A) A
xmap <expr> I mode()=='<c-v>'?'<sid>(std-I)':(v:count?'':'1').'i'
xmap <expr> A mode()=='<c-v>'?'<sid>(std-A)':(v:count?'':'1').'a'
for l:v in ['', 'v', 'V', '<c-v>']
execute 'omap <expr>' l:v.'I%' "(v:count?'':'1').'".l:v."i%'"
execute 'omap <expr>' l:v.'A%' "(v:count?'':'1').'".l:v."a%'"
endfor
endfunction
call s:matchup_convenience_maps()
]], false) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AckslD
-
Is this something that people commonly use? Never formally supported this because the semantics seemed specific to one user's workflow. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nvm, putting it in a function works :)