Skip to content

Instantly share code, notes, and snippets.

@dgkim5360
Last active February 8, 2018 01:32
Show Gist options
  • Save dgkim5360/8a7ec4fd913abd2dbab085004c34e499 to your computer and use it in GitHub Desktop.
Save dgkim5360/8a7ec4fd913abd2dbab085004c34e499 to your computer and use it in GitHub Desktop.
DIY stuffs for the first step of Vim

Vimtutor

Moving the cursor in the normal mode :help usr_03

  • h j k l :help hjkl
  • 0 $
  • gg G
  • #G
  • <CTRL-O> <CTRL-I>
  • w e
  • %

Insert mode :help Insert

  • i a A o O :help insert

Delete operator :help deleting

  • x :help x
  • d (e.g. dw d$ dd d3e d5$) :help :delete

Replace operator :help replacing

  • r R
  • c (e.g. cw c$ c3e c5$)

Undo & redo :help undo-redo

  • u U
  • <CTRL-R>

Visual mode :help visual-mode

  • v (e.g. viw vj vi()

Yank (copy)

  • y :help yank
  • p :help put

External command :help filter

  • !ls :help !

Read/write

  • :w :help writing
  • :q :q! :qa :qa! :wq :wqa :help write-quit
  • :e :e! :help edit-a-file
  • :r filepath :help inserting-file

Find/replace :help search-commands

  • / ? n N
  • :s/old/new :s/old/new\c :s/old/new/g #1,#2s/old/new/g :%s/old/new :%s/old/new/g :%s/old/new/gc

Managing Multiple Buffers

Windows split :help windows

  • :split :vsplit
  • <CTRL-W> h <CTRL-W> j <CTRL-W> k <CTRL-W> l <CTRL-W> <CTRL-W>

Tabs :help tabpage

  • :tabnew :tab help :tabpage :tabclose
  • {count}gt :tabfirst tablast
  • :tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment