-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc_appearance
261 lines (223 loc) · 9.82 KB
/
_vimrc_appearance
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
"Vim UI
"{
if WINDOWS() && has("gui_running")
if filereadable(expand($VIMRUNTIME."/colors/molokai.vim"))
colorscheme molokai
hi StatusLine guifg=#000000 guibg=#808080
hi StatusLineNC guifg=#455354 guibg=#080808
" 常常使用这个配色 但是注释颜色不明斿
elseif filereadable(expand($VIMRUNTIME."/colors/molokai256.vim"))
colorscheme molokai256
" 常常使用这个配色 但是注释颜色不明斿
hi TabLineFill guifg=#1B1D1E guibg=#1B1D1E
hi TabLine guibg=#1B1D1E guifg=#808080 gui=none
endif
else
colorscheme desert
set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine
endif
" 当 IME 不可用的时候,使光标颜色更暗淡
if exists('+iminsert')
highlight link CursorIM Cursor
highlight Cursor guibg=Gray guifg=NONE
endif
set tabpagemax=15 " Only show 15 tabs
set showmode " Display the current mode
if has('cmdline_info')
set ruler " Show the ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids
set showcmd " Show partial commands in status line and
" Selected characters/lines in visual mode
endif
if has('statusline')
" 0: 从不显示
" 1: 需要时显示
" 2: 总是显示
set laststatus=2
set cmdheight=1 " 命令行的高度,默认为1,这里设?
let g:option_colorscheme = 0
function! Fonts(...)
set guifont=Courier_New:h64,Andale_Mono:h10,Menlo:h10,Consolas:h10
endfunction
function! GetStkStatus(...)
if (strftime("%H")==18 )
if (g:option_colorscheme!=18)
hi StatusLine guifg=#909090 guibg=#404040
let g:option_colorscheme = 18
endif
elseif (strftime("%H")==13 )
if (g:option_colorscheme!=13)
hi StatusLine guifg=#000000 guibg=#404040
let g:option_colorscheme = 13
endif
else
if (g:option_colorscheme!=0)
hi StatusLine guifg=#000000 guibg=#808080
let g:option_colorscheme = 0
endif
endif
if WINDOWS() && has("gui_running")
if globpath('d:/', 'stk.log') !=''
let file = "d:/stk.log"
let list= readfile(file)
if !empty(list)
return list[0]
else
return ""
endif
else
return ""
endif
else
endif
endfunction
" Broken down into easily includeable segments
set statusline+=
if LINUX()
set statusline+=[%f]
endif
set statusline+=%m%r%h%w
set statusline+=[%n]
set statusline+=%#error# "switch to error highlight
set statusline+=%{toupper(mode())}
set statusline+=%* "switch to error highlight
set statusline+=\|HEX=\%B
set statusline+=\|%v:%p%%/%L
set statusline+=\|%{toupper(&ff)}/%Y
set statusline+=\|
set statusline+=%{FileSize()}
set statusline+=\
set statusline+=%=
set statusline+=%{GetStkStatus()}
endif
set backspace=indent,eol,start " Backspace for dummies
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
if version >= 703
set rnu " Use relativenumber
endif
if version>=704
set breakindent showbreak=\ \ \ \ ~~
endif
set nuw=1 " nu and rnu in same column
set showmatch " Show matching brackets/parenthesis
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line high
set ignorecase " Case insensitive search
"set smartcase " Case sensitive when uc present
set wildmenu " Show list instead of just completing
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
"set foldenable " Auto fold code
"set list
" Formatting
" {
set wrap " Do not wrap long lines
set autoindent " Indent at the same level of the previous line
"Python Begin
set expandtab " Tabs are spaces, not tabs
set smartindent " Indent at the same level of the previous line
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set shiftwidth=4 " Use indents of 4 spaces
"Python End
set smarttab
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vsplit windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current
set shellslash
"set matchpairs+=<:> " Match, to be used with %
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
" Remove trailing whitespaces and ^M chars
" To disable the stripping of whitespace, add the following to your
" .vimrc.before.local file:
" let g:option_keep_trailing_whitespace = 1
autocmd FileType c,cpp,java,go,php,cs,javascript,python,twig,xml,yml autocmd BufWritePre <buffer> if !exists('g:option_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
autocmd FileType haskell setlocal expandtab shiftwidth=2 softtabstop=2
" preceding line best in a plugin but here for now.
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
autocmd FocusLost * silent! up
" Workaround vim-commentary for Haskell
autocmd FileType haskell setlocal commentstring=--\ %s
" Workaround broken colour highlighting in Haskell
autocmd FileType haskell setlocal nospell
" When save .vimrc, auto reload it
autocmd! BufWritePost *vimrc* so %
" }
" GUI Settings
" {
" GVIM- (here instead of .gvimrc)
if has('gui_running')
" a = 自动选择
" A = 自动选择无模式的选择
" c = 简单的选择使用控制台对话框而不是弹出式对话框
" e = tab页标签
" f = 前台
" i = 使用Vim图标
" m = 菜单栏
" M = 不执行系统菜单脚本 $VIMRUNTIME/menu.vim。
" g = 灰色菜单项
" t = 菜包含可撕下的菜单项
" T = 工具栏
" r = 右侧滚动条
" R = 如果有垂直分割的窗口,右边的滚动条总是存在
" l = 右边的滚动条总是存在
" L = 如果有垂直分割的窗口,左边的滚动条总是存在
" b = 底部的(水平)滚动条总是存在
" h = 限制水平滚动条的大小为光标所在行的长度
" v = 对话框使用垂直的按钮布局
set guioptions-=m " 隐藏菜单枿
set guioptions-=T " 隐藏工具枿
set guioptions-=L " 隐藏左侧滚动替
set guioptions-=r " 隐藏右侧滚动替
set guioptions-=b " 隐藏底部滚动替
set guioptions-=e " tabpage look like console tab
" 窗口尺寸
au GUIEnter * simalt ~x " 窗口启动时自动最大化
" TODO 这个选项是没必要的
if !exists("g:option_no_big_font")
if LINUX() && has("gui_running")
set guifont=Andale\ Mono\ Regular\ 16,Menlo\ Regular\ 15,Consolas\ Regular\ 16,Courier\ New\ Regular\ 18
elseif OSX() && has("gui_running")
set guifont=Andale\ Mono\ Regular:h16,Menlo\ Regular:h15,Consolas\ Regular:h16,Courier\ New\ Regular:h18
elseif WINDOWS() && has("gui_running")
set guifont=Courier_New:h11,Andale_Mono:h10,Menlo:h10,Consolas:h10
set guifont=Courier_New:h11,Andale_Mono:h10,Menlo:h10,Consolas:h10
set rop=type:directx,level:0.50,gamma:1.0,contrast:0.0,geom:1,renmode:5,taamode:1
endif
endif
else
if &term == 'xterm' || &term == 'screen'
set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine
set term=xterm-256color " for common 256 color terminals (e.g. gnome-terminal)
"set term=screen-256color " for a tmux -2 session (also for screen)
"set term=rxvt-unicode-256color " for a colorful rxvt unicode session
endif
"set term=builtin_ansi " Make arrow and other keys work
endif
" }
" Misc
" {
" Initialize directories
" {
if globpath('d:/system/rep/vita', '') !=''
cd d:\system\rep\vita
endif
set writebackup
set nobackup
set noswapfile
if has('persistent_undo')
set undodir=~/.vim/tmp/undo//
endif
" }
if v:lang =~ 'zh'
" 因为 listchars 里有双倍宽度字符,所以不能使用double值
" set ambiwidth=double
" 在中文环境下,拼写检查还不是那么好
set nospell
endif
"}