Skip to content

Commit 0211f51

Browse files
committed
Update vimrc
1 parent 5a10749 commit 0211f51

File tree

1 file changed

+113
-14
lines changed

1 file changed

+113
-14
lines changed

vimrc

+113-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
1-
21
" Use Vim settings, rather then Vi settings (much better!).
32
" This must be first, because it changes other options as a side effect.
43
set nocompatible
54

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+
632
" Colors!
733
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+
939
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
1142
" set guifont=Monaco:h12
1243
" set guifont=DejaVu\ Sans\ Mono:h13
13-
set printfont=Courier:h7
44+
" set printfont=Courier:h7
1445

1546
set modeline
1647
set modelines=3
1748

49+
" show line numbers and sign column for git diff
50+
set number
51+
1852
" allow backspacing over everything in insert mode
1953
set backspace=indent,eol,start
2054

@@ -45,6 +79,9 @@ if has("autocmd")
4579
" Also load indent files, to automatically do language-dependent indenting.
4680
filetype plugin indent on
4781

82+
" Enable spell-check when authoring git commits
83+
autocmd FileType gitcommit setlocal spell
84+
4885
" Put these in an autocmd group, so that we can delete them easily.
4986
augroup vimrcEx
5087
au!
@@ -68,17 +105,35 @@ else
68105

69106
endif " has("autocmd")
70107

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
71118

72119
" -----------------------------------
73120
" dubek additions
74121

75-
76122
" Disable these ~ files
77123
set nobackup
78124
set nowritebackup
79125

126+
set visualbell
127+
80128
highlight comment ctermfg=lightblue
81129

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+
82137
" Highlight redundant whitespaces and tabs at the end of the line
83138
highlight RedundantSpaces ctermbg=red guibg=red
84139
" match RedundantSpaces /\S\zs\s\+$/
@@ -87,50 +142,94 @@ match RedundantSpaces /\s\+$/
87142
let ruby_space_errors = 1
88143
highlight ExtraWhitespace ctermbg=red guibg=red
89144

145+
" Highlight for bad spelling; enable spelling with :set spell
146+
highlight SpellBad cterm=underline ctermbg=NONE ctermfg=red
147+
90148
" Show matching brackets
91149
set showmatch
92150

93151
" interactive pattern matching settings
94152
set ignorecase smartcase
95153
set incsearch
96154

155+
" show completion options above command line when hitting <Tab>
156+
set wildmenu
157+
97158
" Tell Vim to quit whining about unsaved buffers when I want to open a new
98159
" buffer. Vim just hides the unsaved buffer, instead of trying to close it.
99160
set hidden
100161
map <C-j> :bprev<CR>
101162
map <C-k> :bnext<CR>
102163
164+
" Automatically load a file that has changed outside Vim (and hasn't changed
165+
" inside Vim).
166+
set autoread
167+
103168
" Toggle highlighting of found search terms on/off
104169
map <F4> :set hlsearch!<CR>:set nohlsearch?<CR>
105170
" Disable highlighting of found search terms once, with a single keystroke
106171
map - :nohls<cr>
107172
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>
109177

110178
" paste toggle
111179
nnoremap <F2> :set invpaste paste?<CR>
112180
set pastetoggle=<F2>
113181
set showmode
114182

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+
115195
"
116196
" bufferlist plugin
117197
"
118-
map <silent> <F3> :call BufferList()<CR>
198+
map <leader>b :call BufferList()<CR>
119199
let g:BufferListWidth = 25
120200
let g:BufferListMaxWidth = 50
121201
hi BufferSelected term=reverse ctermfg=white ctermbg=red cterm=bold
122202
hi BufferNormal term=NONE ctermfg=black ctermbg=darkcyan cterm=NONE
123203

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
125223

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
128227

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
131230

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
134233

135234
" Abbreviations
136235
ab comline #-----------------------------------------------------------------------------#

0 commit comments

Comments
 (0)