====================== Vim keyboard shortcuts ====================== First published at 2/8/2018 on https://defkey.com/vim-text-editor-shortcuts Vim is a text editor, than can be used from a command line interface and as a standalone application in a graphical interface. It was originally released for Amiga but it has since been developed to be cross-platform. Vim has 61 shortcuts and we have listed all of them below. General ------- Esc Gets out of the current mode into the “command mode”. All keys are bound of commands I “Insert mode” for inserting text. Keys behave as expected : “Last-line mode”. In this mode, Vim expects you to enter a command such as to save the document Navigation keys --------------- H Move the cursor one character to the left J Move the cursor down one line Ctrl + J Move the cursor down one line K Move the cursor up one line Ctrl + P Move the cursor up one line L Move the cursor one character to the right 0 Move the cursor to the beginning of the line $ Move the cursor to the end of the line ^ Move the cursor to the first non-empty character of the line W Move forward one word (next alphanumeric word) W Move forward one word (delimited by a white space) 5 then W Move forward five words B Move backward one word (previous alphanumeric word) B Move backward one word (delimited by a white space) 5 then B Move backward five words G Move to the end of the file G then G Move to the beginning of the file Navigate around the document ---------------------------- ( Jump to the previous sentence ) Jump to the next sentence { Jump to the previous paragraph } Jump to the next paragraph [ then [ Jump to the previous section ] then ] Jump to the next section [ then ] Jump to the end of the previous section ] then [ Jump to the end of the next section Insert text ----------- A Insert text after the cursor A Insert text at the end of the line I Insert text before the cursor O Begin a new line below the cursor O Begin a new line above the cursor Delete text ----------- X Delete character at cursor D then W Delete a word D then 0 Delete to the beginning of a line D then $ Delete to the end of a line D then ) Delete to the end of sentence D then G then G Delete to the beginning of the file D then G Delete to the end of the file D then D Delete line 3 then D then D Delete three lines Simple replace text ------------------- R Replace characters instead of inserting them Copy/Paste text --------------- Y then Y Copy current line into storage buffer P Paste storage buffer after current line P Paste storage buffer before current line Undo/Redo operation ------------------- U undo the last operation Ctrl + R Redo the last undo Modify selected text -------------------- ~ Switch case D Delete a word C Change Y Yank > Shift right < Shift left ! Filter through an external command Save and quit ------------- : then Q Quits Vim but fails when file has been changed : then W Save the file : then W then Q Save the file and quit Vim : then Q then ! Quit Vim without saving the changes to the file Z then Z Write file, if modified, and quit Vim Z then Q Same as :q! Quits Vim without writing changes Last modified on (UTC): Monday, February 3, 2020 Defkey © All rights reserved.