1

I searched some old answers on stackoverflow, some of them seem relevant, but none of the solutions work on my macbook (with mountain lion). e.g. The shortcuts mentioned in answers here do not work on my computer: How do I run a terminal inside of Vim?

So I'm wondering if it's because vim on mac/unix is different from a normal linux one. I don't think so, but I'm not sure.

Since I can split the screen with :sp, I'm wondering if it's possible to use one split as terminal and another as the regular vim editor, just like emacs. If so, what's the correct way to do it? (Maybe particularly for mac) If not, it's sad.

Community
  • 1
  • 1
OneZero
  • 11,556
  • 15
  • 55
  • 92

3 Answers3

1

Why don't you do things the other way around?

You can use a terminal multiplexer such as Tmux and split a terminal window into two panes using C-b %.

Inside the second pane you can run macvim inside a terminal with $ mvim -v

You can navigate between the two panes with C-b o, (And do much more, but I'll leave it up to you to discover!)

Doing things this way around is much more sane in my opinion, you get the full power of both the terminal and vim without having to hack around with Vim too much (Plus Tmux is very handy for many other uses).

I hope doing things this way around is appealing enough for you!

Aaron Cronin
  • 2,093
  • 14
  • 13
  • Also for added magic, take a look at `Slime.vim`. It allows you to select lines of code within your Vim file and send them directly to a REPL in a Tmux pane. I find it incredibly valuable when prototyping SO solutions since I can use the REPL to try out ideas but have the full power of Vim to create the code. – Aaron Cronin Jul 30 '13 at 23:14
0

Having a terminal inside of vim would go against the author's philosophy and design so no: that feature will probably never appear nativelyly in vim.

There are a couple of plugins that more or less work like conqueterm, try them if you really want that feature. Or simply use a separate terminal window like everybody.

romainl
  • 186,200
  • 21
  • 280
  • 313
0

You should definitely look at programs like tmux or screen.

But an even simpler solution is to use C-z (which halt vim) to access the terminal and fg to bring back vim into the foreground.

Julien Grenier
  • 3,364
  • 2
  • 30
  • 43