set nocompatible Syntax coloring options if has gui_running set t_Co t

  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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
set nocompatible
""
"Syntax coloring options
""
"if !has('gui_running')
" set t_Co=8 t_md=
"endif
syntax on
set background=dark
set number
set showcmd
set foldmethod=manual
""
"Indent options
""
set autoindent
set smartindent
""
"Search options
""
set hlsearch
set wrapscan
set incsearch
set ignorecase
""
"Tab indent options
""
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
""
"Wrap options
""
set wrap
set linebreak
set whichwrap+=<,>,[,]
set backspace=indent,eol,start
""
"Status line
""
set laststatus=2
set statusline=%<%f%y%m%r\ %{&encoding},%{&ff}\ %l,%c%V/%L\ %P
set history=100
""
"Backup and swap
""
set backup
set backupcopy=yes
set backupdir=$HOME/.vim/backup,.
set directory=$HOME/.vim/swap,.
""
"Encodings
""
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,cp1251,koi8-r,cp866
""
"Completion options
""
"set completeopt-=preview
"set completeopt+=longest
set completeopt=menu
""
"Window options
""
set winminwidth=0
set winminheight=0
""
"Other options
""
set mouse=a
let c_syntax_for_h=""
""
"Keymap settings
""
" No settings yet
""
"Hotkey maps
""
imap <Ins> <Esc>i
"inoremap <Nul> <C-X><C-O>
"inoremap <C-Space> <C-X><C-O>
"imap <C-@> <C-Space>
map <F2> :TlistToggle<CR>
imap <F2> <Esc>:TlistToggle<CR>
vmap <F2> <Esc>:TlistToggle<CR>
nmap <F3> :nohlsearch<CR>
imap <F3> <Esc>:nohlsearch<CR>
vmap <F3> <Esc>:nohlsearch<CR>
""
"Menu config
""
set wildmenu
set wcm=<Tab>
menu Encoding.Read.UTF-8 :e ++enc=utf-8<CR>
menu Encoding.Read.CP1251 :e ++enc=cp1251<CR>
menu Encoding.Read.KOI8-R :e ++enc=koi8-r<CR>
menu Encoding.Read.CP8666 :e ++enc=cp866<CR>
map <F7> :emenu Encoding.Read.<Tab>
menu Encoding.Write.UTF-8 :set fenc=utf-8<CR>
menu Encoding.Write.CP1251 :set fenc=cp1251<CR>
menu Encoding.Write.KOI8-R :set fenc=koi8-r<CR>
menu Encoding.Write.CP8666 :set fenc=cp866<CR>
map <S-F7> :emenu Encoding.Write.<Tab>
menu Encoding.Endline.UNIX :set fileformat=unix<CR>
menu Encoding.Endline.DOS :set fileformat=dos<CR>
menu Encoding.Endline.MAC :set fileformat=mac<CR>
map <C-F7> :emenu Encoding.Endline.<Tab>
menu Textwidth.off :set textwidth=0<CR>
menu Textwidth.on :set textwidth=80<CR>
""
"Enable plugins
""
filetype on
au BufRead,BufNewFile *.phps set filetype=php
au BufRead,BufNewFile *.phtml set filetype=php
""
"TagList settings
""
let g:Tlist_Show_One_File = 1
function! CtwUpdateCtags()
echo "Update ctags function is not setted."
endfunction
let CtwUpdateCtagsFunction = "CtwUpdateCtags"
nmap <F11> :call {CtwUpdateCtagsFunction}()<CR>
menu ctags.Update<Tab><F11> <F11>
" Switch between header file and source code in C / C++
" ,s switch to source code
" ,S switch to source in new window
" ,h switch to header
" ,H switch to header in new window
nmap ,s :call CtwSwitchToSource()<CR>
nmap ,S :call CtwSwitchToSourceN()<CR>
nmap ,h :call CtwSwitchToHeader()<CR>
nmap ,H :call CtwSwitchToHeaderN()<CR>
function! CtwSwitchToHeader()
if &filetype == "c"
find %:t:r.h
return
end
if &filetype == "cpp"
find %:t:r.hpp
return
end
endfunction
function! CtwSwitchToHeaderN()
if &filetype == "c"
sfind %:t:r.h
return
end
if &filetype == "cpp"
sfind %:t:r.hpp
return
end
endfunction
function! CtwSwitchToSource()
if &filetype == "c"
find %:t:r.c
return
end
if &filetype == "cpp"
find %:t:r.cpp
return
end
endfunction
function! CtwSwitchToSourceN()
if &filetype == "c"
sfind %:t:r.c
return
end
if &filetype == "cpp"
sfind %:t:r.cpp
return
end
endfunction
function! CtwMake()
if &filetype == "python"
write
make
return
endif
let old_tab_num = tabpagenr()
tabe
tabm
let old_buf_list = tabpagebuflist(tabpagenr())
make
let buf_list = tabpagebuflist(tabpagenr())
if old_buflist == buflist
tabc
execute 'tabn '.old_tab_num
else
setlocal foldlevel = 9999
endif
endfunction
nmap ,m :call CtwMake()<CR>
nmap ,w :cwindow<CR>
nmap ,n :cnext<CR>
nmap ,p :cprevious<CR>
nmap ,l :clist<CR>
menu Make.Make<Tab> ,m
menu Make.Make\ Window<Tab> ,w
menu Make.Next\ Error<Tab> ,n
menu Make.Previous\ Error<Tab> ,p
menu Make.Errors\ List<Tab> ,l