-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
278 lines (257 loc) · 7.67 KB
/
Copy path.vimrc
File metadata and controls
278 lines (257 loc) · 7.67 KB
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
" tabs
set paste
set tabstop=4
set shiftwidth=4
set smarttab
set autoindent
set smartindent
set expandtab
set tabpagemax=100
map <C-Left> :tabprev<CR>
map <C-Right> :tabnext<CR>
map <C-n> :tabnew
" navigation arrow
set nocp
" ignore registry
"set ic
" color find
set hls
" incremental search
set is
" default encode
set encoding=utf-8
" term encode (must coincide "encoding")
set termencoding=utf-8
" file encodings and sequence determination
set fileencodings=utf8,cp1251,koi8-r
" fix backspace in CentOS
set backspace=indent,eol,start
" default colorscheme
colorscheme my
" ru map
map ё `
map й q
map ц w
map у e
map к r
map е t
map н y
map г u
map ш i
map щ o
map з p
map х [
map ъ ]
map ф a
map ы s
map в d
map а f
map п g
map р h
map о j
map л k
map д l
map ж ;
map э '
map я z
map ч x
map с c
map м v
map и b
map т n
map ь m
map б ,
map ю .
map Ё ~
map Й Q
map Ц W
map У E
map К R
map Е T
map Н Y
map Г U
map Ш I
map Щ O
map З P
map Х {
map Ъ }
map Ф A
map Ы S
map В D
map А F
map П G
map Р H
map О J
map Л K
map Д L
map Ж :
map Э "
map Я Z
map Ч X
map С C
map М V
map И B
map Т N
map Ь M
map Б <
map Ю >
""" HIGHLIGHT
" default syntax on
syntax on
" my highlight group
highlight ExtraWhitespace ctermbg=red guibg=red
" Show trailing whitepace
" and spaces before a tab
" and spaces used for indenting (so you use only tabs for indenting):
match ExtraWhitespace /\s\+$\| \+\ze\t\|\t\+/
" auto chmod
au BufWritePost * if getline(1) =~ "^#!.*/bin/"|silent !chmod a+x %
" highlight MySQL
if has("autocmd")
autocmd BufRead *.sql set filetype=mysql
endif
" highlight config files
autocmd BufReadPost config set filetype=config
if version >= 714
" highlight trailing spaces
au BufNewFile,BufRead * let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
" highlight tabs between spaces
au BufNewFile,BufRead * let b:mtabbeforesp=matchadd('ErrorMsg', '\v(\t+)\ze( +)', -1)
au BufNewFile,BufRead * let b:mtabaftersp=matchadd('ErrorMsg', '\v( +)\zs(\t+)', -1)
" highlight string longer than eighty symbol
au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>177v', -1)
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>180v.\+', -1)
endif
" set tabs settings for html files
augroup html
autocmd!
autocmd BufRead,BufNewFile *.html match none
autocmd BufRead,BufNewFile *.html set shiftwidth=2
autocmd BufRead,BufNewFile *.html set tabstop=2
autocmd BufRead,BufNewFile *.html set smarttab
autocmd BufRead,BufNewFile *.html set expandtab
autocmd BufRead,BufNewFile *.html set autoindent
autocmd BufRead,BufNewFile *.html set smartindent
autocmd BufNewFile,BufRead *.html let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
augroup END
augroup xml
autocmd!
autocmd BufRead,BufNewFile *.xml match none
autocmd BufRead,BufNewFile *.xml set shiftwidth=4
autocmd BufRead,BufNewFile *.xml set tabstop=4
autocmd BufRead,BufNewFile *.xml set smarttab
autocmd BufRead,BufNewFile *.xml set expandtab
autocmd BufRead,BufNewFile *.xml set autoindent
autocmd BufRead,BufNewFile *.xml set smartindent
autocmd BufNewFile,BufRead *.xml let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
augroup END
augroup yml
autocmd!
autocmd BufRead,BufNewFile *.yml* match none
autocmd BufRead,BufNewFile *.yml* set shiftwidth=2
autocmd BufRead,BufNewFile *.yml* set tabstop=2
autocmd BufRead,BufNewFile *.yml* set smarttab
autocmd BufRead,BufNewFile *.yml* set expandtab
autocmd BufRead,BufNewFile *.yml* set autoindent
autocmd BufRead,BufNewFile *.yml* set smartindent
autocmd BufNewFile,BufRead *.yml* let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
augroup END
augroup yaml
autocmd!
autocmd BufRead,BufNewFile *.yaml* match none
autocmd BufRead,BufNewFile *.yaml* set shiftwidth=2
autocmd BufRead,BufNewFile *.yaml* set tabstop=2
autocmd BufRead,BufNewFile *.yaml* set smarttab
autocmd BufRead,BufNewFile *.yaml* set expandtab
autocmd BufRead,BufNewFile *.yaml* set autoindent
autocmd BufRead,BufNewFile *.yaml* set smartindent
autocmd BufNewFile,BufRead *.yaml* let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
autocmd BufNewFile,BufRead *.yaml* let b:mtrailingws=matchadd('ErrorMsg', '\t\+', -1)
augroup END
augroup eyaml
autocmd!
autocmd BufRead,BufNewFile *.eyaml* match none
autocmd BufRead,BufNewFile *.eyaml* set shiftwidth=2
autocmd BufRead,BufNewFile *.eyaml* set tabstop=2
autocmd BufRead,BufNewFile *.eyaml* set smarttab
autocmd BufRead,BufNewFile *.eyaml* set expandtab
autocmd BufRead,BufNewFile *.eyaml* set autoindent
autocmd BufRead,BufNewFile *.eyaml* set smartindent
autocmd BufNewFile,BufRead *.eyaml* let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
autocmd BufNewFile,BufRead *.eyaml* let b:mtrailingws=matchadd('ErrorMsg', '\t\+', -1)
augroup END
augroup py
autocmd!
autocmd BufRead,BufNewFile *.py* match none
autocmd BufRead,BufNewFile *.py* set shiftwidth=4
autocmd BufRead,BufNewFile *.py* set tabstop=4
autocmd BufRead,BufNewFile *.py* set smarttab
autocmd BufRead,BufNewFile *.py* set expandtab
autocmd BufRead,BufNewFile *.py* set autoindent
autocmd BufRead,BufNewFile *.py* set smartindent
autocmd BufNewFile,BufRead *.py* let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
augroup END
augroup tf
autocmd!
autocmd BufRead,BufNewFile *.tf match none
autocmd BufRead,BufNewFile *.tf set shiftwidth=2
autocmd BufRead,BufNewFile *.tf set tabstop=2
autocmd BufRead,BufNewFile *.tf set smarttab
autocmd BufRead,BufNewFile *.tf set expandtab
autocmd BufRead,BufNewFile *.tf set autoindent
autocmd BufRead,BufNewFile *.tf set smartindent
autocmd BufNewFile,BufRead *.tf let b:mtrailingws=matchadd('ErrorMsg', '\s\+$', -1)
augroup END
augroup golang
autocmd!
autocmd BufRead,BufNewFile *.go match none
autocmd BufRead,BufNewFile *.go set shiftwidth=4
autocmd BufRead,BufNewFile *.go set tabstop=4
autocmd BufRead,BufNewFile *.go set smarttab
autocmd BufRead,BufNewFile *.go set noexpandtab
autocmd BufRead,BufNewFile *.go set autoindent
autocmd BufRead,BufNewFile *.go set smartindent
autocmd BufNewFile,BufRead *.go let b:mtrailingws=matchadd('ErrorMsg', 's\+$', -1)
autocmd BufNewFile,BufRead *.go let b:mtrailingws=matchadd('ErrorMsg', '/\s\+$\| \+\ze\t\|^\t*\zs \+/', -1)
augroup END
augroup gomod
autocmd!
autocmd BufRead,BufNewFile *.mod match none
autocmd BufRead,BufNewFile *.mod set shiftwidth=4
autocmd BufRead,BufNewFile *.mod set tabstop=4
autocmd BufRead,BufNewFile *.mod set smarttab
autocmd BufRead,BufNewFile *.mod set noexpandtab
autocmd BufRead,BufNewFile *.mod set autoindent
autocmd BufRead,BufNewFile *.mod set smartindent
autocmd BufNewFile,BufRead *.mod let b:mtrailingws=matchadd('ErrorMsg', 's\+$', -1)
autocmd BufNewFile,BufRead *.mod let b:mtrailingws=matchadd('ErrorMsg', '/\s\+$\| \+\ze\t\|^\t*\zs \+/', -1)
augroup END
" fix term in screen
if match($TERM, "screen")!=-1
set term=xterm-256color
set t_ut=
let g:GNU_Screen_used = 1
else
set t_ut=
let g:GNU_Screen_used = 0
endif
" screen-ify an external command.
function InScreen(command)
return g:GNU_Screen_used ? 'screen '.a:command : a:command
endfunction
" for get settings from comment in file
set modeline
set modelines=5
set hidden
function OldTabs()
:set tabstop=8
:set shiftwidth=8
:set noexpandtab
:match ExtraWhitespace /\s\+$\| \+\ze\t\|^\t*\zs \+/
endfunction
map <C-O> :call OldTabs()
" Return to last edit position when opening files
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif