Shell support in Vim?

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Shell support in Vim?

Jerin Joy
Hi,

I was just wondering if adding shell support to vim is a feature thats
being considered. It would be great to be able to run commands from
vim instead of having to shift to terminal to do so.
I've seen vim shell but its a separate plugin:
http://www.wana.at/vimshell/

Jerin
--
http://jerinj.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Michael Hernandez-2
On May 10, 2006, at 2:07 PM, Jerin Joy wrote:

> Hi,
>
> I was just wondering if adding shell support to vim is a feature thats
> being considered. It would be great to be able to run commands from
> vim instead of having to shift to terminal to do so.
> I've seen vim shell but its a separate plugin:
> http://www.wana.at/vimshell/

You can !command to run things in your shell but it's not quite a  
full shell within vim. I think emacs has such functionality but I'm  
not sure how useful it is. In a case where you really need a shell  
you could use another (x)term or perhaps use screen? If you want vim  
like functionality in your shell you might want to look into the vi  
keybinding features available in bash and zsh?

Just a thought,

Mike

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Bram Moolenaar
In reply to this post by Jerin Joy

Jerin Joy wrote:

> I was just wondering if adding shell support to vim is a feature thats
> being considered. It would be great to be able to run commands from
> vim instead of having to shift to terminal to do so.
> I've seen vim shell but its a separate plugin:
> http://www.wana.at/vimshell/

Not really.  Vim is an editor, not a shell, command line interface or
windowing system.  You can already do ":!cmd", that should be
sufficient.

--
From "know your smileys":
 [:-) Frankenstein's monster

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Jerin Joy
Hi,

I'm able to run !mkdir.. etc.
I was thinking something similar to emacs where I can have a different
tab? open where I can compile my files, keep working for 2 weeks and
search back through the text for the first command I typed in.
But I guess its a design decision whether or not to add this
functionality to vim.

thanks,
Jerin

On 5/10/06, Bram Moolenaar <[hidden email]> wrote:

>
> Jerin Joy wrote:
>
> > I was just wondering if adding shell support to vim is a feature thats
> > being considered. It would be great to be able to run commands from
> > vim instead of having to shift to terminal to do so.
> > I've seen vim shell but its a separate plugin:
> > http://www.wana.at/vimshell/
>
> Not really.  Vim is an editor, not a shell, command line interface or
> windowing system.  You can already do ":!cmd", that should be
> sufficient.
>
> --
> From "know your smileys":
>  [:-)   Frankenstein's monster
>
>  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\        download, build and distribute -- http://www.A-A-P.org        ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
>


--
http://jerinj.blogspot.com/
--
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Scot P. Floess
Personally, isn't it an issue of preference?  I mean, on a Linux system,
if you use an xterm plus a gvim window...why do you need this
functionality in your editor?  The fact the editor will allow you to
issue a shell command is nice...but one can easily argue moving the
mouse to the xterm to issue commands is -more- than sufficient.  I don't
think ViM is supposed to be an integrated development environment more
than a really good, rock solid editor.  The fact that you can compile
from it...is also cool too.  But heck with an xterm, ant, ViM (with
tabbed windows) - does one really need more than that ;)

Jerin Joy wrote:

> Hi,
>
> I'm able to run !mkdir.. etc.
> I was thinking something similar to emacs where I can have a different
> tab? open where I can compile my files, keep working for 2 weeks and
> search back through the text for the first command I typed in.
> But I guess its a design decision whether or not to add this
> functionality to vim.
>
> thanks,
> Jerin
>
> On 5/10/06, Bram Moolenaar <[hidden email]> wrote:
>>
>> Jerin Joy wrote:
>>
>> > I was just wondering if adding shell support to vim is a feature thats
>> > being considered. It would be great to be able to run commands from
>> > vim instead of having to shift to terminal to do so.
>> > I've seen vim shell but its a separate plugin:
>> > http://www.wana.at/vimshell/
>>
>> Not really.  Vim is an editor, not a shell, command line interface or
>> windowing system.  You can already do ":!cmd", that should be
>> sufficient.
>>
>> --
>> From "know your smileys":
>>  [:-)   Frankenstein's monster
>>
>>  /// Bram Moolenaar -- [hidden email] --
>> http://www.Moolenaar.net   \\\
>> ///        sponsor Vim, vote for features --
>> http://www.Vim.org/sponsor/ \\\
>> \\\        download, build and distribute --
>> http://www.A-A-P.org        ///
>>  \\\            help me help AIDS victims --
>> http://ICCF-Holland.org    ///
>>
>
>
> --
> http://jerinj.blogspot.com/
> --
>

--
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate  http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Russell Bateman
If vim doesn't take this next step of incorporating a full shell, where
will it be on the road to becoming an operating system like emacs? And
what of the future beyond that (space travel, species ascension, world
peace and the end to hunger)?

;-)



Scot P. Floess wrote:

> Personally, isn't it an issue of preference?  I mean, on a Linux
> system, if you use an xterm plus a gvim window...why do you need this
> functionality in your editor?  The fact the editor will allow you to
> issue a shell command is nice...but one can easily argue moving the
> mouse to the xterm to issue commands is -more- than sufficient.  I
> don't think ViM is supposed to be an integrated development
> environment more than a really good, rock solid editor.  The fact that
> you can compile from it...is also cool too.  But heck with an xterm,
> ant, ViM (with tabbed windows) - does one really need more than that ;)
>
> Jerin Joy wrote:
>> Hi,
>>
>> I'm able to run !mkdir.. etc.
>> I was thinking something similar to emacs where I can have a different
>> tab? open where I can compile my files, keep working for 2 weeks and
>> search back through the text for the first command I typed in.
>> But I guess its a design decision whether or not to add this
>> functionality to vim.
>>
>> thanks,
>> Jerin
>>
>> On 5/10/06, Bram Moolenaar <[hidden email]> wrote:
>>>
>>> Jerin Joy wrote:
>>>
>>> > I was just wondering if adding shell support to vim is a feature
>>> thats
>>> > being considered. It would be great to be able to run commands from
>>> > vim instead of having to shift to terminal to do so.
>>> > I've seen vim shell but its a separate plugin:
>>> > http://www.wana.at/vimshell/
>>>
>>> Not really.  Vim is an editor, not a shell, command line interface or
>>> windowing system.  You can already do ":!cmd", that should be
>>> sufficient.
>>>
>>> --
>>> From "know your smileys":
>>>  [:-)   Frankenstein's monster
>>>
>>>  /// Bram Moolenaar -- [hidden email] --
>>> http://www.Moolenaar.net   \\\
>>> ///        sponsor Vim, vote for features --
>>> http://www.Vim.org/sponsor/ \\\
>>> \\\        download, build and distribute --
>>> http://www.A-A-P.org        ///
>>>  \\\            help me help AIDS victims --
>>> http://ICCF-Holland.org    ///
>>>
>>
>>
>> --
>> http://jerinj.blogspot.com/
>> --
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Gerald Lai-2
AFAIK, Vim was already working on the last 3 points you mentioned. That
is, species ascension over Emacs users..

(more fire in the furnace)

;)
--
Gerald

On Wed, 10 May 2006, Russell Bateman wrote:

