forked from coreyhaines/vimfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·217 lines (147 loc) · 4.41 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
" Enable pathogen
call pathogen#runtime_append_all_bundles()
" UTF-8 All the way
scriptencoding utf-8
" Use zsh.
set shell=zsh
" Enable filetype-specific indenting, syntax, and plugins
filetype plugin indent on
set nocompatible
syntax on
" Disable bell.
set vb t_vb=
" Set to auto read when a file is changed from the outside
set autoread
" COLOR SUPPORT
" Explicitly set 256 color support
" set t_Co=256
colorscheme krunktastic " github256
" TEXT SETTINGS
" Disable line wrapping
set nowrap
" set wrap
" use indents of 2 spaces, and have them copied down lines:
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
" line numbers
set number
set numberwidth=3
" kill trailing spaces when exiting file
autocmd BufWritePre * :%s/\s\+$//e
" KEY BINDINGS
let mapleader = ","
" WINDOW SPLITTING
" Open new horizontal split windows below current
set splitbelow
" Open new vertical split windows to the right
set splitright
" Set temporary directory (don't litter local dir with swp/tmp files)
set directory=/tmp/
" Use the tab complete menu
set wildmenu
" KEYBINDINGS
" Quick, jump out of insert mode while no one is looking
" imap ii <Esc>
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
" CUSTOM PLUGINS
" FuzzyFinder Path Splitting (ala textmate)
let g:fuf_splitPathMatching = 1
" Write stats to file
let g:fuf_infoFile = '~/.vim-fuf'
let g:fuf_learningLimit = 500
" CUSTOM FUNCTIONS
" Add RebuildTagsFile function/command
function! s:RebuildTagsFile()
!ctags -R --exclude=coverage --exclude=files --exclude=public --exclude=log --exclude=tmp --exclude=vendor *
endfunction
command! -nargs=0 RebuildTagsFile call s:RebuildTagsFile()
" STATUS BAR CONFIG
set laststatus=2
set statusline=\ "
set statusline+=%f\ " file name
set statusline+=[
set statusline+=%{strlen(&ft)?&ft:'none'} " filetype
set statusline+=]
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=%= " right align
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
" NERDTree CONFIGURATION
" Enable nice colors
let NERDChristmasTree = 1
" Make it easy to see where we are
let NERDTreeHighlightCursorline = 1
" Make bookmarks visible
let NERDTreeShowBookmarks = 1
" Show hidden files
let NERDTreeShowHidden = 1
" Don't hijack NETRW
let NERDTreeHijackNetrw = 0
let NERDTreeIgnore=['\.$', '\~$']
" Make F2 open NERDTree
nmap <F2> :NERDTreeToggle<CR>
" Search Config
" show the `best match so far' as search strings are typed:
set incsearch
" assume the /g flag on :s substitutions to replace all matches in a line:
set gdefault
" <leader>f to startup an ack search
map <leader>f :Ack<Space>
" RUBY
" Highlight ruby operators
let ruby_operators = 1
" Turn off rails bits of statusbar
let g:rails_statusline=0
" Clojure config
" Enable gorilla for the lisp on the jvm
let clj_want_gorilla = 0
" Highlight built-in clojure functions
let g:clj_highlight_builtins = 1
" Also highlight contrib
let g:clj_highlight_contrib = 1
" Paren Rainbow (diff colors for diff nestings)
let g:clj_paren_rainbow = 1
" Auto added used namespaces, generally be awesome
let g:clj_dynamic_highlighting = 1
" NERDCommenter
let NERDDefaultNesting = 0
let NERDRemoveExtraSpaces = 1
let NERDSpaceDelims = 1
" NERDTree
" Enable nice colors
let NERDChristmasTree = 1
" Make it easy to see where we are
let NERDTreeHighlightCursorline = 1
" Make bookmarks visible
let NERDTreeShowBookmarks = 1
" Show hidden files
let NERDTreeShowHidden = 1
" Don't hijack NETRW
let NERDTreeHijackNetrw = 0
let NERDTreeIgnore=['\.$', '\~$']
" NeoComplCache
" let g:NeoComplCache_EnableAtStartup=1
" AUTOCOMMANDS
function! CustomClojureSettings()
set filetype=clojure
endfunction
" function! CustomJsonSettings()
" autocmd BufRead *.json set filetype=json
" au! Syntax json source ~/Downloads/json.vim
" autocmd FileType json set equalprg=json_reformat
" autocmd FileType json set makeprg=jsonval\ %
" autocmd FileType json set errorformat=%E%f:\ %m\ at\ line\ %l,%-G%.%#
" endfunction
function! CustomMarkdownSettings()
set filetype=mkd
endfunction
augroup SpicyAutoCommands
autocmd BufEnter,BufWritePost *.clj call CustomClojureSettings()
autocmd BufEnter *.markdown call CustomMarkdownSettings()
" autocmd BufRead *.json call CustomJsonSettings()
" autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
" autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
" autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
augroup END