-
Notifications
You must be signed in to change notification settings - Fork 0
/
skywind.vim
242 lines (185 loc) · 8.55 KB
/
skywind.vim
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
"----------------------------------------------------------------------
" startup
"----------------------------------------------------------------------
let g:asc_uname = asclib#platform#uname()
exec 'set rtp+='. fnameescape(expand('<sfile>:p:h') . '/site/package')
"----------------------------------------------------------------------
" OptImport
"----------------------------------------------------------------------
" IncScript site/opt/argtextobj.vim
IncScript site/opt/angry.vim
IncScript site/opt/indent-object.vim
IncScript site/opt/after_object.vim
IncScript site/opt/apc.vim
if has('gui_running')
IncScript site/opt/hexhigh.vim
endif
call after_object#enable(['r', 'R'], '=', ':', '-', '#', ' ', '/', ';', '(', ')')
"----------------------------------------------------------------------
"- Global Settings
"----------------------------------------------------------------------
let g:asyncrun_msys = ''
for msys in ['d:/Linux', 'd:/software/msys32']
if isdirectory(msys) && executable(msys . '/usr/bin/bash.exe')
let g:asyncrun_msys = msys
break
endif
endfor
let g:asyncrun_show_time = 1
let g:asyncrun_rootmarks = ['.project', '.root', '.git', '.git', '.svn']
let g:asyncrun_rootmarks += ['.hg', '.obsidian']
let g:asclib_path_rootmarks = g:asyncrun_rootmarks
if has('patch-8.0.0')
set shortmess+=c
endif
set cpt=.,w,k
if has('patch-8.2.4500')
set wildoptions+=pum,fuzzy
set wildmode=longest,full
" cnoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<cr>"
" cnoremap <expr> <esc> pumvisible() ? "\<c-e>" : "\<esc>"
endif
if executable('playwav.exe')
let f = 'c:/share/vim/tools/sample/sample-6.wav'
if filereadable(f)
let g:asyncrun_exit = printf('silent !start playwav.exe "%s" 200', f)
endif
endif
"----------------------------------------------------------------------
" asclib settings
"----------------------------------------------------------------------
let s:settings = {
\ 'cygwin': 'd:/linux',
\ 'zeal': '~\scoop\apps\zeal\current\zeal.exe',
\ }
let s:settings_win = {
\ 'emacs': 'd:/dev/emacs/bin/runemacs.exe',
\ 'gdb' : '~\scoop\apps\gdb\current\bin\gdb.exe',
\ 'browser' : '"C:\Program Files\Google\Chrome\Application\chrome.exe" --new-tab',
\ 'junk' : '~/OneDrive/Documents/notes/VimJunk',
\ }
" \ 'browser' : '"C:\Program Files\Mozilla Firefox\firefox" --new-tab',
call asclib#setting#update(s:settings)
if has('win32') || has('win64') || has('win16') || has('win95')
call asclib#setting#update(s:settings_win)
if has('gui_running')
endif
endif
"----------------------------------------------------------------------
" QuickMenu
"----------------------------------------------------------------------
" call quickmenu#current(2)
" if has('win32') || has('win64') || has('win16') || has('win95')
" call quickmenu#append('# Help', '')
" call quickmenu#append('Win32 Help', 'call menu#WinHelp("d:/dev/help/win32.hlp")', 'Looking up Win32 API')
" call quickmenu#append('MSDN of VC6', 'call menu#WinHelp("d:/dev/help/chm/vc.chm")', 'MSDN')
" call quickmenu#append('Python2 Help', 'call menu#WinHelp("d:/dev/help/chm/python2713.chm")', 'Python 2 Document')
" call quickmenu#append('Python3 Help', 'call menu#WinHelp("d:/dev/help/chm/python362.chm")', 'Python 3 Document')
" call quickmenu#append('Open Cygwin', 'call asclib#utils#terminal("mintty", "bash -i", 0)', 'open cygwin in current directoy')
" call quickmenu#append('Open Bash', 'call asclib#wsl_bash("")', 'open bash for windows 10 in current directory')
" call quickmenu#append('Open PowerShell', '!start powershell', 'open bash for windows 10 in current directory')
" call quickmenu#append('Switch color', 'call SkywindSwitchColor()', 'switch current color scheme')
" endif
"----------------------------------------------------------------------
" keymaps
"----------------------------------------------------------------------
if has('win32') || has('win16') || has('win64') || has('win95')
let $VIM_ONEDRIVE = $HOME . '/OneDrive/Documents/notes/Vim'
noremap <silent><space>hw :FileSwitch e:\lab\workshop\README.md<cr>
noremap <silent><space>hq :FileSwitch $VIM_ONEDRIVE/quicknote.md<cr>
noremap <silent><space>hm :FileSwitch -ft=markdown $VIM_ONEDRIVE/quicknote.md<cr>
noremap <silent><space>hp :FileSwitch $VIM_ONEDRIVE/personal.gpg<cr>
if filereadable('c:/drivers/clink/clink.cmd')
noremap <silent><space>gl :silent !start /b cmd /C c:\drivers\Clink\clink.cmd<cr>
endif
elseif isdirectory('/mnt/c/Users/Linwei/OneDrive/Documents/notes/Vim')
let $VIM_ONEDRIVE = '/mnt/c/Users/Linwei/OneDrive/Documents/notes/Vim'
noremap <silent><space>hw :FileSwitch ~/github/workshop/README.md<cr>
noremap <silent><space>hq :FileSwitch $VIM_ONEDRIVE/quicknote.md<cr>
noremap <silent><space>hm :FileSwitch -ft=markdown $VIM_ONEDRIVE/quicknote.md<cr>
noremap <silent><space>hp :FileSwitch $VIM_ONEDRIVE/personal.gpg<cr>
endif
"----------------------------------------------------------------------
"- bufferhint
"----------------------------------------------------------------------
if has('patch-8.2.1') || has('nvim-0.4')
nnoremap <silent>+ :call quickui#tools#list_buffer('FileSwitch tabe')<cr>
else
nnoremap + :call bufferhint#Popup()<CR>
endif
let g:bufferhint_CustomHighlight = 1
hi! default link KeyHint Statement
hi! default link AtHint Identifier
"----------------------------------------------------------------------
"- miscs
"----------------------------------------------------------------------
let g:cppman_open_mode = '<auto>'
command! -bang -nargs=* -complete=file Make AsyncRun -program=make -once=1 -strip=1 @ <args>
command! -bang -bar -nargs=* Gpush execute 'AsyncRun<bang> -cwd=' .
\ fnameescape(FugitiveGitDir()) 'git push' <q-args>
command! -bang -bar -nargs=* Gfetch execute 'AsyncRun<bang> -cwd=' .
\ fnameescape(FugitiveGitDir()) 'git fetch' <q-args>
set timeoutlen=2000
command! Ghistory :0Gclog! -- %
" set listchars=tab:»\ ,trail:.,extends:>,precedes:<
"----------------------------------------------------------------------
"- OmniCpp
"----------------------------------------------------------------------
let OmniCpp_NamespaceSearch = 1
let OmniCpp_GlobalScopeSearch = 1
let OmniCpp_ShowAccess = 1
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteDot = 1
let OmniCpp_MayCompleteArrow = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
"----------------------------------------------------------------------
" color scheme
"----------------------------------------------------------------------
map <leader><F3> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
let g:solarized_termcolors=256
nnoremap <leader><F1> :call Tools_ProfileStart('~/.vim/profile.log')<cr>
nnoremap <leader><F2> :call Tools_ProfileStop()<cr>
"----------------------------------------------------------------------
" color scheme
"----------------------------------------------------------------------
let s:colors = ['biogoo', 'calmbreeze', 'dawn', 'dejavu', 'eclipse2', 'paradox', 'gaea', 'github', 'greyhouse', 'habiLight', 'imperial']
let s:colors += ['mayansmoke', 'mickeysoft', 'newspaper', 'nuvola', 'oceanlight', 'peaksea', 'pyte', 'summerfruit256', 'tomorrow']
let s:colors += ['monokai-vim']
function! SkywindSwitchColor()
call asclib#color_switch(s:colors)
endfunc
"----------------------------------------------------------------------
" quickui
"----------------------------------------------------------------------
let g:quickui_tags_list = {
\ 'python': '--python-kinds=fmc --language-force=Python',
\ }
let g:quickui_tags_indent = {
\ 'm': ' ',
\ }
let g:quickui_color_scheme = 'papercol-light'
"----------------------------------------------------------------------
" completion
"----------------------------------------------------------------------
let g:apc_enable_ft = get(g:, 'apc_enable_ft', {})
let g:apc_enable_ft.text = 1
let g:apc_enable_ft.markdown = 1
let g:ycm_filetype_blacklist = get(g:, 'ycm_filetype_blacklist', {})
let g:ycm_filetype_blacklist['lua'] = 1
" let g:ycm_filetype_blacklist['text'] = 1
" let g:ycm_filetype_blacklist['markdown'] = 1
let g:ycm_collect_identifiers_from_tags_files = 1
" let g:ycm_filetype_blacklist = {}
" let g:ycm_filetype_whitelist['text'] = 1
if has('win32') || has('win16') || has('win64') || has('win95')
let g:vimwiki_path = '~/OneDrive/Documents/notes/VimWiki'
if has('gui_running') && v:version >= 801
set tbis=large
endif
if executable('c:/drivers/clink/clink.cmd')
let g:terminal_shell='cmd /s /k "c:\drivers\clink\clink.cmd inject"'
endif
endif