New answers tagged

1

Very few control characters are actually passed through in insert mode. You can easily remap them to <nop> (do nothing) or anything more useful; inoremap <c-b> <nop> inoremap <c-f> <nop> inoremap <c-l> <nop> inoremap <c-z> <nop>


2

There's a good answer to your question here: https://stackoverflow.com/a/15703188/5031295 In short, ctrl+o or ctrl+Olets you perform one normal mode command while in insert mode. Hence, pressing ctrl+odw while in insert mode deletes one word to the right of cursor (provided the cursor is on the first letter of the word). You can play around with this and ...


-2

vim v8.1 press any combine below in insert mode, will exit insert mode. Alt+e Alt+w Alt+j Alt+k Alt+h Alt+l Alt+.


1

An alternative to creating a mapping for this single Readline command, is to install the rsi.vim plugin, which emulates all (or at least, many) of Readline's standard shortcuts in insert and command-line modes. Future readers may also be interested in readline.vim, which purports to provide a more faithful set of mappings, but only in command line mode.


5

I've the following mappings for this noremap <C-Del> dw inoremap <C-Del> <space><esc>ce noremap <C-S-Del> dW inoremap <C-S-Del> <esc>lcW As you can see, there are several ways to do it (and handle single letters). and I'm quite certain there has been other Q/A|tips on the topic elsewhere. NB: unlike <c-o&...


1

TL;DR use <C-v> instead of V The cause in that you use S-v instead of <C-v>(V) before S-i(I) Block insert works only for Vertical blocks, not for selected lines. Difference between V and C-v V (<S-v>) is for selecting whole line$ <C-v> starts selecting Visual block: With CTRL-V (blockwise Visual mode) the highlighted text will ...


2

I'll post this as an answer since it seems to have worked for you: :nnoremap <expr> <Backspace> col('.') == 1 ? 'kgJ' : 'X' Usually this does the same as the X Normal-mode command, that deletes one character to the left. But then it uses an <expr> mapping to check whether we're executing it on the first column of the line, in which case ...


Top 50 recent answers are included