Skip to content

Instantly share code, notes, and snippets.

@codeasashu
Last active November 7, 2019 06:06
Show Gist options
  • Select an option

  • Save codeasashu/9d9292399a64ac9feb522de3c56638ab to your computer and use it in GitHub Desktop.

Select an option

Save codeasashu/9d9292399a64ac9feb522de3c56638ab to your computer and use it in GitHub Desktop.
My Vim cheatsheet

Basics (Should know)

  1. [[ Goto function definition starting from cursor position
  2. '', `' Return to previous cursor position
  3. { Go back to previous linegap, } go to next linegap
  4. dgg Remove from current position to begining of file
  5. dG Remove from current to end of file
  6. #, * search and highlight the word under current cursor in the whole file.
  7. ma to set mark at position a, 'a to go to line at mark a, or `a to go to exact column at a
  8. gd to go to local variable initialisation. (gd = Goto Declaration)
  9. vip select everything within a function block

Use marks effectively

https://vim.fandom.com/wiki/Using_marks#Special_marks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment