-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
177 lines (139 loc) · 2.89 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
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
set mouse=v
set bg=light
set background=dark
set nopaste
set paste
set ruler
set hidden
set hlsearch
set nohlsearch
set noincsearch
set incsearch
set tabstop=8
set softtabstop=8
set shiftwidth=8
set softtabstop=4
set shiftwidth=4
set expandtab
set encoding=utf-8
" set cindent
" set autoindent
" set textwidth=80
" set smartindent
syntax off
syntax on
" set winwidth=80
" set ignorecase
set nowrap
set wrap
" set autowrite
" imap { {<CR>}<ESC>O
map <C-J> :previous<CR>
map <C-K> :next<CR>
map <C-N> :bprevious<CR>
" map <C-M> :bnext<CR>
map <F1> :call VComment()<CR>
map <F2> :set number!<CR>
map <F3> :call CComment2()<CR>
map <F4> :call SComment()<CR>
map <F5> :call RemovePlus()<CR>
map <F6> :call Endif()<CR>
map <F7> :retab!<CR>
" map <F7> :!make<CR>:!make run<CR>
" imap <F7> <ESC>:!make<CR>:!make run<CR>
map <F8> :!make -j 32<CR>
imap <F8> <ESC>:w<ESC>:!make all<CR>
map <F9> :w<CR>:!make run<CR>
map <F10> :!make clean<CR>
" map <F11> :!make clean<CR>:!make<CR>:!make run<CR>
map <F12> :set hlsearch!<CR>
map <c-w><c-o> <c-w><c-p>
map <c-w>o <c-w><c-p>
function Syn()
:color default
:set bg=dark
endfunc
function CComment()
let line = getline(".")
if line[0][0] == "/"
:s/\/\/ //
else
:s/^/\/\/ /
endif
endfunc
function CComment2()
let line = getline(".")
if line[0][0] == "/"
:s/\/\* //
:s/ \*\///
else
:s/^/\/\* /
:s/$/ \*\//
endif
endfunc
function SComment()
let line = getline(".")
if line[0][0] == "#"
:s/^# //
else
:s/^/# /
endif
endfunc
function VComment()
let line = getline(".")
if line[0][0] == "\""
:s/^" //
else
:s/^/" /
endif
endfunc
function RemovePlus()
let line = getline(".")
if line[0][0] == "\+"
:%s/^+//
endif
endfunc
function Endif()
s/$/\r#endif/
endfunc
function OVS()
set softtabstop=4
set shiftwidth=4
set expandtab
endfunc
function Linux()
set softtabstop=8
set shiftwidth=8
set noexpandtab
endfunc
" colorscheme darkZ
" colorscheme dark-ruby
" colorscheme c
set vb t_vb= " no visual bell & flas
set laststatus=2
if &diff
colorscheme evening
endif
" highlight Normal term=none cterm=none ctermfg=White ctermbg=Black gui=none guifg=White guibg=Black
" highlight DiffAdd cterm=none ctermfg=fg ctermbg=Blue gui=none guifg=fg guibg=Blue
" highlight DiffDelete cterm=none ctermfg=fg ctermbg=Blue gui=none guifg=fg guibg=Blue
" highlight DiffChange cterm=none ctermfg=fg ctermbg=Blue gui=none guifg=fg guibg=Blue
" highlight DiffText cterm=none ctermfg=bg ctermbg=White gui=none guifg=bg guibg=White
" set noswapfile
set term=screen
" set csprg=/usr/bin/cscope
" cs add cscope.out
" For debian, add the following lines in /etc/vim/vimrc
" if has("cscope") && filereadable("/usr/bin/cscope")
" set csprg=/usr/bin/cscope
" set csto=0
" set cst
" set nocsverb
" if filereadable("cscope.out")
" cs add $PWD/cscope.out
" elseif $CSCOPE_DB != ""
" cs add $CSCOPE_DB
" endif
" set csverb
" endif
" color desert