set nu set optimize set noerrorbells set tabstop=8 set softtabstop=4 set shiftwidth=4 set noexpandtab set autoindent set wrapscan set bg=dark "A used "a used " B = Read from buffer map B :r /tmp/me " ^B insert script header map :0 O#!/bin/bash "b used " C = Append C style Comment at end of line map C A /* */hh "c used "D used "d used " E = show numbers on map E :set nu " e = show numbers off map e :set nonu " F = Add a new line before current line map F O " f = Add a new line after current line map f o " G = Delete standard buffer. Standard buffer = mark a to mark b inclusive map G :'a,'bd " comment mark a to mark b map g :'a,'bs/^/#/ " CTRL-G uncomment mark a to mark b map :'a,'bs/^#// " H = page down map H "h used "I used "i used "J used "j used " K = dump the variable. For debuggins scripts. "map K :s/^.*/echo "& is ($&)"; map :s/^.*/print "& is (".$&.")\\n"; map K :s/^.*/print "& is (".Dumper($&).")\\n"; "map K :s/^.*/print "& is (".ref($&).")\\n"; "map K :s/^.*/print "& is ("+str(&)+")" "map K :s/^.*/print "& is (%s)" % str(&) "k used "l used "L used " ^L = prepend // "map I// " ^L = insert ~/l A list of line length markers map :r ~/l " fmt line. rm leading space, insert line break at word before 81st char. map M :s/^[ ]*//g0081lbi "m used " N = skip to Next file. map N :n " ^N = insert standard pythoN header map :0 0i#!/usr/bin/env python "n used "O used "o used "P used " ^P insert perl script header map :0 O#!/usr/bin/perl -w use strict; use Data::Dumper; :2,5s/^#// "p used " Q = Repeat last substitution for current line to end of file. map Q mz:.,$~`z " q = quit map q :q " R = Prepare for paste. Set auto indent off and remove leading spaces to end of file "map R mz:set noautoindentI :.,$s/^[ ]/ `zo " R = Prepare for paste. Set auto indent off "map R :set noautoindento " R = Prepare for paste. Set auto indent off map R :set pasteo " S = undo wrap line in XML comment map S ^5dl$dldldldl " s = wrap line in XML comment map s I " T = rm leading tab map T :.< "map T 0dl "map T :.s/^ // " t = add leading tab map t :.> "map t I " CTRL-T Grab secondary dump file map :r /home/me/foo " U = page Up map U "u used " V = Append line to buffer map V :.w>>/tmp/me " v change tab to 8 spaces "map v :s/ / /g " W = write file map W :w "w used " X = Overwrite buffer file with current line map X :.w!/tmp/me " x = move character forward map x dlp " Y = Overwrite buffer file with standard buffer. map Y :'a,'bw!/tmp/me " Z = undo shell comment map Z 0dl "map Z 0dldl " z = prepend shell comment # map z mx0i#`x "map z mx0i//`x " " = remove trailing spaces from file "map " :%s/ *$//g " < = surround char with $ $; for LaTeX. "map < i$la$ map < :'a,'b< " < = repace char with &=&; for LaTeX. "map > cl&=& map > :'a,'b>