3 ms·
Do people usually have multiple vim splits open? At least I usually just have one terminal with new tmux splits and usually one vim with multiple buffers I swit
by nextlevelwizard 7y ago
Do people usually have multiple vim splits open? At least I usually just have one terminal with new tmux splits and usually one vim with multiple buffers I switch between if needed.
However if I'm looking for something or doing something in another split and I need to view a file or edit a file I don't go back to my vim split and open it there I just open vim right there where I am.
- jteppinette 7y agoIn standard usage, I am using splits (horizontal). The only real time I am using buffers is when I open up multiple files from command line in some type of ‘vim ‘git grep -l “<search>” .’‘ scenario where I will do an action against all opened buffers in vim. Regarding your second point, I behave similarly. If I am off in one of my non main editor tmux panes and I need to open a quick file, I will do it there instead of moving back to my main editor vim session. This is usually due to the file needing to be opened is outside the cwd of the main vim session.
- boomlinde 7y agoI typically split if I have some interrelated code that I need to cross-reference, e.g. when refactoring. Especially if this code is in the same file, in which case windows into the same buffer have the added benefit of synchronized editing. Another example: when programming C, it is useful sometimes to have the header in one vim window and the definitions in the other. Or you're navigating via ctags, and it's convenient to view a tag in a new window rather than change the buffer for the current window. If I'm just editing two completely unrelated files I don't see any advantages to this workflow over opening multiple instances. Maybe if you have plugins that are slow to start up?