0

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.

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

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.

  • 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 Aug 16 '16 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.