Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

131–140 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#131
post #9

Does anyone run tmux with a tiling window manager for local development? If so, what are the advantages? I know automating sessions is one of them, as explained in the article. I am more interested in hearing about interactions with the terminal. You already get good mouse-less window management with something like i3 or xmonad. How about copy & paste? I use urxvt plugin for this, but I often find myself using the mo…

I use awesome wm, tmux and vim. awesome gets the job done. I don't see differences enough in the others to make me go through the trouble of switching. I'm not super fond of the default keybindings but I know the ones I need - easy to re-bind but not worth it.

I use mostly the stock awesomewm taskbar/dock setup. I tried doing custom stuff there and it was doable ... but the "reload my wm and see if it fails to start even though syntax check passed" got old, and I gave up.

I'll usually have my desktop split two thirds terminal, with the remaining third split between browser[1] and slack. (Or all terminal, with the other stuff on additional monitor(s)). I don't usually have enough windows open to use more than one 'tag' or desktop, but when I find myself wandering afield in my browsing, I tends to shunt offtopic stuff off to another tag.

I use two tmux sessions , with one showing at any one time. I run them in Konsole - out of all the terminal emulators I've found, that's the one that can handle massive scroll rates without lagging.

The first tmux session is named 'pairing' and is where I do my day-to-day work. Anyone on my team who sshs in will auto-connect to that session. For a while I had it prompting me for approval via an awesome popup but that broke with the ugprade to more recent versions and wasn't useful enough to fix. I now just have a notification that displays on connect/disconnect.

Within each session, I have topical windows - usually per-project. A single vim and one or more shell panes. I have set up (neo)vim so that any time I "vi" in any pane of a tmux window, it opens in that window's vi session. A given window may have quite a number of shell panes depending on the environment. And for some testing cases, tmux's "synchronize-window" is invaluable.

In vim, I prefer splits to tabs and end up using lots of both. I'm slowly learning to get comfortable with buffers and will see how that changes things.

In the second named session ('private') I manage mail (mutt, but experimenting with more CLI-driven options like nmh), twitter (rainbowstream), irssi (via nested tmux on a cheap vps) and my project/notes/todo manager - which is another three-pane vim split, with shell functions that let me send stuff over there/read from there from anywhere.

I rely heavily on small helper scripts and lately a growing number of custom macros on my keyboard.

Some of the things I've read in the comments here have given me plenty more stuff to explore :)

Heh. Now that I write it up, I see that it's apparently really complex - but it's evolved over time and suits my work really well. I'm still ironing out the info/todo management tooling but it looks promising.

[1] If browsing text wasn't a horrible experience I'd do all of that in the shell too.

Edit: If folks are remotely interested, I can write up a blog post and publish some of my hacks.

Re: Benefits of using tmux – streamlining your development environment

#132
post #72

Earlier quoted context omitted.

I used to use tools like that (tummy, teamocil, etc) but I've since discovered tmux-resurrect. It persists tmux sessions, windows, panes, and a whitelist of non-destructive commands like vim and top across reboots. Now my tmux sessions just organically grow and shrink as necessary and I never worry about having to recreate them. Of course I can see the case for combining both tools. If you have a lot of projects, and…

Does it save environment variables too?

No, but add an autoenv script of your choice, like zsh-autoenv and the combination is nearly perfect.

Re: Benefits of using tmux – streamlining your development environment

#133

If you use tmux and vim, and if you run tests, then you must look at janko-m/vim-test and vim-dispatch. Runs any test seamlessly in the background. Vim-dispatch also has the best intro video to anything ever ;) https://vimeo.com/63116209

Video is awesome. What is the advantage over just having a separate tmux/screen session in which you launch your command though?

Well, the nice thing here is that with the integration between vim-test and vim-dispatch is that you don't have to do anything for having the tests run in a separate session. It just works. I mean really you _are_ just having it run in a separate session, just more smoothly.

If the tests pass then the tmux window the tests were run in will just disappear, if not, you get popped back to the quickfix window with the errors listed.

Give it a go and see how you like it! :)

Re: Benefits of using tmux – streamlining your development environment

#134

If you want to get a taste of the benefits of tmux without having to learn anything new, I recommend using iTerm and setting up an alias for 'ssh [your server] -t "tmux -CC attach || tmux -CC"' Just running that command will connect to your server and attach to an existing tmux session, or create a new one if needed, and make use of iTerm's tmux integration, so you can use the standard macOS keyboard commands (or the…

Are there terminal emulators on other platforms that offer similar tmux integration?

Re: Benefits of using tmux – streamlining your development environment

#135

"All problems in computer science can be solved by another level of indirection" David J. Wheeler Tmux/Screen provides an extra redirectable abstraction layer over the terminal device. The biggest complaint I regularly see about it is that people are used to the screen keybindings. I wonder why not add an abstraction layer there, where keypresses really call commands that perform the actions, and you could reconfigur…

But (a) screen still exists right?, (b) byobu, (c) tmux allows one to remap the keys however one likes.

Re: Benefits of using tmux – streamlining your development environment

#137
post #123

I use Tmux resurrect[1] with Tmux continuum[2] so that after rebooting my laptop, my tmux session is restored. [1]: https://github.com/tmux-plugins/tmux-resurrect [2]: https://github.com/tmux-plugins/tmux-continuum

If you use ViM, vim-obsession[1] work with tmux-ressurect[2] to restore vim -S

[1]: https://github.com/tpope/vim-obsession [2]: https://github.com/tmux-plugins/tmux-resurrect/blob/master/d...

Re: Benefits of using tmux – streamlining your development environment

#138
post #90

Earlier quoted context omitted.

This would be great if you get it working. I don't suppose you've got a link for what you've got so far in git or anything? I only make basic use of tmux because I'm more comfortable with i3 key bindings.

Well, it's extremely rudimentary but I put everything on github : https://github.com/roblabla/i3-tmux-integration/tree/in-prog... I'm still stumbling in the dark trying to understand how everything works. Also, the code might be an abomination, my goal was mostly to get stuff working, refactoring will come later. This project is at once a learning project for many things (tmux internals, Rust, IPC in general, i3 IPC)…

This sounds cool. Especially for me since i have been using a chrome book with Linux. There is no cmd or windows key so I have to use alt for i3 but then have nothing for vim/tmux navigator.

Re: Benefits of using tmux – streamlining your development environment

#139

I've been using tmux heavily in my local development workflow for the last 6 months or so, and it absolutely pays off to have three window tiles in a single terminal window at a bare minimum. I am also using teamocil to manage windows and panes in tmux, although it's not needed at all: https://github.com/remiprev/teamocil When I set up initially on OSX, the conf took me a few to get right so that I have some mousing…

How do you get into VI copy mode?
Post reply on HN