Skip to content

Instantly share code, notes, and snippets.

@dting
Created October 11, 2010 02:56
Show Gist options
  • Save dting/619902 to your computer and use it in GitHub Desktop.
Save dting/619902 to your computer and use it in GitHub Desktop.
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
autocmd BufWritePre *.py :%s/\s\+$//e
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set smartindent
set showmatch
set ignorecase
set smartcase
set autochdir
set showmode
set laststatus=2
set ruler
set guioptions-=T
set guioptions-=m
set guioptions-=r
set guioptions-=l
set incsearch
set hls
set cin
set backspace=2
fixdel
map ,if oif()<CR>{<ESC>o}<ESC>2kf(a
map ,fo ofor()<CR>{<ESC>o}<ESC>2kf(a
map ,wh owhile()<CR>{<ESC>o}<ESC>2kf(a
map ,do odo<CR>{<ESC>o}<CR>while();<ESC>^f(a
map ,sw oswitch()<CR>{<ESC>o<TAB>case:<CR>{<CR>}<CR>break;<CR><CR>default:<CR>{<CR>}<CR>break;<CR><ESC>xi}<ESC>11kf(a
map <f3> :BufExplorer<CR>
map <f10> :!p4 edit %<CR>
map <f11> :!p4 revert %
map <f12> :Bd<CR>
map <f2> :NERDTreeToggle<CR>
map <C-N><C-N> :set invnumber<CR>
map <TAB> :bn<CR>
map <S-TAB> :bp<CR>
filetype plugin on
au!
au CursorHold *.cc exec ":checktime"
au CursorHold *.h exec ":checktime"
au CursorHold SConscript exec ":checktime"
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
syntax enable
colorscheme desert
autocmd FileType python set ft=python.django " For SnipMate
autocmd FileType html set ft=htmldjango.html " For SnipMate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment