Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathvimrc
More file actions
Latest commit
279 lines (227 loc) · 5.59 KB
/
Copy pathvimrc
File metadata and controls
279 lines (227 loc) · 5.59 KB
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
" vimrc
" Author: Codegram
" Source: https://github.com/codegram/vimfiles
if!1 | finish | endif
" Use NeoBundle as the plugin manager
ifhas('vim_starting')
setnocompatible
setruntimepath+=~/.vim/bundle/neobundle.vim
endif
callneobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
" -------
" BUNDLES
" -------
NeoBundle 'jmartindf/vim-tcomment'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'mattn/webapi-vim'
NeoBundle 'mattn/gist-vim'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Townk/vim-autoclose'
NeoBundle 'scrooloose/syntastic'
" Clojure
NeoBundle 'guns/vim-clojure-static'
NeoBundle 'tpope/vim-classpath'
NeoBundle 'tpope/vim-fireplace'
NeoBundle 'guns/vim-clojure-highlight'
NeoBundle 'kien/rainbow_parentheses.vim'
NeoBundle 'tpope/vim-leiningen'
NeoBundle 'tpope/vim-projectionist'
NeoBundle 'tpope/vim-dispatch'
" Tab for completion
NeoBundle 'ervandew/supertab'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'sheerun/vim-polyglot'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'rizzatti/funcoo.vim'
NeoBundle 'rizzatti/dash.vim'
NeoBundle 'gcmt/wildfire.vim'
NeoBundle 'sjl/badwolf'
callneobundle#end()
syntaxon
filetypepluginindenton
" ----------
" Leader key
" ----------
let mapleader =","
let maplocalleader ="."
" --------
" Settings
" --------
setautoindent
setautoread
setbackspace=indent,eol,start
setbinary
setcinoptions=:0,(s,u0,U1,g0,t0
setcompleteopt=menuone,preview
setexpandtab
setfoldcolumn=0
setfoldlevel=9
setfoldmethod=indent
sethidden
sethistory=1000
sethlsearch
setignorecase
setincsearch
setgdefault
setlaststatus=2
setlist
setlistchars=trail:·
setmodelines=5
setnobackup
setnoeol
setnofoldenable
setnoswapfile
setnumber
setnumberwidth=4
setruler
setshell=/bin/bash
setshiftwidth=2
setshowcmd
setshowmatch
setsmartcase
settabstop=2
setsofttabstop=2
settitle
setencoding=utf-8
setscrolloff=3
setautoindent
setsmartindent
setshowmode
setwildmenu
setwildmode=list:longest
setvisualbell
setcursorline
setttyfast
settextwidth=78
setwildignore+=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.gitkeep,.DS_Store
settextwidth=79
setformatoptions=n
setcolorcolumn=79
settw=79
sett_Co=256
setiskeyword+=_
ifhas("gui_running")
setguioptions-=T" no toolbar
setguioptions-=m" no menus
setguioptions-=r" no scrollbar on the right
setguioptions-=R" no scrollbar on the right
setguioptions-=l" no scrollbar on the left
setguioptions-=b" no scrollbar on the bottom
setguioptions=aiA
setmouse=v
endif
autocmdBufWritePre* :%s/\s\+$//e" strip trailing whitespace
" ------------
" Vim Mappings
" ------------
nnoremap<up><nop>
nnoremap<down><nop>
nnoremap<left><nop>
nnoremap<right><nop>
inoremap<up><nop>
inoremap<down><nop>
inoremap<left><nop>
inoremap<right><nop>
nnoremapjgj
nnoremapkgk
imapjk<ESC>
" Search
nmap<Space>/
nnoremap//\v
vnoremap//\v
" Clear search
nnoremap<leader><space> :noh<cr>
" Saving and buffer stuff
nmap<leader><ESC> :q!<CR>
nmap<leader>q :wqa!<CR>
nmap<leader>w :w!<CR>
" Switch between / delete buffers
noremap<tab>:bn<CR>
noremap<S-tab>:bp<CR>
nmap<leader>d :bd<CR>
" Splits
nnoremap<leader>v :vs<CR><C-w>l
nnoremap<C-h><C-w>h
nnoremap<C-j><C-w>j
nnoremap<C-k><C-w>k
nnoremap<C-l><C-w>l
" Paste mode
setpastetoggle=<F2>
" Rename current file
function!RenameFile()
let old_name =expand('%')
let new_name =input('New file name: ', expand('%'))
if new_name !=''&& new_name != old_name
exec':saveas ' . new_name
exec':silent !rm ' . old_name
redraw!
endif
endfunction
map<leader>n :call RenameFile()<cr>
" ------------------------
" Plugin settings/mappings
" ------------------------
" Ag
nmap<leader>a :Ag
" Rotating among results
map<C-n>:cn<CR>
map<C-p>:cp<CR>
" Fugitive (Git)
nmap<leader>gs :Gstatus<CR>
nmap<leader>gc :Gcommit<CR>
vmap<leader>gb :Gblame<CR>
" GitGutter
nmapgh<Plug>GitGutterNextHunk
nmapgH<Plug>GitGutterPrevHunk
" Vim Gist
letg:gist_clip_command='pbcopy'
" let g:gist_clip_command = 'xclip -selection clipboard'
letg:gist_detect_filetype=1
letg:gist_open_browser_after_post=1
letg:gist_post_private=1
" Tagbar
nnoremap<silent><Leader>b:TagbarToggle<CR>
" Ctrlp.vim
letg:ctrlp_map='<leader>o'
letg:ctrlp_working_path_mode='ra'
map<leader>c :CtrlPTag<cr>
" TComment
map<Leader>co :TComment<CR>
" AutoClose
letg:AutoClosePairs= {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'", '#{': '}'}
letg:AutoCloseProtectedRegions= ["Character"]
" Ctags
" You can use Ctrl-] to jump to a function.... Ctrl-p will jump back
map<C-\>:tab split<CR>:exec("tag ".expand("<cword>"))<CR>
" You can cycle through multiple function definitions using
" these mappings. This maps to my windows key + left/right arrows
map<F7>:tnext<CR>
map<F9>:tprev<CR>
" Syntastic
letg:syntastic_check_on_open=1
letg:syntastic_echo_current_error=0
letg:syntastic_auto_jump=0
letg:syntastic_auto_loc_list=0
" Clojure
auVimEnter* RainbowParenthesesToggle
auSyntax* RainbowParenthesesLoadRound
auSyntax* RainbowParenthesesLoadSquare
auSyntax* RainbowParenthesesLoadBraces
" Wildfire
nmap<leader>s <Plug>(wildfire-quick-select)
" --------------------
" CUSTOM CONFIGURATION
" --------------------
let my_home =expand("$HOME/")
iffilereadable(my_home . '.vimrc.local')
source~/.vimrc.local
endif
if &term=~ '256color'
" Disable Background Color Erase (BCE) so that color schemes
" work properly when Vim is used inside tmux and GNU screen.
" See also http://snk.tuxfamily.org/log/vim-256color-bce.html
sett_ut=
endif
colorscheme badwolf
NeoBundleCheck