forked from spicycode/Vimlander-2-The-Quickening
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vimrc
executable file
·206 lines (139 loc) · 4.25 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
" Enable pathogen
call pathogen#runtime_append_all_bundles()
" UTF-8 All the way
scriptencoding utf-8
set shell=bash
" Enable filetype-specific indenting, syntax, and plugins
filetype plugin indent on
set nocompatible
syntax on
" set spell spelllang=en_us
" Disable bell.
set vb t_vb=
" Set to auto read when a file is changed from the outside
set autoread
set formatprg=par
" COLOR SUPPORT
" Explicitly set 256 color support
" set t_Co=256
colorscheme github256 "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
" 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 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>
nnoremap <leader>h <Esc>:call EasyMode()<CR>
nnoremap <leader>H <Esc>:call HardMode()<CR>
" 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
augroup CoreysMadMappings
map <leader>1 :on<cr>:AV<cr>
augroup END