New answers tagged

1

(First I think I have to say is that my environment is simply Terminal and zsh, all I use are built-in stuffs provided by macOS.) In INSERT MODE I typed option + ⌫ then strangely <S-Insert> appeared (I think this is because I modified the Terminal preferences to make option + ⌫ be mapped to \033[2;2~) , then I used the following and it works: imap <...


2

One option is instead of trying to bind a key combination to this action, just use the default key binding for it, which is Ctrl+W. See :help i_CTRL-W. This same key binding should be available by default in zsh (or bash, etc.) so you could just use it everywhere with no need for custom configuration. You could try to map Option+⌫ to do the same in Vim... ...


1

function! s:get_char(num) abort if a:num == 0 return matchstr(getline('.'), '.\%' . col('.') . 'c') else return matchstr(getline('.'), '\%' . col('.') . 'c.') endif endfunction Without corner cases and can handle wide characters. Then function! s:is_surrounded(match_list) return index(a:match_list, s:get_char(0) . s:get_char(1)) >= 0 ...


Top 50 recent answers are included