summaryrefslogtreecommitdiffstats
path: root/software/vim
diff options
context:
space:
mode:
authorbnewbold <bnewbold@eta.mit.edu>2009-02-03 06:07:56 -0500
committerbnewbold <bnewbold@eta.mit.edu>2009-02-03 06:07:56 -0500
commit95a9589201696dfe00a9219e5c2586bfec15339b (patch)
treece1d69f874163022bf027924b1d522937d70e483 /software/vim
parent3930f5c35bfbd42ad85e7139a5bff6f5fe665e28 (diff)
downloadknowledge-95a9589201696dfe00a9219e5c2586bfec15339b.tar.gz
knowledge-95a9589201696dfe00a9219e5c2586bfec15339b.zip
vim, scheme updates
Diffstat (limited to 'software/vim')
-rw-r--r--software/vim38
1 files changed, 38 insertions, 0 deletions
diff --git a/software/vim b/software/vim
new file mode 100644
index 0000000..76ffa24
--- /dev/null
+++ b/software/vim
@@ -0,0 +1,38 @@
+============
+It's vim!
+============
+
+Typical .vimrc
+------------------
+Here's what a typical ``.vimrc`` looks like for me::
+
+ if has('syntax') && (&t_Co > 2)
+ syntax on
+ endif
+
+ set history=50
+ set wildmode=list:longest,full
+ set showmode
+ set showcmd
+ set smartcase
+ set shiftwidth=4
+ set tabstop=4
+ set shiftround
+ set expandtab
+ set autoindent
+
+ autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except, finally,def,class
+
+Commands
+-------------
+I search and replace globally a lot::
+
+ :%s/before/after/g
+
+Tricks
+-------------
+I often want to pull a particular gnarly line or two from another file; here's
+the command I use to grab three lines of context around 'phrase'::
+
+ :r!grep -A 3 'phrase' ../otherfile.txt
+