Skip to content
Vim

バッファ、ウィンドウ & タブ

バッファ、分割ウィンドウ、タブページで複数ファイルを編集。

#buffer#window#tab#split

Code

vim
:e file.txt          " edit a file (load into a buffer)
:badd file2.txt      " add buffer without showing
:ls                  " list all buffers
:b N                 " switch to buffer N
:bn / :bp            " next / previous buffer
:bd                  " delete (close) current buffer

" Splits (windows)
:sp file.txt         " horizontal split
:vs file.txt         " vertical split
Ctrl-w h/j/k/l       " move between splits
Ctrl-w =             " equalize split sizes
:q                   " close current window
:only                " close all but current

" Tabs (collections of windows)
:tabnew file.txt     " open file in new tab
:tabn / :tabp        " next / previous tab
gt / gT              " next / previous tab (normal mode)
:tabc                " close tab