Hacker News new | past | comments | ask | show | jobs | submit login

I used to use splits, then I used tabs + splits, now I just use buffers. The only time splits come into it are for quickfix or diffs. Just get used to buffers. Lots of vim commands will work with buffers but not with splits or tabs.

People new to vim will immediately jump on splits or tabs because of how their previous editor work flow worked, but you aren't going to unlock the full power of vim until you get used to buffers.

:b# last buffer used

:b num Switch to various buffers by number

:buffers See a list of buffers

:bd delete buffer

^^ map those to keys

cntrlp for easy buffer switching and opening: https://github.com/kien/ctrlp.vim




I use buffers and splits.

My work session has about a hundred or two "open" files in the buffer, and I split and un-split windows often so that I can view multiple files at once.

But my most common way to change current file is :b <first few letters + tab complete>

I occasionally prune my buffers for files that have been deleted, but it's mostly unnecessary to. When I close it, I just save the session in a file and re-open the session.


I agree with regard to tabs, but I always felt like buffers were orthogonal to splits. I use both all of the time. Buffers to manage a working set of files and splits to manage the files that I want to viewable. I frequently find myself using splits to write new code while referencing other parts of the code base (or even the same file).


Same here, I can quickly have all the functions, data, and docs visible, that I need for the particular code that I'm currently writing. Having to switch back and forth would only confuse me. Usually, the biggest problem I have with other IDEs is that they don't allow me to split as freely as vim / emacs do. XCode is shockingly stupid about it, for example.


:ls works too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: