forked from skywind3000/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwprofile.vim
47 lines (38 loc) · 892 Bytes
/
wprofile.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
function! ProfileInit(filename)
exec 'profile start ' . fnameescape(a:filename)
profile func *
profile file *
endfunc
function! ProfileStop()
silent! profdel func *
silent! profdel file *
endfunc
function! MonitorInit()
let ts = strftime("pf-%Y%m%d%H%M%S.txt")
let name = expand('~/.vim/profile/' . ts)
silent! call mkdir(expand('~/.vim/profile'), "p", 0755)
silent! call ProfileStop()
call ProfileInit(name)
if 0
profile pause
function! <SID>PressF5()
profile continue
VimExecute run
profile pause
endfunc
function! <SID>PressF9()
profile continue
VimBuild gcc
profile pause
endfunc
noremap <silent><F5> :call <SID>PressF5()<cr>
noremap <silent><F9> :call <SID>PressF9()<cr>
endif
endfunc
function! MonitorExit()
call ProfileStop()
if 0
noremap <silent><F5> :VimExecute run<cr>
noremap <silent><F9> :VimBuild gcc<cr>
endif
endfunc