Reputation: 272
I use tmux and vim at the same time. To do splits I prefer to do them in tmux. The only problem is that when I create a split, the new panel opens in the root folder. First, I have to navigate to the subfolder where I was working and then open the corresponding vim file. Is there any way to avoid this?
Upvotes: 0
Views: 1094
Reputation: 3063
You could use the vim-tmux-navigator plugin make the same movements work for tmux and vim splits. I have it set up so that ctrl+j/k/h/l moves between tmux and vim splits. Now it feels 100% natural.
Having multiple files open in one vim session allows you to use all of vim's yanking/pasting operations to move copy/move text between files. In my opinion this is a huge benefit of running a single vim instance, one that outweighs the time to get into the habit of configuring/learning some keys to navigate tmux/vim splits.
Upvotes: 2