-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
68 lines (58 loc) · 1.57 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
set nocompatible
filetype on
filetype plugin on
set omnifunc=syntaxcomplete#Complete
set term=xterm-256color
color synic
set tabstop=2 shiftwidth=2 expandtab
set backspace=indent,eol,start
syntax on
set number
highlight ColorColumn ctermbg=235 guibg=#2c2d27
let &colorcolumn="80"
call pathogen#infect()
let NERDTreeWinSize = 25
let NERDTreeShowHidden=1
autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p
function! NERDTreeQuit()
redir => buffersoutput
silent buffers
redir END
" 1BufNo 2Mods. 3File 4LineNo
let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
let windowfound = 0
for bline in split(buffersoutput, "\n")
let m = matchlist(bline, pattern)
if (len(m) > 0)
if (m[2] =~ '..a..')
let windowfound = 1
endif
endif
endfor
if (!windowfound)
quitall
endif
endfunction
autocmd WinEnter * call NERDTreeQuit()
command -nargs=+ SReplace call StepReplace(<f-args>)
function StepReplace(...)
if a:0 == 1
let @y = input("Replace with: ", @y)
let y = @y
if @y =~ "\\d\\+$"
let n = substitute(@y, ".\\{-}\\(\\d\\+\\)$", "\\1", "") + a:1
let @y = substitute(@y, "\\(.\\{-}\\)\\d\\+$", "\\1".n, "")
endif
return y
elseif a:0 == 3
let @y = a:2
execute ".,$s/".a:1."/\\=StepReplace(".a:3.")/".(&gdefault ? "" : "g")."c"
else
echo "Usage: SReplace <search> <substitute> <increment>"
endif
endfunction
let Tlist_Use_Horiz_Window = 1
let Tlist_Auto_Update = 1
let Tlist_Close_On_Select = 1
map <F5> :TlistOpen<CR>