Live data from Hacker News

Benefits of using tmux – streamlining your development environment

blog.bugsnag.com

31–40 of 172 posts

Re: Benefits of using tmux – streamlining your development environment

#32
post #24

Earlier quoted context omitted.

I do that, not in a real "tiling window manager" but something very close: openbox, set to show no titlebars, and using shortcuts to title the windows to precise positions. I have 3 position: most of my screen on the left, a small vertical slice on the right, a smaller chunk underneath. If I want a titlebar for some application, I have a shortcut that will give the window a titlebar, and then I can move it around wit…

Thanks, this is very interesting. I agree one of the major pain points of X11 systems, terminals, etc is the clipboard. So many different concepts and shortcuts across programs. I use xmonad, urxvt or xterm, emacs-nox and vimperator. I'm trying to make all them consistent. Perhaps the last thing to polish in my setup.

/bin/stty start "" stop "" intr ^x

add to .inputrc:

"\C-q": quoted-insert

Then remap copy to ctrl-c, and paste to ctrl-v, and ctrl-x will work like your old ctrl-c, while ctrl-q will work like your old ctrl-v. remapping is easy with roxterm. I suppose xterm and urxvt can do the same.

If you like to remove part of words in bash, the following can be helpful too:

"\C-s": backward-kill-word

"\C-g": kill-word

"\C-w": unix-word-rubout

Kill word vs word-rubout is a matter of taste, and which separators are in your filenames.

Re: Benefits of using tmux – streamlining your development environment

#33
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 with tmux and urxvt. Tmux has a nice copy mode, which has emacs and vi modes. By default it copies to tmux buffers, but you can set it up to copy to the system's clipboard:

https://coderwall.com/p/4b0d0a/how-to-copy-and-paste-with-tm...

It's rather idiosyncratic but I've gotten used to running all my terminals inside a single tmux window. I spend 95% of my time in either a terminal or Chrome so I basically only use awesome to switch between them, or put a browser and terminal side by side.

Re: Benefits of using tmux – streamlining your development environment

#34
post #22

Earlier quoted context omitted.

I mainly like it because scrollback works in the GUI.

That's one frustration I have with Tmux. I want mouse scrollback, but don't want the other mouse controls. If I remember correctly I would accidentally go into copy-mode when I click-dragged my mouse by accident.

That's the largest gripe I've had. Eventually, I got used to not relying on GUI scrollback - that actually sped things up for me. In a pinch I just `hotkey, [` to activate scroll, then just use my mouse or page-up & page-down. Even if you don't use tmux, get used to piping anything you'd want to read through `less`. It'll speed your workflow up.

Re: Benefits of using tmux – streamlining your development environment

#35
post #30

I use a tool called tummy ( https://github.com/minhajuddin/tummy full disclosure: built by me) which allows me to create a Tmuxfile per project. A typical file looks like this: session "liveform" directory "/home/minhajuddin/r/liveform/frontend" window "src", [ pane("vim TODO"), ] window "server-pry", [ pane("puma --port 3000 --config

Your github seems to be missing the code! require "tummy/version" module Tummy # Your code goes here... end

All of the code is actually in a executable script https://github.com/minhajuddin/tummy/blob/master/exe/tummy

I am a bit biased, but it has been working very nicely for me. It also has ability to pass raw tmux arguments for things which aren't supported by it.

Re: Benefits of using tmux – streamlining your development environment

#36

Earlier quoted context omitted.

I'm sorry if I'm missing something obvious, but what on earth is the point being made here?

I think they are trying to say screen is better since it uses less code.

not sure he says screen is better. screen is much older, but it's interesting to see the code comparison. i doubt this says anything about code quality - i expect a lot of non OOP code in screen and more in tmux.

despite having fewer lines of code, screen's tar gz is at ~1mb, while tmux is at ~470k.

overall, interesting.

Re: Benefits of using tmux – streamlining your development environment

#37

I use a tool called tummy ( https://github.com/minhajuddin/tummy full disclosure: built by me) which allows me to create a Tmuxfile per project. A typical file looks like this: session "liveform" directory "/home/minhajuddin/r/liveform/frontend" window "src", [ pane("vim TODO"), ] window "server-pry", [ pane("puma --port 3000 --config

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/or want REPLs loaded you might not want them sitting around in memory for months if you're not going to use them.

It is trivial to get working. Just use tmux plugin manager to install tmux-resurrect and tmux-continuum.

https://github.com/tmux-plugins/tpm

Example usage in my dotfiles: https://github.com/positron/dotfiles/blob/master/.tmux.conf#...

Re: Benefits of using tmux – streamlining your development environment

#39
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 do that, not in a real "tiling window manager" but something very close: openbox, set to show no titlebars, and using shortcuts to title the windows to precise positions. I have 3 position: most of my screen on the left, a small vertical slice on the right, a smaller chunk underneath. If I want a titlebar for some application, I have a shortcut that will give the window a titlebar, and then I can move it around wit…

I use Openbox with some keybindings I picked up from ArchBang a while back, documented here [1].

tmux really comes into its own when you combine it with Vim and FZF [2]. I was initially hesitant to try tmux, but once I themed my tmux.conf and nailed down the keybindings, it became indispensable to me. I now use tmux as a basic organizational tool, and I always have at least one tmux session running on my desktop.

I have Ctrl+A+S bound to split the tmux screen horizontally, and Ctrl+A+A to toggle maximizing the tmux pane. Shift-DownArrow opens up a new tmux window to the right of the current one. Shift-LeftArrow and Shift-RightArrow move left and right between the tmux windows. I wanted it to be reminiscent of URxvt tabs.

Another one of my favorite bindings works as follows: visually highlight a line in Vim, then hit tj, which sends the highlighted line of code to an open terminal in a split tmux window below. Very useful for REPLs. You can also open Vim in the lower split terminal and use the same keybinding to send text directly from one Vim instance to another. It uses vim-tbone [3] and some custom bindings from @junegunn.

[1] https://github.com/atweiden/dotfiles

[2] https://github.com/junegunn/fzf

[3] https://github.com/tpope/vim-tbone

Re: Benefits of using tmux – streamlining your development environment

#40
post #20
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…

Similar to that, I've seen a lot of blog posts about Tmux and Vim, but I've been itching to see one where they talk about day-to-day. When do they use vim-split versus tmux pane, vim buffers versus tmux windows? I use both, but aren't very systematic...there's a bit of cognitive load when remembering which I'm using and using the different commands to navigate. You can't do diffs with panes and it's nice to use vim b…

What I do, and would recommend, is spin up vim or emacs as a daemon, then connect to it as a client in one or more tmux windows.

That way, you can yank/put easily using the usual shortcuts from any tmux window to any tmux window. Then, it's usually easiest to only use intra-process pane splitting (keeping it all in vim or emacs) unless you need to do something that doesn't follow a perfect division, like:

top half vim / bottom left vim / bottom right trailing logfile

or something.

More than happy to write a blog post, if you're interested.

Post reply on HN