Live data from Hacker News

Tools I Use - tmux

rdegges.com

21–30 of 61 posts

Re: Tools I Use - tmux

#21

So I've recently got into using vim and quite like the split screen features. How would I mix something like this in for doing day to day running commands and editing stuff with a vim split screen workflow? Sorry if this seems like a difficult question, but even stories of how people manage this would be great :)

I use vim splits as well. I find my typical workflow is something like this:

1) Open a tmux split (vertical). 2) In the left tmux pane, open vim (and split horizontally). 3) On the right side, have my tests open and running via a watch command, eg: watch -n 10 "nosetests", or something similar.

Re: Tools I Use - tmux

#22
I actually use Emacs and shell-mode to do exactly this. It has its own advantages and disadvantages, and only makes sense for people already using Emacs, but it's definitely something to consider.

A neat trick: by default, C-u M-x shell opens a shell with a custom buffer name in another window (in Emacs, the different panes are called "windows") in a specified directory. If you're editing a file remotely with TRAMP, the shell will be opened remotely as well.

I find this really useful when I'm editing multiple files on multiple remote systems and need to run some commands. This also integrates well with the rest of Emacs, making working with multiple shells, different files and other stuff really easy.

Re: Tools I Use - tmux

#23
The best thing I ever did in tmux, was to set a myTerminal variable in xmonad to "urxvtc -e tmux".

So every terminal window I open already has a tmux inside and I never have that "oh, it would be nice if I haven't forgot to turn tmux on" feeling.

Re: Tools I Use - tmux

#24

I used screen for 15 years but recently switched because I liked tmux's easy-to-read conf file and scriptability. Mac OS X users watch out, launchctl commands barf mysteriously inside of tmux.

This should be added to a FAQ somewhere. Took me ages to figure it out on my own, especially since the error msg is so generic -> http://pig-rabbit.com/tmux-and-launchctl

Re: Tools I Use - tmux

#25
post #4

There are multiple problems with tmux on OS X. pbcopy and pbpaste, for instance, are entirely unusable. Even if tmux has some nice benefits over screen, it probably isn't worth it to the Mac user to switch.

Instead of trying to make the native copy/paste work, can anyone think of a way to set up key bindings in OSX to mimic copy/paste but store the text in /tmp/mypasteboard or something?

Would AppleScript do it and would that work in any application?

Re: Tools I Use - tmux

#26
I get the same effect by using a different shell: terminator

Monday morning: Fire up terminator, hit Ctrl-Shfit-O, Ctrl-Shift-E (3 windows, a 'main window' and two 'sub-windows' that are side-by-side), fire up a build in a sub-window, Ctrl-Shift-N to move to the 'main' window, fire up "vim -O sources/*" .. and .. I'm done with window management for the week. Seriously great way to organize the flow of my main tools!

Re: Tools I Use - tmux

#27

So I've recently got into using vim and quite like the split screen features. How would I mix something like this in for doing day to day running commands and editing stuff with a vim split screen workflow? Sorry if this seems like a difficult question, but even stories of how people manage this would be great :)

I am a tmux/vim user and I find this a constant problem. Split tmux panes don't allow your vim windows to communicate with each other (you could always fallback to using the system buffer, though that is often insufficient). Yet, split vim windows don't allow a shell in a single window.

I don't use tmux, but terminator instead. Where tmux is a terminal multiplexor, terminator is .. a terminal! With amazing split-window abilities ..

So I work like this: a "main window" in terminator with my vim session (in which vim administers its own windows - great with cscope integration and so on) and two sub-windows. The two sub-windows are for doing things like shell hacking on the project, another for builds, and so on.

To cut/paste between the windows, when necessary, I either use tee to put things in /tmp for easy ":r"-ing in vim, or I just use the window manager clipboard. In the 'main editing window' where vim has its own windows for each file and so on, yank/paste work great - to go from shell to shell, mouse-select/mouse-middle-button work great.

Debugging, you say, with line-by-line code inspection? In a sub-shell: 'gdb -tui' is awesome. I also build most of my projects such that ':make' returns a proper vim clist that can easily be easily navigated through standard vim bindings..

I don't use tmux, screen, for the simple reason that I like the flexibility that having terminator manage the windows gives .. Check it out, in case you're interested.

Re: Tools I Use - tmux

#28
I keep having this nagging feeling I should use tmux more often. Right now I use it for remote pairing type stuff, but I can never bring myself to use it regularly. I love tmux, and it's super useful, but I just can't deal with the way it breaks scrolling. tmux and screen both horribly break scrolling and reverse searching. I'm not sure what the fix is, but until that works I can't see myself using it regularly.

Re: Tools I Use - tmux

#30
Big thing holding me back from tmux is the lack of cygwin support for (unfortunately) my work environment. Otherwise, I'd switch cold turkey.
Post reply on HN