search

Home  >  Q&A  >  body text

vimrc - I am learning vimscript recently, how can I make gvim automatically load the file after the vimscript file is modified?

For examplea.vimThe content is as follows

let a = 1
echo a    "输出1

When I modify let a = 1 to let a = 2, I need to run the command :source a.vim to output the modified result2.
I hope that gvim can automatically load a.vim after a.vim is modified.
How to do this? Please give me some advice from the experts.

怪我咯怪我咯2774 days ago535

reply all(1)I'll reply

  • 迷茫

    迷茫2017-05-16 16:36:28

    You can consider using autocmd BufWritePost to trigger events when saving and automatically run the source command

    reply
    0
  • Cancelreply