

My personal suggestion is to take your time to use it the way they were designed first. When I started using Vim full-time, it required a significant paradigm shift.

In Vim there are 3: buffers, windows, and tabs. In most code editors there are 2 abstractions in their workflows: windows (ex: split screen) and tabs. Like one tab for server codes and one tab for client codes. Use tabs when working on different projects. Like when diffing files, referencing codes, or following code flows.

Use windows when you need to view multiple buffers. Vim has designed switching file buffers to be frictionless. Having many buffers opened doesn't effect spatial distribution. Use buffers to open up all required files to get current task done. To learn how to use buffers, windows, and tabs efficiently is to understand what they are designed to do. Using buffers, windows, and tabs efficiently This X-Y-Z movement is possible thanks to Vim's window and buffer features. When we combine window movement with buffer traversal, we are moving in three-dimensional space. Inside each window, you can move along the Z axis with buffer navigation. We can move to top, right, bottom, left with +h/j/k/l.Įarlier I said that Vim buffers are like Z axis. Moving between windows in Vim is like traveling along X-Y axis in cartesian coordinate. In Vim, you can have multiple windows opened. Vim makes it almost frictionless to travel anywhere along this Z axis.Ī window is a viewport on a buffer. The number of file buffers you have is how long your Z axis is. You can jump to any coordinate in Z axis with :buffer. You can traverse the Z axis one file at a time with :bnext/ :bprev. Your buffers files are lined up in the Z axis.

Imagine X axis to right, Y axis to top, and Z axis towards screen. The way I see it, buffer is like Z axis in X-Y-Z coordinate. To be honest, in my years of editing with Vim, I almost never needed to delete buffers. If we check with :ls, we'll see that we have 3 buffers. Still in the same vim session, if we want to open a new file, we can do :e file3.js. We have two buffers opened: file1.js and file1.js buffers. Once a buffer is opened, it remains in your buffers list. Enter fullscreen mode Exit fullscreen mode
