Vim

Resources

Guides and Tips

Search and Regex

Commands

Vim-Fugitive Git

https://github.com/tpope/vim-fugitive

:Gstatus
:Gedit
:Gcommit
:Gblame
:Ggrep
:Gbrowse
:Gdiff
:Gmove

Status mode

In status mode, use - to add a file to the stage.

Use U to revert a file.

Buffer

https://github.com/maxbrunsfeld/vim-yankstack

meta-p - cycle backward through your history of yanks meta-shift-p - cycle forwards through your history of yanks

See yanks by :Yanks

Comments

:gcc :gcgc

File commands

  • Write file :w <fileName>
  • Write file and quit :wq
  • Edit a file :e <filename> (tab autocomplete works)
  • wa for writing all files
  • :e! revert to last save
  • !rm % remove file
  • :e . show the files & current in the current directory

Modes

Vim has several different modes

  • esc to get to Normal mode
  • i insert mode
  • v visual (for selecting sections of text by the keyboard to be operated on)
  • V visual selecting by lines

Misc

  • command mode :
  • Current working directory :pwd
  • :source ~/.vimrc to source a .vimrc
  • Source current file :so %
  • . references last command
  • ,ev edit vim config
  • :!<command> to run commandline command
  • :reg to registers (clipboard etc)

results matching ""

    No results matching ""