Map shift-tab in vim to inverse tab in Vim

Vim already has built-in key commands for insert mode to shift the current line left or right one &shiftwidth. They are (in insert mode): Ctrl–t : shift right (mnemonic “tab”) Ctrl–d : shift left (mnemonic “de-tab”) If you still want to use shift-tab, this is how you do it: ” for command mode nnoremap <S-Tab> …

Read more

How to map Shift-Enter

I managed to correct my terminal key-code for Shift+Enter by sending the key-code Vim apparently expects. Depending on your terminal, (Adding Ctrl+Enter as a bonus!) iTerm2 For a single Profile open Preferences → Profiles → Keys → [+] (Add) For all profiles open Preferences → Keys → [+] (Add) Keyboard shortcut: (Hit Shift+Enter) Action: Send …

Read more

Undo all changes since opening buffer in vim

To revert the current buffer to the original state prior to the very first change recorded in its undo list (see :help undo-tree), one can use the following two consecutive invocations of the :undo command: :u1|u The first command (:undo 1) reverts to the state of the buffer just after the very first registered change, …

Read more

How can I spellcheck in gVim?

Use :set spell to turn on spell-checking. If it’s source code, gvim is smart enough to only spellcheck comments and string literals. :help spell will give you all the details. Here are some excerpts: To search for the next misspelled word: ]s Move to next misspelled word after the cursor. A count before the command …

Read more