Save and run at the same time in Vim

前端 未结 12 512
悲哀的现实
悲哀的现实 2021-01-30 03:13

I do a lot of Python quick simulation stuff and I\'m constantly saving (:w) and then running (:!!). Is there a way to combine these actions?

Maybe a "save and run&qu

12条回答
  •  囚心锁ツ
    2021-01-30 03:43

    Use the autowrite option:

    :set autowrite
    

    Write the contents of the file, if it has been modified, on each :next, :rewind, :last, :first, :previous, :stop, :suspend, :tag, :!, :make, CTRL-] and CTRL-^ command [...]

提交回复
热议问题