-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc_gvim
257 lines (219 loc) · 7.54 KB
/
_vimrc_gvim
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
"System
set nocompatible "不使用vi
language en
"操作
set history=100 "history中需要记录的行数
set confirm "未保存时提示
set backspace=2 "退格键正常使用
set tabstop=4 "tab显示为4格
set expandtab "tab为4空格而不是制表符
"auto correct spelling error
autocmd BufRead,BufNewFile *.md set spell | set spelllang=en,cjk
"set spelllang=en,cjk
inoremap <C-l> <c-g>u<Esc>[s1z=']a<c-g>u
autocmd FileType markdown set spell spelllang=en,cjk
set langmenu=en_US.UTF-8
" 检测函数(检测光标位置处文字的样式名)
function! <SID>SynStack()
echo map(synstack(line('.'),col('.')),'synIDattr(v:val, "name")')
endfunc
" 绑定检测键位(按键后样式名信息会输出在指令栏的位置)
nnoremap <leader>yi :call <SID>SynStack()<CR>
"文件格式
"set fileencodings=utf-8,gb312,gb18030,gbk,ucs-bom,cp936,latin1
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030
set encoding=utf8
"============================================================gvim美化
"set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI "gvim字体
"set guifont=Anonymice_Powerline:h11:cANSI
set guifont=Fira_Code:h10:cANSI:qDRAFT
"some tips of Fira_Code
"set renderoptions=type:directx
"set encoding=utf-8
"Ctrl+L for manual Ligature
"https://github.com/tonsky/FiraCode/issues/462
set gfw=幼圆:h10.5:cGB2312
set guicursor=a:block-blinkon0 "取消光标闪烁
set clipboard+=unnamed "与win共享剪贴板
set guioptions-=m "删去菜单栏
set guioptions-=T "删去工具栏
set guioptions-=r "删去滚动条
"----------查看gvim文件夹的相关插件
"au GuiEnter * call libcallnr("vimtweak64.dll", "SetAlpha", 200)
"map <f10> <esc>:call libcallnr("vimtweak64.dll", "setalpha", 200)<cr>
"map <F11> <Esc>:call libcallnr("gvimfullscreen_64.dll", "ToggleFullScreen", 0)<CR>
"map <F12> <Esc>:call libcallnr("vimtweak64.dll", "EnableTopMost", 1)<CR>
"环境设置
"显示
set number relativenumber "显示相对行号
set nonu "行号
"set conceallevel=2 "缩略显示
set conceallevel=0 "缩略显示
set concealcursor="nc"
let g:tex_conceal='abdmg'
set wrap "自动换行
syntax on "语法匹配
syntax enable
colorscheme molokai
set background=dark
set showmatch "匹配括号
set matchtime=5 "匹配括号显示时间
set lcs=tab:>-,lead:.,trail:_,extends:>,precedes:< "空格符显示列表
set list "是否显示空格符
set ambiwidth=double "设置双字宽显示, 显示部分完整字体
set vb t_vb=
au GuiEnter * set t_vb=
set nofoldenable "禁止折叠
set cursorcolumn "十字架
set cursorline
":h gcr/:h guicursor
set gcr=n:block-blinkon0-nCursor
"set gcr=c:ver40-blinkon0-ncursor
set gcr=c:block-blinkon0-ncursor
"set gcr=i:ver40-blinkon0-icursor
set gcr=i:block-blinkon0-icursor
set gcr=v:hor30-blinkon0-vCursor
"-----------------key map---------------------------
imap jj <Esc>:w<CR>
nmap G Gzz
nmap P o<Esc>p
"--------------Vim-plug--------------
call plug#begin('~\vimfiles\vim-plug')
"---markdown
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'mzlogin/vim-markdown-toc'
"Plug 'dkarter/bullets.vim'
Plug 'sirver/ultisnips'
Plug 'iamcco/markdown-preview.nvim', {'do':{-> mdkp#util#install()}, 'for':['markdown','vim-plug']}
Plug 'tpope/vim-surround'
Plug 'itchyny/lightline.vim'
Plug 'zhmars/gvimtweak'
"Plug 'jiangmiao/auto-pairs'
"Plug 'ZSaberLv0/ZFVimIM'
"Plug 'ZSaberLv0/ZFVimJob'
call plug#end()
"***************************************
"--------------Plugin-settings----------
"***************************************
"---palsticboy/vim-markdown
let g:vim_markdown_math=1
let g:vim_markdown_conceal_code_blocks=0
let g:vim_markdown_new_list_item_indent = 0
let g:vim_markdown_floking_disabled = 1 "禁止折叠
"---SirVer/ultisnips
"see the help: :help UltiSnips
let g:UltiSnipsExpandTrigger = '<c-tab>'
let g:UltiSnipsListSnippets = '<c-j>'
let g:UltiSnipsJumpForwardTrigger = '<tab>'
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
let g:UltiSnipsEditSplit="tabdo"
let g:UltiSnipsEditSplit="vertical"
cmap use UltiSnipsEdit
"---iamcco/markdown-preview.nvim
nmap <F8> <Plug>MarkdownPreview
"---itchyny/lightline
set laststatus=2
set noshowmode
let g:lightline = {
\'colorscheme':'deus_my',
\'mode_map':{
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'v' : 'V',
\ 'V' : 'V',
\ "\<C-v>": 'V',
\ 'c' : 'N',
\ 's' : 'S',
\ 'S' : 'S',
\ "\<C-s>": 'S',
\ 't': 'T',
\},
\'active':{
\ 'left':[['mode','paste'],['bufnum'],['filename']],
\ 'right':[['mode','paste'],['lineinfo'],['fileencoding','fileformat']],
\},
\'component':{
\ 'filename':'%t%m%r%h%w %y',
\ 'lineinfo':'%3p%% %3l:%2c',
\ 'time':'%{strftime("%y-%m-%d %a %H:%m")}',
\},
\}
"---dkarter/bullets.vim
let g:bullets_renumber_on_change=0 "禁止自动重排序 手动排序命令gN
let g:bullets_pad_right=0
"---zhmars/gvimtweak
" alpha value (180 ~ 255) default: 245
let g:gvimtweak#window_alpha=240
" enable alpha at startup
let g:gvimtweak#enable_alpha_at_startup=1
" enable topmost at startup
let g:gvimtweak#enable_topmost_at_startup=0
" enable maximize at startup
let g:gvimtweak#enable_maximize_at_startup=0
" enable fullscreen at startup
let g:gvimtweak#enable_fullscreen_at_startup=0
nnoremap<silent> <A-k> :GvimTweakSetAlpha 10<CR>
nnoremap<silent> <A-j> :GvimTweakSetAlpha -10<CR>
nnoremap<silent> <F10> :GvimTweakToggleTopMost<CR>
"nnoremap<silent> <A-m> :GvimTweakToggleMaximize<CR>
nnoremap<silent> <F11> :GvimTweakToggleFullScreen<CR>
"---ZSaberLv0/ZFVimIM
"function! s:myLocalDb()
" let db = ZFVimIM_dbInit({
" \ 'name' : 'flypy',
" \ })
" call ZFVimIM_cloudRegister({
" \ 'mode' : 'local',
" \ 'dbId' : db['dbId'],
" \ 'repoPath' : 'C:\Users\23862\vimfiles\ZFVimIM',
" \ 'dbFile' : 'flypy.txt'
" \ })
"endfunction
"autocmd User ZFVimIM_event_OnDbInit call s:myLocalDb()
"let g:zfvimim_keymap = 0
"
"nnoremap <expr><silent> ;; ZFVimIME_keymap_toggle_n()
"inoremap <expr><silent> ;; ZFVimIME_keymap_toggle_i()
"vnoremap <expr><silent> ;; ZFVimIME_keymap_toggle_v()
"
"nnoremap <expr><silent> ;: ZFVimIME_keymap_next_n()
"inoremap <expr><silent> ;: ZFVimIME_keymap_next_i()
"vnoremap <expr><silent> ;: ZFVimIME_keymap_next_v()
"
"nnoremap <expr><silent> ;, ZFVimIME_keymap_add_n()
"inoremap <expr><silent> ;, ZFVimIME_keymap_add_i()
"xnoremap <expr><silent> ;, ZFVimIME_keymap_add_v()
"
"nnoremap <expr><silent> ;. ZFVimIME_keymap_remove_n()
"inoremap <expr><silent> ;. ZFVimIME_keymap_remove_i()
"xnoremap <expr><silent> ;. ZFVimIME_keymap_remove_v()
"-------------highlight----------------
hi! link conceal texmathzonex
hi! nontext ctermfg=0 ctermbg=NONE guifg=gray guibg=NONE
hi! specialkey ctermfg=0 ctermbg=NONE guifg=gray guibg=NONE
"hi Cursor guifg=#ffffff guibg=#6a818e
hi nCursor guifg=#292c33 guibg=#98c379
hi iCursor guifg=#292c33 guibg=#61afef
hi vCursor guifg=#292c33 guibg=#c678dd
hi link CursorColumn Cursor
hi link CursorLine Cursor
function! ChineseCount() range
let save = @z
silent exec 'normal! gv"zy'
let text = @z
let @z = save
silent exec 'normal! gv'
let cc = 0
for char in split(text, '\zs')
if char2nr(char) >= 0x200
let cc += 1
endif
endfor
echo "Count of Chinese charasters is:"
echo cc
endfunc
map <F7> :call ChineseCount()<cr>