Document Actions

Vim Configuration

My ~/.vimrc file for use on the Eee PC.

" Vim configuration file by Kiran Jonnalagadda
" ---------------------------------------------------------------------

" Editor configuration
set nocompatible
set et
set ai
set sw=4
set ts=8
set si
set is
set ic
set sm
set sta
set popt=number:y
syn on
set backspace=indent,eol,start
set hlsearch
set mousehide
set ruler
set laststatus=2
set nobackup
set nowritebackup
set directory=/tmp/
set display=lastline
let Tlist_Ctags_Cmd="/usr/bin/ctags"
set wildmenu

" Turn off toolbar
set guioptions-=T

" Set wordwrap
set linebreak wrap nolist

" Cursor key remapping
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk

" File explorer configuration
let g:explDetailedList=0
let g:explWinSize=5
let g:explHideFiles='^\.,\.pyc$'
function MyFileHandler(fn)
  exec "silent! !gvim " . escape(a:fn,' \%#(){}&[];`"' . "'")
endfunction
let g:explFileHandler = 'MyFileHandler'

" Grep plugin configuration
let Grep_Key = '<F10>'
let Grep_Default_Options = '-i'
let Grep_Default_Filelist = '*.py *.pt *.dtml'
let Grep_Find_Path = '/usr/bin/find'
let Grep_Xargs_Path = '/usr/bin/xargs'

" Open multiple files in tabs.
autocmd BufReadPost * tab ball

" Special handling for some file formats.
" au FileType python source ~/.vim/scripts/python.vim
" au FileType python,html,xml,xsl,dtml,c,dtd set tw=72
au FileType make set noet
hi Folded guibg=gray15 guifg=gray50
au FileType python set foldmethod=indent
au BufNewFile,BufRead *.dtml set ft=dtml
au BufNewFile,BufRead *.css.dtml set ft=cs
au BufNewFile,BufRead *.pt set ft=html
au BufNewFile,BufRead *.cpt set ft=html
au FileType html,xml,xsl,dtml source ~/.vim/scripts/closetag.vim
au FileType html,xml,xsl,dtml,dtd set sw=2
au FileType rst set ft=rest spell linebreak wrap nolist
au FileType rst syn on
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``

autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete

" Commands to clean up Vim's syntax-highlighting-to-HTML conversion
com -nargs=1 -range=% DelTag
    \ :<line1>,<line2>s/<lt><args>.\{-\}>//g|:<line1>,<line2>s/<lt>\/<args>>//g
com -nargs=1 -range=% DelTagContent
    \ :<line1>,<line2>s/<lt><args>.\{-\}>\{-\}<lt>\/<args>>//g
com -range=% Font2Span :<line1>,<line2>s/<lt>font color=\"/<lt>span
    \ style=\"color:\ /g|<line1>,<line2>s/<lt>\/font>/<lt>\/span>/g

" GUI specific configuration
if has("gui_running")
    set list
    set lcs=tab:»·,trail:·,extends:»,precedes:<c2><ab>
    "hi NonText guifg=gray14
    "hi SpecialKey guifg=gray14
    "set km=startsel,stopsel
    "hi LineNr guifg=gray guibg=gray30
    "hi LineNr guifg=black guibg=gray90
    "hi SpecialKey guifg=gray90
    set co=95
    set lines=47
    set nu
    "set guifont=-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-m-*-iso8859-1
    "set guifont=LucidaTypewriter\ 12
    set gfn=Monospace\ 8
    behave mswin
endif

if has("gui_macvim")
    let macvim_hig_shift_movement = 1
    set transparency=0
    set gfn=Lucida\ Sans\ Typewriter:h12
endif


" PyDiction configuration
" if has("autocmd")
"     autocmd FileType python set complete+=k~/.vim/pydiction isk+=.,(
" endif

" Plugin for editing files in a Zope server
" if has("python")
"     source ~/.vim/scripts/zope.vim
" endif
filetype plugin indent on
syntax on
Last modified 2008-05-27 22:46
Calendar
« July 2009 »
Su Mo Tu We Th Fr Sa
1234
567891011
12131415161718
19202122232425
262728293031
Navigation
Where are you?

Locations of visitors to this page

Geo Visitors Map