1

Let's say I am working on an .html (or any text-based) file in vim. Next, I need to open a new pane in the same window to work on the terminal. How can I achieve that?

I know how to use tmux to open a new pane and then go into vim. But how do I do the reverse? To open a new tmux pane to work on terminal if i am already in vim window?

Edit

I would like to open a new pane instead of tab. Panes will allow me to easily see all the terminals and vim files. I can do :split but that would just open a new vim pane instead of a new terminal pane.

Thanks.

3
  • Are you interested in tabs? :tabnew will open one more tab
    – SibiCoder
    Commented Jul 27, 2016 at 4:32
  • Hi @SibiCoder, I have edited my question above and it also addresses your suggestion. Please have a look. Thanks.
    – goddar
    Commented Jul 27, 2016 at 6:31
  • I guess you can't open terminal pane from vim. For that case, you have to open another terminal
    – SibiCoder
    Commented Jul 27, 2016 at 7:44

2 Answers 2

2

Try prefix-key followed by shift+double quote. This works for me and I use it frequently. It should open a terminal pane below the vim pane.

Cntrl-b
Shift-"

Or to have the new terminal pane open beside the vim pane:

Cntrl-b
Shift-%
0

Apparently you're forgetting to press the prefix-key (Ctrl+b by default) before the colon. The right combination is Ctrl+b and then :split-window.

If you forget to press Ctrl+b, the colon will be interpreted by Vim instead of Tmux.

1
  • Hi, thanks @Joan Manuel Rivera, I have tried it and it could only work if you follow the following sequence: Open new terminal > tmux > vim > ctrl+b :split-window, then I was able to open a new terminal. But, if you try the following sequence: Open new terminal > vim > ctrl+b :split-window, it will just open a new vim window, which is not what I try to achieve. Any suggestions?
    – goddar
    Commented Aug 16, 2016 at 12:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .