diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 8e67cb0923..385a5f8f61 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -550,10 +550,31 @@ Options: *'imstatusfunc'* *'imsf'* *'insertmode'* *'im'* Use the following script to emulate 'insertmode': > - autocmd VimEnter,CmdlineLeave,WinEnter,WinScrolled,BufEnter * silent! if &modifiable | startinsert | endif - inoremap - inoremap - nnoremap i + autocmd BufWinEnter * startinsert + inoremap + inoremap + inoremap + inoremap suspend + noremap + snoremap + noremap startinsert + cnoremap startinsert + inoremap + autocmd CmdWinEnter * noremap + autocmd CmdWinEnter * inoremap + + lua << EOF + vim.on_key(function(c) + if c == '\27' then + local mode = vim.api.nvim_get_mode().mode + if mode:find('^[nvV\22sS\19]') and vim.fn.getcmdtype() == '' then + vim.schedule(function() + vim.cmd('startinsert') + end) + end + end + end) + EOF < *'macatsui'* *'maxcombine'* *'mco'*