Skip to content

Instantly share code, notes, and snippets.

@toltarisa
Last active July 4, 2020 08:27
Show Gist options
  • Select an option

  • Save toltarisa/513378ee452730c507a3346d36fc9e2c to your computer and use it in GitHub Desktop.

Select an option

Save toltarisa/513378ee452730c507a3346d36fc9e2c to your computer and use it in GitHub Desktop.
Basic vim shortcuts

Note: Before starting ,For executing any command, firstly ':' we must open the standard prompt with colon. After writing command we should executing command by pressing Enter

Quit Vim

  • q: quit
  • wq : save current file and quit.
  • q! : quit without saving the file.

Saving changes

  • w : save changes

Moving around

  • j : go down
  • k : go up
  • l : go right
  • h : go left

writing

  • i : insert mode,if you just using keyboard, by clicking i you can start coding, if you wanna go back cursor mode press esc

deleting

  • dd : delete a line

going top and bottom of page

  • gg : take you to the top of the page
  • Capital g : takes you to the bottom of page

Jumping between code blocks

  • alt gr + } : go down on the page through code blocks
  • alt gr + { : go up on the page through code blocks

going to specific line

  • how many line you wanna go down + j : take you to down by the given number
  • how many line do you wanna go up + k : take you to up by the given number

undoing & redoing

  • u : undo what you did
  • ctrl + r : redo what you undo

copy & paste

  • yy : copy the whole line
  • p : paste the copied data to desired line with one line below
  • P : paste the copied data to desired line with one line above

choosing multiple line

  • v : after presing v you can go up with k and go down with j

go to newline and get in insert mode

  • o : go to newline and get in insert mode

horizontally go to the next word

  • w : horizontally go to the next word
  • b : exact opposite of w

go to the specific line

  • : + desired line: for example press : 30, it'll you move to the line 30
  • 0 : move to the very beginning of line(if there is some space front of line)
  • shift+3 : move to the beginning of line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment