Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created April 4, 2017 09:11
Show Gist options
  • Save ynonp/de7e284d543be98cc442b54b2e755ee3 to your computer and use it in GitHub Desktop.
Save ynonp/de7e284d543be98cc442b54b2e755ee3 to your computer and use it in GitHub Desktop.
my vim tips
  1. file navigation
  • √ open gvim on directory
  • √ open file qsize.h
  • √ use :e to open another file
  • √ use :e %:r.cpp to open corresponding cpp file
  • √ use gf to open included file
  • √ use Ctrl+O to jump back
  1. text objects
  • √ use ci(, ci{, ci[, ci" or ci' to replace contents of TO
  • √ use di to delete contents of TO
  • √ use f to jump forward in line
  1. visual mode
  • √ use v, V and ^v wisely
  • √ Demo: Add comments to block of lines in python
  • √ Demo: move filename column to start of line in ls -l
  1. macros and commands
  • √ Demo: turn perl hash into python dictionary
  1. OS Integration
  • √ Demo: run command from vim :!cmd
  • √ Demo: run command and write output to vim buffer :r!cmd
  • √ Demo: filter vim buffer through command :%!cmd
  • √ Demo: filter visual through command :'<,'>!cmd
  1. plugins
  • √ Demo: Codi (for python)
  • √ Syntax check (ale, syntastic)
  • √ Demo: Ctrl P
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment