My .vimrc

Vim

Public Domain

.vimrc as of 9/9/2011

Download (right click, save as, rename as appropriate)

Embed

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
let mapleader = ";"

map <F2> :NERDTreeToggle<CR>
map <Leader>f :NERDTreeToggle<CR>
map <S-F2> :TlistToggle<CR>
map <F3> :tabp<CR>
map <F4> :tabn<CR>
imap <M-j> <Esc>
imap <D-j> <Esc>
imap <M-k> <C-x><C-o>
imap <D-k> <C-x><C-o>
map <Leader>r :! rspec %<CR>
map <Leader>p :! ez-promote %<CR>
map <Leader>e :! p4 edit %<CR>
map <F11> :call DoWordComplete()<CR>
map <F12> :call EndWordComplete()<CR>
map <F6> :setfiletype html<CR>
map <F7> :call Rebuild_tags()<CR><CR>

":Arpeggio inoremap jk <Esc>
call arpeggio#map('i', '', 0, 'jk', '<Esc>')
call arpeggio#map('i', '', 0, 'JK', '<Esc>')

set wildignore+=/media/**,/home/alan/media/**,/home/alan/Music/**,cnu_gems/**,cabar/**,*.scssc

let g:CommandTMaxFiles=50000


set autoindent
set backspace=indent,eol,start
set completeopt=menu

set dictionary=/usr/share/dict/words
"set complete-=k complete+=k


set expandtab
set history=300
set incsearch
set modeline
set nocompatible
set ruler
set showcmd
set showmatch
set smartindent
set sw=4
set tabpagemax=30
set ts=4
set so=7
set wildmenu
syn on

colorscheme lucius

if has("gui_running")
  set spellfile=~/.vim/spellfile.add
  setlocal spell spelllang=en_us
  set spell
  set guioptions-=m
  set guioptions-=T
  let g:no_html_toolbar = 'yes'

  set cursorline
endif

if has("gui_macvim")
    let Tlist_Ctags_Cmd='/opt/local/bin/ctags'
    set gfn=Menlo\ Regular:h14
endif

filetype on
filetype plugin on
filetype indent on 
set ofu=syntaxcomplete#Complete 

set dir=/tmp//,.

set background=dark

hi Search		  ctermbg=red		ctermfg=0		cterm=none
hi IncSearch 	ctermbg=red		ctermfg=0		cterm=none

" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vimrc

let NERDTreeIgnore=['.pyc$',]



function! Set_ruby_env()
    autocmd!
    set sw=2
    set ts=2
    syn on
endfunction

function! Rebuild_tags ()
    if filereadable('settings.py') && filereadable('manage.py')
        silent! !ctags -R --exclude=*.sql --exclude=*.tar . &
    endif
endfunction

function! Set_htmldjango()
    if filereadable('settings.py') && filereadable('manage.py')
        setfiletype htmldjango
    endif
endfunction


    "augroup EditHTML
		"autocmd!
        "autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
    "augroup END


let g:closetag_html_style=1

hi Normal           guibg=#000000
hi Normal           ctermbg=256

"au FileType python set omnifunc=pythoncomplete#Complete
"au FileType javascript set omnifunc=javascriptcomplete#CompleteJS
"au FileType html set omnifunc=htmlcomplete#CompleteTags
"au FileType css set omnifunc=csscomplete#CompleteCSS
"au FileType xml set omnifunc=xmlcomplete#CompleteTags
"au FileType php set omnifunc=phpcomplete#CompletePHP
"au FileType c set omnifunc=ccomplete#Complete
"au BufReadPost * silent loadview
"au BufNewFile,BufRead *.j setf objj 
"au BufReadPost * :call Rebuild_tags()
"au BufReadPost * :syn on
"au BufWritePost *.py :call Rebuild_tags()
"au BufWritePost *.js :call Rebuild_tags()
"au BufReadPost *.html :call Set_htmldjango()
"au Filetype html,xml,xsl,php source ~/.vim/scripts/closetag.vim 
au FileType ruby :call Set_ruby_env()
"au BufWritePost *.scss :setfiletype sass