-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
133 lines (101 loc) · 3.05 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
runtime! autoload/pathogen.vim
if exists('g:loaded_pathogen')
call pathogen#runtime_prepend_subdirectories(expand('~/.vimbundles'))
end
set nocompatible
"set noautochdir
set hidden
" make tabcomplete more like shell, i.e. complete to the last common character
set wildmode=list:longest
" ignore case when searching
set ignorecase
set smartcase
" show title in terminal
set title
set autoread
set autowrite
set splitright
set splitbelow
" keep more space around the cursor when scrolling
set scrolloff=3
" show line numbers and the ruler
set ruler
set number
" hilight cursor line
set cursorline
" indenting and tab settings
set autoindent
set smartindent
set tabstop=2
set shiftwidth=2
set t_Co=256
:colorscheme ir_dark
let mapleader = ","
let maplocalleader = ","
" hilight lines longer than 80 chars
nnoremap <silent> <Leader>l
\ :if exists('w:long_line_match') <Bar>
\ silent! call matchdelete(w:long_line_match) <Bar>
\ unlet w:long_line_match <Bar>
\ elseif &textwidth > 0 <Bar>
\ let w:long_line_match = matchadd('ErrorMsg', '\%>'.&tw.'v.\+', -1) <Bar>
\ else <Bar>
\ let w:long_line_match = matchadd('ErrorMsg', '\%>80v.\+', -1) <Bar>
\ endif<CR>
" incremental search wins
set incsearch
" so that tmp files dont create junk in project directories
set backupdir=~/.vim/backup
set directory=~/.vim/tmp
" make backspace go over everything
set backspace=indent,eol,start
" filetype stuff
syntax on
filetype on
filetype plugin on
filetype indent on
" enable mouse
set mouse=a
" some nice completions
imap jj <Esc>
imap uu _
imap hh =>
imap aa @
" invisible characters
set listchars=trail:.,tab:>-,eol:$
set nolist
:noremap <Leader>i :set list!<CR> " Toggle invisible chars
" for Markdown
augroup mkd
autocmd BufRead *.mkd,*.mdown,*.markdown set ai formatoptions=tcroqn2 comments=n:>
augroup END
" for Ruby
autocmd BufRead *.ru,*.rb,*.rbx,*.gem,*.gemspec,[rR]antfile,*.rant,[rR]akefile* set formatoptions=tcoq expandtab shiftwidth=2 tabstop=2
" Omni Completion
autocmd FileType html :set omnifunc=htmlcomplete#CompleteTags
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
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
" May require ruby compiled in
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby compiler ruby
" NERDtree keybinds
noremap <Leader>n :NERDTreeToggle<CR>
let NERDTreeMouseMode=1
" fuzzyfinder_textmate
map <Leader>f :FuzzyFinderTextMate<CR>
map <Leader>b :FuzzyFinderBuffer<CR>
" Nice statusbar
set laststatus=2
set statusline=\
set statusline+=%f\
set statusline+=%{fugitive#statusline()}\
set statusline+=[
set statusline+=%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&fileformat}] " file format
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=%= " right align
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset