Jeff Roberts
RHCE #804006066322833
Vim-Fu is now iPhone and Android friendly

Check out the Vim-Fu Store!

Vim-Fu

shell access in VIM

My friend Grig asked me if this was possible. The answer is yes and no. 

Yes, you can get a shell prompt by typing :shell

No, you cannot, as far as I can tell, get a shell in an all that useful of a fashion, like in a split VIM window for instance. It simply drops you to your shell so that you can do something and then when you Ctrl-D or exit, you’re back in you VIM session. This only seems handy if you can’t, for some reason open a new terminal window. That said, it could save your life someday, so I posted it here.

5 comments to shell access in VIM

  • tr

    What about screen? I used to use it a lot until my company bought big widescreen monitors. :) Ctrl+A, Ctrl+Tab, Ctrl+S, Ctrl+N, Ctrl+”, Ctrl+Q.

  • admin

    :!bash is basically the same thing as :shell, in fact it probably IS the same. I would like to have a shell in a scratch window that I could resize and place to aid me in whatever task I am doing at the time, so far, I have not found VIM capable of this. There is always the option to just open another terminal window, which of course works fine, so It’s not really worth complaining about or taking the time and writing the plugin to do it.

  • how about :!bash
    or any :!command directly, for that matter
    you can even put the output into your text with :.!command
    I often use that for sorting: select text, and do :’!sort

  • Justin

    Why not just put the vim session in the background with ^Z ?

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>