I often use a common layout on the screen - a few vertical splits, file tree (NerdTree) on the left.
When I need a new buffer, I typically want it to go into a specific split. For example, imagine the following window structure:
| file_tree | split1 | split2 |
Now I invoke the file listing command (in my case, fzf). When I find the file name, I'd like to press something like Ctrl+1
to open the file in split1
, Ctrl+2
to open the file in split2
, etc. How can I implement such shortcuts? Specifically, with fzf, if possible.
Otherwise, the experience is a little awkward:
- I can always open a new vsplit, but then I need to close some of the other ones (because now there's too many), they get reshuffled, etc.
- I can first focus a specific split, and then invoke the file listing command. That works, but I keep forgetting about this, and half of the time I keep opening the file in the tiny
file_tree
split.