From f61026119df4700f69eb73e95620bc5928ca0fcb Mon Sep 17 00:00:00 2001 From: User Date: Tue, 13 Oct 2009 02:52:09 +0000 Subject: Grand rename for gitit transfer --- software/vim.page | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 software/vim.page (limited to 'software/vim.page') diff --git a/software/vim.page b/software/vim.page new file mode 100644 index 0000000..76ffa24 --- /dev/null +++ b/software/vim.page @@ -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 + -- cgit v1.2.3