-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·95 lines (74 loc) · 2.77 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
" Created 22.12.2006 by ddvlad
" Add modeline functionality -- it's disabled by default on some distros
set modeline
filetype plugin on
" Mapping from usenet.
imap jj <Esc>
set autowrite
set dir=/tmp
" Ripped off from Alexandru Mosoi
set statusline=%<%f\ %y%h%m%r%=%-24.(0x%02B,%l/%L,%c%V%)\ %P
set laststatus=2
set wildmenu
" quick fixing
nnoremap <Tab> :cnext<Cr>
nnoremap <S-Tab> :cprev<Cr>
" /ripoff
" Ripped off from Cosmin Ratiu, on SO list; 30 Jun 2009
if has("cscope")
" Look for a 'cscope.out' file starting from the current directory,
" going up to the root directory.
let s:dirs = split(getcwd(), "/")
while s:dirs != []
let s:path = "/" . join(s:dirs, "/")
if (filereadable(s:path . "/cscope.out"))
execute "cs add " . s:path . "/cscope.out " . s:path . " -v"
break
endif
let s:dirs = s:dirs[:-2]
endwhile
set csto=0 " Use cscope first, then ctags
set cst " Only search cscope
set csverb " Make cs verbose
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
" Open a quickfix window for the following queries.
set cscopequickfix=s-,c-,d-,i-,t-,e-,g-
endif
" More tabs -- we have enough memory.
set tabpagemax=20
" Mark tabs and spaces
set list listchars=tab:»\ ,trail:·,extends:»,precedes:«
map Q gq
" Ripped off from Bee on vim_use mailing list
" Space as PageDown like web browser
nmap <Space> <PageDown>
vmap <Space> <PageDown>
" /ripoff
" Highlight current line
"set cursorline
" Open new vertical splits to the right of current one.
set splitright
set hidden
set smartcase
"alexj
set textwidth=72
set mouse-=a
set backspace=2
set hlsearch
nmap ,t <Esc>:tabnew<CR>
nmap ,e <Esc>:tabnew<CR>:e·