mattshen
2/24/2017 - 9:12 PM

VIM

VIM

Vim Tutorial | Vim cheatsheet | [Vim autocomplete] (http://vim.wikia.com/wiki/Any_word_completion)

#Tips:

###Edit

Indent a block: v + jj + >
Cut and paste: v + d + p
Copy and paste: v + y + p
duplicate current line: yyp

###Files and Buffers
open all file with extension as 'cs':

:n **/*.cs

open files with wildcard:

:e **/example/*.scala

###Search and Replace

  • First occurrence on current line: :s/OLD/NEW
  • Globally (all) on current line: :s/OLD/NEW/g
  • Between two lines #,#: :#,#s/OLD/NEW/g
  • Every occurrence in file: :%s/OLD/NEW/g

###Navigation *Go to end of line: $

###External *:! pwd