In vim how to map “save” to ctrl-s

前端 未结 4 986
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 15:32

In vim, how can I map \"save\" (:w) to ctrl-s.

I am trying \"map\" the command, but xterm freezes when I press ctrl-

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 15:54

    Ctrl+S is a common command to terminals to stop updating, it was a way to slow the output so you could read it on terminals that didn't have a scrollback buffer. First find out if you can configure your xterm to pass Ctrl+S through to the application. Then these map commands will work:

    noremap            :update
    vnoremap           :update
    inoremap           :update
    

    BTW: if Ctrl+S freezes your terminal, type Ctrl+Q to get it going again.

提交回复
热议问题