> If vim doesn't take this next step of incorporating a full shell, where will
> it be on the road to becoming an operating system like emacs? And what of the
> future beyond that (space travel, species ascension, world peace and the end
> to hunger)?
>
> ;-)
>
>
>
> Scot P. Floess wrote:
>> Personally, isn't it an issue of preference?  I mean, on a Linux system, if
>> you use an xterm plus a gvim window...why do you need this functionality in
>> your editor?  The fact the editor will allow you to issue a shell command
>> is nice...but one can easily argue moving the mouse to the xterm to issue
>> commands is -more- than sufficient.  I don't think ViM is supposed to be an
>> integrated development environment more than a really good, rock solid
>> editor.  The fact that you can compile from it...is also cool too.  But
>> heck with an xterm, ant, ViM (with tabbed windows) - does one really need
>> more than that ;)
>>
>> Jerin Joy wrote:
>>> Hi,
>>>
>>> I'm able to run !mkdir.. etc.
>>> I was thinking something similar to emacs where I can have a different
>>> tab? open where I can compile my files, keep working for 2 weeks and
>>> search back through the text for the first command I typed in.
>>> But I guess its a design decision whether or not to add this
>>> functionality to vim.
>>>
>>> thanks,
>>> Jerin
>>>
>>> On 5/10/06, Bram Moolenaar <[hidden email]> wrote:
>>>>
>>>> Jerin Joy wrote:
>>>>
>>>> > I was just wondering if adding shell support to vim is a feature thats
>>>> > being considered. It would be great to be able to run commands from
>>>> > vim instead of having to shift to terminal to do so.
>>>> > I've seen vim shell but its a separate plugin:
>>>> > http://www.wana.at/vimshell/
>>>>
>>>> Not really.  Vim is an editor, not a shell, command line interface or
>>>> windowing system.  You can already do ":!cmd", that should be
>>>> sufficient.
>>>>
>>>> --
>>>> From "know your smileys":
>>>>  [:-)   Frankenstein's monster
>>>>
>>>>  /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net 
>>>> \\\
>>>> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ 
>>>> \\\
>>>> \\\        download, build and distribute -- http://www.A-A-P.org 
>>>> ///
>>>>  \\\            help me help AIDS victims -- http://ICCF-Holland.org 
>>>> ///
>>>>
>>>
>>>
>>> --
>>> http://jerinj.blogspot.com/
>>> --
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

RE: Shell support in Vim?

