-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·112 lines (93 loc) · 3.31 KB
/
vimrc
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
if v:progname =~? "evim"
finish
endif
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" unicode support
if has("multi_byte")
set encoding=utf-8
setglobal fileencoding=utf-8
set bomb
else
echoerr "this version of (g)Vim was not compiled with +multi_byte"
end
set nobackup " do not keep a backup file, use versions instead
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set nu
set smarttab
set tabstop=2
set shiftwidth=2
set autoindent
set expandtab
" BEGIN Adam Lowe VIM conf
" http://www.adamlowe.me/2009/12/vim-destroys-all-other-rails-editors.html
filetype off
call pathogen#runtime_append_all_bundles()
syntax on
filetype plugin indent on
" END Adam Lowe VIM conf
runtime! macros/matchit.vim
set mouse=a
set showmatch
set binary noeol
set viminfo^=!
" alt+n or alt+p to navigate between entries in QuickFix
map <silent> <M-p> :cp <CR>
map <silent> <M-n> :cn <CR>
" Minibuffer explorer settings
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
let mapleader = ";"
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
set sessionoptions=blank,buffers,curdir,folds,help,options,resize,tabpages,winsize,winpos
set grepprg=ack
set grepformat=%f:%l:%m
" mutt
" F1 through F3 rewraps paragraphs
augroup MUTT
au BufRead ~/.mutt/temp/mutt* set spell " <-- vim 7 required
au BufRead ~/.mutt/temp/mutt* nmap <F1> gqap
au BufRead ~/.mutt/temp/mutt* nmap <F2> gqqj
au BufRead ~/.mutt/temp/mutt* nmap <F3> kgqj
au BufRead ~/.mutt/temp/mutt* map! <F1> <ESC>gqapi
au BufRead ~/.mutt/temp/mutt* map! <F2> <ESC>gqqji
au BufRead ~/.mutt/temp/mutt* map! <F3> <ESC>kgqji
augroup END
" Default.
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "gvims" | if strlen(v:this_session) | exe "wviminfo! " . v:this_session . ".viminfo" | else | exe "wviminfo! " . "~/.vim/session/" . g:myfilename . ".session.viminfo" | endif | endif '
au VimLeave * exe 'if exists("g:cmd") && g:cmd == "gvims" | if strlen(v:this_session) | exe "mksession! " . v:this_session | else | exe "mksession! " . "~/.vim/session/" . g:myfilename . ".session" | endif | endif'
" highlight trailing space
match Todo /\s\+$/
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 80 characters.
autocmd FileType text setlocal textwidth=80
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
" auto remove trailing whitespace on save
" autocmd BufWritePre * :%s/\s\+$//e
augroup END
augroup twitvim
let twitvim_enable_perl = 1
let twitvim_enable_python = 1
let twitvim_enable_ruby = 1
let twitvim_enable_tcl = 1
"-- let twitvim_browser_cmd = 'uzbl'
augroup END
autocmd BufNewFile,BufRead *.flexi setf ruby
autocmd BufRead,BufNewFile *.scss setf scss
set wildmenu
set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
colorscheme railscasts