当前位置:网站首页>VIM backup history command

VIM backup history command

2022-06-23 15:27:00 fqbqrr

vim Self History commands There seems to be a problem , Our own Backup One copy .

fun! Lsks()
//" History begins .
let s:k=histnr("cmd")
endf

fun! Lsjs()
// The end of history . Historical commands in the file .
// It should be before opening the file , Before and after , History commands , Add it all to ` History commands .vim`.
let s:j=histnr("cmd")
if s:k==s:j
    return 
// There is no change , Go straight back to .
endif
let l=[]
//:call Qjzl(s:k,s:j,l)
:call Qjls(s:k,s:j,l)
call Glkh(l)
// Filter blank line .
// Take the historical content .
let s:ls=$XVIM."/ History commands .vim"
//echo l
call Jlrl(s:ls,l)
// Automatic addition . perhaps ` Delete history `.
endf

au VimEnter * :call Lsks()
au VimLeave * :call Lsjs()
// Written in vim After entering or exiting ,

Only need VimEnter and VimLeave when , Every time you call , It's done. .

原网站

版权声明
本文为[fqbqrr]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206231336196957.html