Suresh Govindachar`
In reply to this post by Scot P. Floess

  Personally, the step mentioned below, viz., "moving
  the mouse to the xterm" is a _big_ pain.  As a user,
  what I like about the idea of a shell inside vim is
  the means to avoid the mouse.  <C-Z> in console vim
  does avoid the mouse but it doesn't allow simultaneous
  view and fast access of vim and the shell;  and the
  shell from <C-Z> doesn't support commands supported
  by a vim buffer.  

  But vim is Bram's product and its features are so
  useful that I am willing to live with this restriction
  on the shell.

  --Suresh


-----Original Message-----
From: Scot P. Floess [mailto:[hidden email]]
Sent: Wednesday, May 10, 2006 12:24 PM
To: [hidden email]
Cc: Bram Moolenaar; [hidden email]
Subject: Re: Shell support in Vim?

Personally, isn't it an issue of preference?  I mean, on a Linux system,
if you use an xterm plus a gvim window...why do you need this
functionality in your editor?  The fact the editor will allow you to
issue a shell command is nice...but one can easily argue moving the
mouse to the xterm to issue commands is -more- than sufficient.  I don't
think ViM is supposed to be an integrated development environment more
than a really good, rock solid editor.  The fact that you can compile
from it...is also cool too.  But heck with an xterm, ant, ViM (with
tabbed windows) - does one really need more than that ;)

Jerin Joy wrote:

> Hi,
>
> I'm able to run !mkdir.. etc.
> I was thinking something similar to emacs where I can have a different
> tab? open where I can compile my files, keep working for 2 weeks and
> search back through the text for the first command I typed in.
> But I guess its a design decision whether or not to add this
> functionality to vim.
>
> thanks,
> Jerin
>
> On 5/10/06, Bram Moolenaar <[hidden email]> wrote:
>>
>> Jerin Joy wrote:
>>
>> > I was just wondering if adding shell support to vim is a feature thats
>> > being considered. It would be great to be able to run commands from
>> > vim instead of having to shift to terminal to do so.
>> > I've seen vim shell but its a separate plugin:
>> > http://www.wana.at/vimshell/
>>
>> Not really.  Vim is an editor, not a shell, command line interface or
>> windowing system.  You can already do ":!cmd", that should be
>> sufficient.
>>
>> --

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Frank Terbeck
Suresh Govindachar <[hidden email]>:
> Personally, the step mentioned below, viz., "moving the mouse to the
> xterm" is a _big_ pain.  As a user, what I like about the idea of a
> shell inside vim is the means to avoid the mouse.  <C-Z> in console
> vim does avoid the mouse but it doesn't allow simultaneous view and
> fast access of vim and the shell;  and the shell from <C-Z> doesn't
> support commands supported by a vim buffer.  

Hi Suresh,

Just use GNU screen <http://www.gnu.org/software/screen/>. There's no
need for a mouse just to switch between vim and a shell at all.

Regards, Frank

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

George V. Reilly
In reply to this post by Jerin Joy
From: "Frank Terbeck" <[hidden email]>

> Suresh Govindachar <[hidden email]>:
> > Personally, the step mentioned below, viz., "moving the mouse to the
> > xterm" is a _big_ pain.  As a user, what I like about the idea of a
> > shell inside vim is the means to avoid the mouse.  <C-Z> in console
> > vim does avoid the mouse but it doesn't allow simultaneous view and
> > fast access of vim and the shell;  and the shell from <C-Z> doesn't
> > support commands supported by a vim buffer.
>
> Just use GNU screen <http://www.gnu.org/software/screen/>. There's no
> need for a mouse just to switch between vim and a shell at all.

Does screen work with gvim? Does it work on non-Unix platforms?

(Vimshell is Unix-only, but I'd say it's more likely to be made cross-platform than screen is.)
--
/George V. Reilly  mailto:[hidden email]
http://www.georgevreilly.com/blog/

Reply | Threaded
Open this post in threaded view
|

RE: Shell support in Vim?

Suresh Govindachar`
In reply to this post by Frank Terbeck

  > Frank Terbeck wrote:  
  > Suresh Govindachar
  >> Personally, the step mentioned below, viz., "moving the mouse
  >> to the xterm" is a _big_ pain.  As a user, what I like about
  >> the idea of a shell inside vim is the means to avoid the mouse.
  >> <C-Z> in console vim does avoid the mouse but it doesn't allow
  >> simultaneous view and fast access of vim and the shell;  and
  >> the shell from <C-Z> doesn't support commands supported by a
  >> vim buffer.  
  >
  > Just use GNU screen <http://www.gnu.org/software/screen/>.
  > There's no need for a mouse just to switch between vim and a
  > shell at all.
 
  Thanks, but I am on Windows.  Also, poking around in
  https://savannah.gnu.org/projects/screen leads one to the
  mailing list http://groups.yahoo.com/group/gnu-screen which
  has the notice:
 
       GNU screen is NOT developed any more.
       The maintainers only fix serious bugs.
 
  From the dates of the files, development on screen stopped
  in Jan 2004.

  I suspect developing a terminal is a complex project.  
 
      - The rxvt shell from MinGW is not recommend by them for
        general use (and does odd things when one uses it
        generally);  

      - tcsh from Amol cannot run UnixUtils from
        http://unxutils.sourceforge.net.  

      - There is someone who patches vim to support a shell but does
        so only for Unix; he doesn't support it for Windows and I do
        not know if he has gone beyond 6.3 or 6.4.

  --Suresh


  --Suresh

Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Matthew Winn
On Wed, May 10, 2006 at 03:37:39PM -0700, Suresh Govindachar wrote:
>
>   > Just use GNU screen <http://www.gnu.org/software/screen/>.
>   > There's no need for a mouse just to switch between vim and a
>   > shell at all.
>  
>   Thanks, but I am on Windows.

What's wrong with opening a second window for a shell and using alt-tab
to switch between them?  I always have two or three shell sessions open,
one or more of which will be running Vim, and I never need the mouse to
switch between them.  About the only time I reach for the mouse is for
copy and paste between windows.

