Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multi-column terminal multiplexer?

Let me explain what I'm looking for, hopefully for the terminal, but if it exists in an IDE, i'll take that too.

I have a laptop with a 1366x768 resolution screen; I use vim for code-writing, and I use a fairly small font in my terminal (~7pt). So, as you might imagine, there's a lot of "wasted" horizontal space, especially when coding in a compact language like python.

I just checked and found that with a 6pt. font, the maxyx of my terminal is 82 rows x 271 columns. What I'd like to have, essentially, is a single terminal with the dimensions of 246 rows x 90(89?) cols, split into 3 panes and displayed side by side. But, they would need to behave as one contiguous vertical pane, i.e., when i scroll in my editor, all three of them scroll synchronously.

Does anyone know of a hack or anything to accomplish this? Maybe for vim/screen/similar?

Patching screen might be a fun project, but I don't have time to chase that rabbit. If someone out there does, though, I'll order them a pizza or something ;)

(although if i get around to it first, i'll have to order myself a pizza)

like image 350
la11111 Avatar asked Aug 15 '12 03:08

la11111


2 Answers

I had the very same desire and others want this as well. Lacking any options I implemented my own two column virtual terminal. See the --columns option for selecting a different number of columns than two.

like image 173
Helmut Grohne Avatar answered Nov 14 '22 17:11

Helmut Grohne


EDIT: based on comments, I now understand the requirement better. i.e. viewing one text file in a newspaper-like multi-column format.

It seems more like an editor feature rather than a multiplexer feature (because the 2 editors should be linked). Thanks to @romainl for mentioning :set scrollbind. This seems capable of doing the job in combination with some additional vim magic.

Here's an superuser q&a showing how to use scrollbind for your purposes: https://superuser.com/questions/243931/how-do-i-maintain-vertical-splits-with-scrollbind-in-vim .

Original answer: vim and [recently] screen both offer vertical-split, as does tmux.

I don't know about any way to scroll simultaneously, but tmux's 'synchronize-panes' does offer simultaneous input. Can be useful!

  • For vim, use :vsplit
  • For screen (recent versions), use C-a |
  • Alternative to screen, I use tmux. It offers (default keys) C-b %, then you can use C-b :setw synchronize-panes for simultaneous input across panes.

Hope this helps.

like image 29
laher Avatar answered Nov 14 '22 17:11

laher