why is terminal multiplexing (TMUX, Screen) useful with VIM?

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

why is terminal multiplexing (TMUX, Screen) useful with VIM?

Gallagher Polyn
With the arrival of a new laptop, I'm attempting to learn all-new best practices for programming, including using VIM as my primary editor.

In the course of learning VIM online, I've run across a few tutorials by Chris Hunt, in which he touts the use of TMUX with VIM (for example, www.youtube.com/watch?v=vHdiXoHKSgU.)

My question is why wouldn't solo coding in the terminal with tabbed windows plus VIM alone be sufficient? Assuming no need to share one's terminal with others, what does terminal multiplexing give the VIM user that they don't already have?

Thanks,

G

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: why is terminal multiplexing (TMUX, Screen) useful with VIM?

Matteo Cavalleri
> My question is why wouldn't solo coding in the terminal with tabbed windows plus VIM alone be sufficient? Assuming no need to share one's terminal with others, what does terminal multiplexing give the VIM user that they don't already have?

I think it's (as usual) a matter of personal preferences. however here are the reason why i use tmux:

* i can save precious screen space which is usually occupied by the tabs

* usually you need some awkward key combinations to switch tabs. not really a big issue, and i suppose some (or maybe all) terminal emulators may let you customize these shortcuts, but i still prefer the tmux way :) which btw works the same on all terminals. i use linux at work and osx at home, so i would need to learn different keys to switch tabs with terminology and iterm2

* tmux sessions! it's like organizing tabs into different projects. i basically never use this at home, but at work i have to work on different projects, so i made a little bash script that creates all the sessions and tabs (panes) i need. this way i have a nicely organized workspace.

* if the terminal crashes or you close it by mistake, you don't lose your work (a couple of times it happened...)


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: why is terminal multiplexing (TMUX, Screen) useful with VIM?

Tim Chase
In reply to this post by Gallagher Polyn
On 2013-11-04 04:54, Gallagher Polyn wrote:
> My question is why wouldn't solo coding in the terminal with tabbed
> windows plus VIM alone be sufficient? Assuming no need to share
> one's terminal with others, what does terminal multiplexing give
> the VIM user that they don't already have?

In addition to screen-sharing, tmux (or GNU screen) offer a bunch of
other nice features:

- the ability to reattach from another machine and have everything
  just how you left it.  I regularly will start a tmux session on a
  work machine, then come home and SSH into the machine to check on
  it (everything is just where/how I left it in the session), then
  re-attach back at work.

- if it's a remote machine, only connecting once.  This is more a
  factor if you need to enter a password, rather than using
  passwordless public/private key auth.  But even with passwordless
  key-pairs, you still have to type "ssh u...@host" rather than
  "{prefix key}c" to create a new connection on the same machine.

- the ability to monitor windows for activity/silence.  This is nice
  for backgrounding a compile and being notified when it goes silent
  (usually means it's done) or watching a long-running quiet process
  to get notification when it finally has some output.  I used this
  feature a LOT back when I did C/C++ work.

- depending on your tabbed terminal windows, terminal multiplexors
  usually offer some split-screen abilities (last I checked, GNU
  Screen only offered horizontal splits; tmux had both vertical &
  horizontal splits).  Since Vim doesn't have a way to include a
  terminal window inside Vim unless you rebuild it with unofficial
  patches, this allows me to have an editor in one {screen|tmux}
  window and a shell in the other and be able to see them together.
  I don't use it much, but it's nice to have when I do need it.

- tmux offers the ability to transmit keyboard input to all
  linked/synchronized windows, so you can connect to multiple servers
  and then issue the same commands and they get run across all of
  them.  I believe Screen offers a similar ability to broadcast
  keystrokes to all windows, but with a clunkier interface.  Sort of
  a poor-man's "clusterssh".  I've not needed this one, but it's
  there in case you manage clusters or develop/deploy with them.


Those are just a few of the things that come to mind.  Some might be
replicated by a tabbed terminal window; others less so.

(ripped somewhat gratuitously from my post to comp.lang.python on the
same topic[1])

-tim


[1]
http://code.activestate.com/lists/python-list/633671/








--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: why is terminal multiplexing (TMUX, Screen) useful with VIM?

Sam Roberts
In reply to this post by Gallagher Polyn
On Mon, Nov 4, 2013 at 4:54 AM, Gallagher Polyn
<[hidden email]> wrote:
> My question is why wouldn't solo coding in the terminal with tabbed windows plus VIM alone be sufficient? Assuming no need to share one's terminal with others, what does terminal multiplexing give the VIM user that they don't already have?

I used two terminals side-by-side for years, with shortcuts to move
among them, and multiple tabs in each terminal, and switched to tmux 6
months ago.

Tabs are often full-window, so to have vim and a shell side-by-side,
you need two terminal windows. Some terminals allow you to split tabs
vertically in them, though. But basically, they offer less
configurability in tab setup... I often use a full height vim buffer
on left, and two half-height stacked buffers on right (with tmux). Its
not common to be able to get that kind of layout with a terminal
program.

tmux allows it, and also is terminal independent, so you can use tmux
on mac, linux, over ssh to the server, and get the same features. Its
basically much more flexible than terminal's, and their tabs. Also,
you can have multiple projects simultaneously with tmux, and each with
their own shell and editor buffers, and switch back and forth between
them.

It takes some time to setup, and I avoided it for years because it
didn't seem worth it, but now that I've adopted tmux, I don't  think I
could go back!

I haven't read it, but I've heard this is a good book to introduce
good habits: http://pragprog.com/book/bhtmux/tmux

Sam

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: why is terminal multiplexing (TMUX, Screen) useful with VIM?

LCD 47
On 24 November 2013, Sam Roberts <[hidden email]> wrote:
[...]
> I haven't read it, but I've heard this is a good book to introduce
> good habits: http://pragprog.com/book/bhtmux/tmux

    I have, and in my opinion it is indeed an excellent little book.
You'd probably find a few thought-provoking ideas in it even as an
experienced user of tmux.

    /lcd

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.