Refresh all files in buffer from disk in vim

前端 未结 5 1890
予麋鹿
予麋鹿 2021-01-29 19:18

The command to refresh a file from version on disk is :e!

How can I do the same for all files in the buffer?

Background: I need that because I am u

5条回答
  •  甜味超标
    2021-01-29 19:31

    Here's what I ended up putting in my .vimrc:

    fun! PullAndRefresh()
      set noconfirm
      !git pull
      bufdo e!
      set confirm
    endfun
    
    nmap gr call PullAndRefresh()
    

提交回复
热议问题