This idea of trying to do everything in one window strikes me as odd.
It's been possible to work with multiple windows for over a decade, so
why restrict yourself to trying to do everything in one place?

>   Also, poking around in
>   https://savannah.gnu.org/projects/screen leads one to the
>   mailing list http://groups.yahoo.com/group/gnu-screen which
>   has the notice:
>  
>        GNU screen is NOT developed any more.
>        The maintainers only fix serious bugs.
>  
>   From the dates of the files, development on screen stopped
>   in Jan 2004.

Could it be that the product works well and already has all the features
it needs, so further development is no longer necessary?  I haven't
needed screen since I worked on a genuine character terminal, but from
what I remember it was fairly feature-complete even then.

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Robert Cussons
In reply to this post by Suresh Govindachar`
Suresh Govindachar wrote:

>   > Frank Terbeck wrote:  
>   > Suresh Govindachar
>   >> Personally, the step mentioned below, viz., "moving the mouse
>   >> to the xterm" is a _big_ pain.  As a user, what I like about
>   >> the idea of a shell inside vim is the means to avoid the mouse.
>   >> <C-Z> in console vim does avoid the mouse but it doesn't allow
>   >> simultaneous view and fast access of vim and the shell;  and
>   >> the shell from <C-Z> doesn't support commands supported by a
>   >> vim buffer.  
>   >
>   > Just use GNU screen <http://www.gnu.org/software/screen/>.
>   > There's no need for a mouse just to switch between vim and a
>   > shell at all.
>  
>   Thanks, but I am on Windows.  Also, poking around in
>   https://savannah.gnu.org/projects/screen leads one to the
>   mailing list http://groups.yahoo.com/group/gnu-screen which
>   has the notice:
>  
>        GNU screen is NOT developed any more.
>        The maintainers only fix serious bugs.
>  
>   From the dates of the files, development on screen stopped
>   in Jan 2004.
>
>   I suspect developing a terminal is a complex project.  
>  
>       - The rxvt shell from MinGW is not recommend by them for
>         general use (and does odd things when one uses it
>         generally);  
>
>       - tcsh from Amol cannot run UnixUtils from
>         http://unxutils.sourceforge.net.  
>
>       - There is someone who patches vim to support a shell but does
>         so only for Unix; he doesn't support it for Windows and I do
>         not know if he has gone beyond 6.3 or 6.4.
>
>   --Suresh
>
>
>   --Suresh
>

Hi Suresh,

it may be that I'm being dense, but what is the problem with Alt-Tab ing
between windows to use both a console and gvim?
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Aaron Griffin
Oh dear god this has been discussed to death.  Bram has spoken - vim
is an editor.  It is not a shell.  It does not support shell features.
 Period.  It is not your editor - feel free to fork it or maintain a
patchset which supports shell features in vim.

I see *nothing* that another terminal cannot do.  To examine some of
the previous excuses:

* But I have to move the mouse to the other terminal!
Get a better WM, or try GNU screen.  Don't blame vim because your
specific setup causes problems when switching applications.  I can
switch to another window in less keypresses that it takes to switch to
a vim window under default keybindings.  GNU screen is actually the
same number of keypresses.  If you want to avoid the mouse, avoid it.

* But I'm on windows and I can't use another terminal because it's windows!
Yeah, and if all these other people have difficulty making a proper
terminal in a win32 environment, it makes total sense that vim should
be able to do it... are you people serious? If you can't run a second
shell on windows because they all suck (they do), then how do you
expect vim to do any better?

* But emacs can do it!
Emacs can also clean my house if I ask it nice enough.  No one is
forcing you to use vim - feel free to use emacs if this is an
important feature.  Simply put: if your excuse is "but X can do it!"
then use X.

* Everyone wants it though!
Bram doesn't.  And "everyone" doesn't seem to be providing code.  If
you're dead serious about this, go ahead and code it up - oh and make
sure it's does proper terminal emulation on win32, POSIX systems, and
also supports serial consoles, as I don't want your patch forcing me
not to use vim on my vt420 in the other room.

* But, but, but!
Too bad.  Those who want this feature are deluded.  You think that
integrating a terminal into vim is going to make your lives easier.
It won't  you will gain nothing.
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

François Pinard
[Aaron Griffin]
>Bram has spoken - vim is an editor.  It is not a shell.

Quite granted.

>I see *nothing* that another terminal cannot do.

I'm happy with what Vim is.  However, here, you could use some more
imagination :-).  There are a few things another terminal cannot easily
do, while these things are more akin to Vim editing in read-only mode
than they are to shell operations.

For example, a shell buffer could do syntax coloring of shell output,
when within a given highly interactive subsystem like Lisp or R, say.  
As long as this precise subsystem is active, the "file type" could be
set to drive the highlighting.  Another thing is the ability to use Vim
search facilities through some voluminous output.  Yet another is the
ability to scroll and wander within previous output, or even do clever
selections like Vim block, or otherwise, which most terminals just do
not offer.

However, Vim does not easily allow editing of growing files (at least so
far that I know), and a shell buffer essentially holds growing output.  
Moreover, Vim does not really proxy interactive communication with other
programs, while this seems essential to implement shell buffers.

Shell buffers also come, sooner or later, with their own complex
requirements, like file name completion (and then, the necessary
directory tracking that goes with it), following the stty settings (like
echo), consequent output cleanup and filtering, more localisation
concerns, etc.  It is more a can of worm than many might think.

I prefer Vim to stay clean and efficient like it is.  Yet, I regret not
having its syntax highlighting abilities over my shell output...

--
François Pinard   http://pinard.progiciels-bpi.ca
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Vincent Wang-2
François Pinard wrote:

> [Aaron Griffin]
>
>> Bram has spoken - vim is an editor.  It is not a shell.
>
>
> Quite granted.
>
>> I see *nothing* that another terminal cannot do.
>
>
> I'm happy with what Vim is.  However, here, you could use some more
> imagination :-).  There are a few things another terminal cannot
> easily do, while these things are more akin to Vim editing in
> read-only mode than they are to shell operations.
>
> For example, a shell buffer could do syntax coloring of shell output,
> when within a given highly interactive subsystem like Lisp or R, say.  
> As long as this precise subsystem is active, the "file type" could be
> set to drive the highlighting.  Another thing is the ability to use
> Vim search facilities through some voluminous output.  Yet another is
> the ability to scroll and wander within previous output, or even do
> clever selections like Vim block, or otherwise, which most terminals
> just do not offer.
>
> However, Vim does not easily allow editing of growing files (at least
> so far that I know), and a shell buffer essentially holds growing
> output.  Moreover, Vim does not really proxy interactive communication
> with other programs, while this seems essential to implement shell
> buffers.
>
> Shell buffers also come, sooner or later, with their own complex
> requirements, like file name completion (and then, the necessary
> directory tracking that goes with it), following the stty settings
> (like echo), consequent output cleanup and filtering, more
> localisation concerns, etc.  It is more a can of worm than many might
> think.
>
> I prefer Vim to stay clean and efficient like it is.  Yet, I regret
> not having its syntax highlighting abilities over my shell output...

I can not agree with you more, you just said what I want to say! ;)

Without shell buffer(I prefer "shell buffer" to shell), vim is already a
very powerful editor;
With shell buffer, it will become even better. Because with a shell
buffer, many other very useful features, for example, integrated
debugging, will be possible. This is just my imagination, not blame or
complain ;) In fact I am very very thankful to the existing features.

Best regards to Bram and other contributors!

Vincent
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

A.J.Mechelynck
In reply to this post by François Pinard
François Pinard wrote:

> [Aaron Griffin]
>> Bram has spoken - vim is an editor.  It is not a shell.
>
> Quite granted.
>
>> I see *nothing* that another terminal cannot do.
>
> I'm happy with what Vim is.  However, here, you could use some more
> imagination :-).  There are a few things another terminal cannot
> easily do, while these things are more akin to Vim editing in
> read-only mode than they are to shell operations.
>
> For example, a shell buffer could do syntax coloring of shell output,
> when within a given highly interactive subsystem like Lisp or R, say.  
> As long as this precise subsystem is active, the "file type" could be
> set to drive the highlighting.  Another thing is the ability to use
> Vim search facilities through some voluminous output.  Yet another is
> the ability to scroll and wander within previous output, or even do
> clever selections like Vim block, or otherwise, which most terminals
> just do not offer.
>
> However, Vim does not easily allow editing of growing files (at least
> so far that I know), and a shell buffer essentially holds growing
> output.  Moreover, Vim does not really proxy interactive communication
> with other programs, while this seems essential to implement shell
> buffers.
>
> Shell buffers also come, sooner or later, with their own complex
> requirements, like file name completion (and then, the necessary
> directory tracking that goes with it), following the stty settings
> (like echo), consequent output cleanup and filtering, more
> localisation concerns, etc.  It is more a can of worm than many might
> think.
>
> I prefer Vim to stay clean and efficient like it is.  Yet, I regret
> not having its syntax highlighting abilities over my shell output...
>
- To use Vim coloring on shell output (but not in realtime): redirect
stdout to a logfile and view that (with a proper filetype & syntax script).

- To watch the output in real-time (but not with Vim coloring) and save
it to a log: use tee (Unix-like systems only)
overwrite:          program param1 param2 | tee program.log
append:          program param1 param2 | tee -a program.log

For instance:
       make | tee make.log
       make install | tee -a make.log

Most "old Unix hands" know this of course, but I bet there are newbies
going over from Windows to Linux (and/or cygwin) every day...


Best regards,
Tony.
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Matthew Winn
On Fri, May 12, 2006 at 04:52:16AM +0200, A.J.Mechelynck wrote:
> François Pinard wrote:
> >I prefer Vim to stay clean and efficient like it is.  Yet, I regret
> >not having its syntax highlighting abilities over my shell output...
> >
> - To use Vim coloring on shell output (but not in realtime): redirect
> stdout to a logfile and view that (with a proper filetype & syntax script).

I don't see how colouring of shell output could be achieved in any
useful way, because by the time Vim was able to see the output all the
meaning of that output would have been lost.  When the output of one
command is directed to a file and then viewed in Vim the type of that
file can be set so that the colouring is appropriate to the data.  If
the command provides its own colouring (as some versions of "ls" do)
then the colouring can represent additional information not otherwise
visible in the output.  But with general colouring of undifferentiated
output text I can't see how anything useful could be conveyed.  All you
can do is make the terminal look pretty.

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Eric Arnold-3
I haven't seen much discussion of the intermediate solution:  have a
command shell that *isn't* a terminal emulator.

There have been several attempts at this, with varying degrees of
success.  A command shell window which does good, solid handling of
command line utilities would be terrific.  It would require none of
the morass of issues of terminal emulation, but still allow me/you to
do many of the things that would be so useful.

I'm currently switching around between plugins like vimsh.vim which
uses Python, and my own home grown version which uses more primitive
interaction with Cygwin OS.  They come close, but aren't fully
fledged, and seemingly aren't well known or used.

I'm fiddling around with using my GetChar patch, which would allow
character by character interaction from Vim script with an external
shell.  This would be best, but until something like this becomes
official, a good line by line interaction would satisfy a real need.

An officially distributed plugin would be a great addition to Vim, on
the order of Netrw.
Reply | Threaded
Open this post in threaded view
|

Re: Shell support in Vim?

Mark Woodward-4
In reply to this post by Aaron Griffin
On Thu, 11 May 2006 16:24:35 -0500
"Aaron Griffin" <[hidden email]> wrote:


> * But I have to move the mouse to the other terminal!

whats wrong with alt-tab? or am I missing something?


--
Mark
12