-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor_file.vim
86 lines (60 loc) · 1.92 KB
/
monitor_file.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
runtime! debian.vim
set updatetime=500 " milliseconds
set nomodifiable
" -------------------------------------------------------------------------
" 我写的自动刷新,对非tmux中的,vim开启后需要用户操作了,才能开始自动刷新
function! Timer()
" set modifiable
call feedkeys("f\e")
" call feedkeys('\<CR>')
checktime
if getline(1) == "finished"
call Quit()
endif
endfunction
function! Enter()
sleep 50m
normal <CR>
endfunction
set autoread
autocmd VimEnter,BufEnter,BufRead * call Enter()
autocmd FocusLost,WinLeave,FocusGained * call Timer()
autocmd CursorHold,CursorHoldI * call Timer()
autocmd CursorMoved,CursorMovedI * call Timer()
" -------------------------------------------------------------------------
" if filereadable(expand("/mfs/haoyu/server_conf/ENV/serverENV/admin_tool/watchforchanges.vim"))
" source /mfs/haoyu/server_conf/ENV/serverENV/admin_tool/watchforchanges.vim
" endif
" let autoreadargs={'autoread':1}
" execute WatchForChanges('*',autoreadargs)
" ctrl+c 退出
function! Quit()
execute ':silent ! touch '.expand('%:p:h').'/quitvim'
update!
quit!
endfunction
nnoremap <C-C> :call Quit()<CR>
vnoremap <C-C> :call Quit()<CR>
inoremap <C-C> <C-O>:call Quit()<CR>
set nocompatible " 关闭 vi 兼容模式
let g:loaded_matchparen=1 " 关闭括号匹配高亮
" set noshowmatch
" disable 'Press Enter or type command to continue' at startup.
set shortmess=a
set cmdheight=2
" if has("syntax")
" syntax off
" endif
" command! -nargs=1 Silent execute ':silent !'.<q-args> | execute ':redraw!'
" set nolazyredraw
" set ttymouse=xterm2
" nnoremap <esc>^[ <esc>^[
" set mouse=a
" map <ScrollWheelUp> <C-Y>
" map <ScrollWheelDown> <C-E>
" set bg=dark
" hi! EndOfBuffer ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
" highlight EndOfBuffer ctermfg=black ctermbg=black
" hi NonText guifg=bg
"
"