How can I close a buffer without closing the window?

前端 未结 16 1028
鱼传尺愫
鱼传尺愫 2020-12-12 13:35

Vim\'s multilayered views (Windows, Buffers and Tabs) left me a little confused. Let\'s say I split the display (:sp) and then select a different buffer to display in each w

16条回答
  •  我在风中等你
    2020-12-12 13:49

    Simply do :new|bd# or Paste this into your vimrc

    let mapleader = " "
    " CLOSE current Buffer without closing window
    nnoremap d :newbd#
    " CLOSE current window
    noremap x c
    

    Then hit (space + d) or (space + x)

    EDIT: even better with

    nnoremap d :newbd#bp
    

提交回复
热议问题