1
-
2
1
" Use Vim settings, rather then Vi settings (much better!).
3
2
" This must be first, because it changes other options as a side effect.
4
3
set nocompatible
5
4
5
+ "
6
+ " Vundle stuff
7
+ "
8
+ filetype off
9
+ set rtp += ~/.vim/bundle/Vundle.vim
10
+ call vundle#begin ()
11
+ " let Vundle manage Vundle - required!
12
+ Plugin ' VundleVim/Vundle.vim'
13
+
14
+ " Plugins from https://github.com/vim-scripts
15
+ " Plugin 'surround.vim'
16
+ " Plugin 'tComment'
17
+
18
+ " Plugins from github repos
19
+ Plugin ' dubek/bufferlist.vim'
20
+ Plugin ' airblade/vim-gitgutter'
21
+ Plugin ' tpope/vim-endwise'
22
+ Plugin ' tpope/vim-markdown'
23
+ Plugin ' wgibbs/vim-irblack'
24
+ Plugin ' isRuslan/vim-es6'
25
+
26
+ " Plugin 'scrooloose/nerdtree' " <-- Commented-out because it's very slow to start up
27
+
28
+ " All of your Plugins must be added before the following line
29
+ call vundle#end () " required
30
+ filetype plugin indent on " required
31
+
6
32
" Colors!
7
33
set background = dark
8
- colorscheme ir_black
34
+ " colorscheme ir_black
35
+ " hi Normal guibg=#1c1c1c
36
+ " hi StatusLine guibg=#303030
37
+ " hi StatusLineNC guibg=#303030
38
+
9
39
syntax on
10
- set guifont = Bitstream\ Vera\ Sans\ Mono:h12.00
40
+ set guifont = Bitstream\ Vera\ Sans\ Mono\ 12
41
+ " set guifont=Source\ Code\ Pro:h16.00
11
42
" set guifont=Monaco:h12
12
43
" set guifont=DejaVu\ Sans\ Mono:h13
13
- set printfont = Courier:h7
44
+ " set printfont=Courier:h7
14
45
15
46
set modeline
16
47
set modelines = 3
17
48
49
+ " show line numbers and sign column for git diff
50
+ set number
51
+
18
52
" allow backspacing over everything in insert mode
19
53
set backspace = indent ,eol ,start
20
54
@@ -45,6 +79,9 @@ if has("autocmd")
45
79
" Also load indent files, to automatically do language-dependent indenting.
46
80
filetype plugin indent on
47
81
82
+ " Enable spell-check when authoring git commits
83
+ autocmd FileType gitcommit setlocal spell
84
+
48
85
" Put these in an autocmd group, so that we can delete them easily.
49
86
augroup vimrcEx
50
87
au !
@@ -68,17 +105,35 @@ else
68
105
69
106
endif " has(" autocmd " )
70
107
108
+ if has (" cscope" )
109
+ set csto = 0
110
+ " Use Ctrl-] to search for symbol definition
111
+ set cst
112
+ set nocsverb
113
+ if filereadable (" cscope.out" )
114
+ cs add cscope .out
115
+ endif
116
+ set csverb
117
+ endif
71
118
72
119
" -----------------------------------
73
120
" dubek additions
74
121
75
-
76
122
" Disable these ~ files
77
123
set nobackup
78
124
set nowritebackup
79
125
126
+ set visualbell
127
+
80
128
highlight comment ctermfg= lightblue
81
129
130
+ " SignColumn is used to should git diff signs (gitgutter.vim plugin)
131
+ highlight SignColumn ctermbg= NONE guibg= NONE
132
+
133
+ " Tell gitgutter to slow down
134
+ let g: gitgutter_realtime = 0
135
+ let g: gitgutter_eager = 0
136
+
82
137
" Highlight redundant whitespaces and tabs at the end of the line
83
138
highlight RedundantSpaces ctermbg= red guibg= red
84
139
" match RedundantSpaces /\S\zs\s\+$/
@@ -87,50 +142,94 @@ match RedundantSpaces /\s\+$/
87
142
let ruby_space_errors = 1
88
143
highlight ExtraWhitespace ctermbg= red guibg= red
89
144
145
+ " Highlight for bad spelling; enable spelling with :set spell
146
+ highlight SpellBad cterm= underline ctermbg= NONE ctermfg= red
147
+
90
148
" Show matching brackets
91
149
set showmatch
92
150
93
151
" interactive pattern matching settings
94
152
set ignorecase smartcase
95
153
set incsearch
96
154
155
+ " show completion options above command line when hitting <Tab>
156
+ set wildmenu
157
+
97
158
" Tell Vim to quit whining about unsaved buffers when I want to open a new
98
159
" buffer. Vim just hides the unsaved buffer, instead of trying to close it.
99
160
set hidden
100
161
map <C-j> :bprev<CR>
101
162
map <C-k> :bnext<CR>
102
163
164
+ " Automatically load a file that has changed outside Vim (and hasn't changed
165
+ " inside Vim).
166
+ set autoread
167
+
103
168
" Toggle highlighting of found search terms on/off
104
169
map <F4> :set hlsearch!<CR> :set nohlsearch?<CR>
105
170
" Disable highlighting of found search terms once, with a single keystroke
106
171
map - :nohls<cr>
107
172
108
- map <leader> t :NERDTreeToggle<CR>
173
+ " Toggle view of special chars
174
+ map <F5> :set list!<CR>
175
+
176
+ " map <leader>t :NERDTreeToggle<CR>
109
177
110
178
" paste toggle
111
179
nnoremap <F2> :set invpaste paste?<CR>
112
180
set pastetoggle = <F2>
113
181
set showmode
114
182
183
+ " Load matchit.vim, but only if the user hasn't installed a newer version.
184
+ if ! exists (' g:loaded_matchit' ) && findfile (' plugin/matchit.vim' , &rtp ) == # ' '
185
+ runtime ! macros/matchit.vim
186
+ endif
187
+
188
+ " emacs-style editing on the command-line
189
+ cnoremap <C-A> <Home>
190
+ cnoremap <C-B> <Left>
191
+ cnoremap <C-D> <Del>
192
+ cnoremap <C-E> <End>
193
+ cnoremap <C-F> <Right>
194
+
115
195
"
116
196
" bufferlist plugin
117
197
"
118
- map <silent> <F3> :call BufferList()<CR>
198
+ map <leader> b :call BufferList()<CR>
119
199
let g: BufferListWidth = 25
120
200
let g: BufferListMaxWidth = 50
121
201
hi BufferSelected term = reverse ctermfg= white ctermbg= red cterm= bold
122
202
hi BufferNormal term = NONE ctermfg= black ctermbg= darkcyan cterm= NONE
123
203
124
- autocmd FileType ruby,eruby,lua,perl,tex,html,xhtml,xml set shiftwidth = 2 sts = 2 et
204
+ "
205
+ " Ag command - internally uses vim's grep
206
+ "
207
+ if executable (" ag" )
208
+ set grepprg = ag\ -- nogroup\ -- nocolor\ -- ignore - case \ -- column
209
+ set grepformat = % f :% l: % c :% m ,% f :% l: % m
210
+ command ! -nargs =+ Ag execute ' silent grep! <args>' | copen
211
+ endif
212
+
213
+ " Bind the 'K' key to search for the word under the cursor (using Ag -
214
+ " the_silver_searcher) and open the results in a quickfix window
215
+ nnoremap K :Ag<CR> :cw<CR>
216
+
217
+ " vim-go settings
218
+ let g: go_fmt_command = " goimports"
219
+
220
+ augroup dubek
221
+ autocmd !
222
+ autocmd FileType ruby,eruby,javascript,json,lua,perl,tex,vhdl,vim setlocal shiftwidth = 2 sts = 2 et
125
223
126
- autocmd FileType ruby set kp = ri
127
- autocmd FileType ruby set softtabstop = 2 |set shiftwidth = 2 |set expandtab
224
+ autocmd FileType ruby setlocal kp = ri
225
+ " autocmd FileType ruby setlocal softtabstop=2 shiftwidth=2 expandtab
226
+ autocmd FileType ruby setlocal path += lib|set path += test
128
227
129
- autocmd BufEnter *.yaml set softtabstop = 2 | set shiftwidth = 2 | set expandtab
130
- autocmd BufEnter *.yml set softtabstop = 2 | set shiftwidth = 2 | set expandtab
228
+ autocmd BufEnter *.yaml setlocal softtabstop = 2 shiftwidth = 2 expandtab
229
+ autocmd BufEnter *.yml setlocal softtabstop = 2 shiftwidth = 2 expandtab
131
230
132
- " Lua web-service
133
- autocmd BufNewFile , BufRead *.ws set ft = lua
231
+ autocmd FileType java,c,cc,cpp,d,html,xhtml,xml,xslt,html.handlebars,python,tcl,st,io setlocal shiftwidth = 4 sts = 4 et
232
+ augroup END
134
233
135
234
" Abbreviations
136
235
ab comline #----------------------------------------------------------------------------- #
0 commit comments