From 85d3a040e5f2071b7cc8b5378254172fc3880cd6 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 16 Nov 2012 06:06:20 +0800 Subject: [PATCH] Update vim. --- Rakefile | 2 +- vim.md | 98 +++++++++++++++++++++++++++----------------------------- 2 files changed, 48 insertions(+), 52 deletions(-) diff --git a/Rakefile b/Rakefile index b19e74ee5..05fb3ea4f 100644 --- a/Rakefile +++ b/Rakefile @@ -5,5 +5,5 @@ end desc "Deploy" task :deploy => :build do - system "git update-ghpages rstacruz/cheatsheets -i _output" + system "git update-ghpages rstacruz/cheatsheets -i _output --force" end diff --git a/vim.md b/vim.md index 41e3c27c8..1e17d4c74 100644 --- a/vim.md +++ b/vim.md @@ -1,86 +1,82 @@ title: vim ---- - . - repeat last command - ]p - paste under the current indentation level - - `. - Go to last edit - `` - Go to last jump - - C-o - Go back to previous location (C-i forward) - C-t - Go back to last tag - Command line ------------ - - insert current word into the command line - " - paste from " register + # insert current word into the command line + " # paste from " register Motions ------- - vip - Select paragraph - vipipipip - Select more + vip # Select paragraph + vipipipip # Select more - ap - a paragraph - ip - inner paragraph + ap # a paragraph + ip # inner paragraph - ap, ip - Paragraph - aw, iw - Word - as, is - Sentence + ap, ip # Paragraph + aw, iw # Word + as, is # Sentence - ab - A block [( - aB - A block in [{ - at - A XML tag block - a[ ( { < - A [], (), or {} block - a' " ` - A quoted string + ab # A block [( + aB # A block in [{ + at # A XML tag block + a[ ( { < # A [], (), or {} block + a' " ` # A quoted string Example: - yip - Yank inner paragraph - yap - Yank paragraph (including newline) + yip # Yank inner paragraph + yap # Yank paragraph (including newline) Folds ----- - zo - Open - zO - Open, recursive - zc - Close - zC - Close, recursive - za - Toggle - zA - Toggle, recursive + zo # Open + zO # Open, recursive + zc # Close + zC # Close, recursive + za # Toggle + zA # Toggle, recursive - zv - Open folds for this line + zv # Open folds for this line - zM - Close all - zR - Open all + zM # Close all + zR # Open all - zm - Fold more (foldlevel += 1) - zr - Fold less (foldlevel -= 1) + zm # Fold more (foldlevel += 1) + zr # Fold less (foldlevel -= 1) - zx - Update + zx # Update -Scrolling ---------- +Misc +---- - zz - Center this line + . # repeat last command + ]p # paste under the current indentation level + + C-o # Go back to previous location (C-i forward) + C-t # Go back to last tag + + zz # Center this line + + `. # Go to last edit + `` # Go to last jump Windows ------- - z{height} - Resize pane to {height} lines tall + z{height} # Resize pane to {height} lines tall Tags ---- - ^] - Jump to definition - g] - See all definitions - ^O ^I - Back/forward + ^] # Jump to definition + g] # See all definitions + ^O ^I # Back/forward - :tselect Classname - Find definitions of Classname - :tjump Classname - Find definitions of Classname (auto-select 1st) - :tag Classname - Jump to first definition of Classname - -## My own customizations - - va{= - reindent block + :tselect Classname # Find definitions of Classname + :tjump Classname # Find definitions of Classname (auto-select 1st) + :tag Classname # Jump to first definition of Classname