Live data from Hacker News

Getting Started with Tmux

ittavern.com

11–20 of 160 posts

Re: Getting Started with Tmux

#12
post #5

I've only used tmux for about One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my…

This sounds like my setup! I literally have 1 button startup for starting all my normal programs (including split tmux windows, each running appropriate startup commands for what ever process they need) and it moves all my windows into their regular positions. I usually get into to work, plug in the laptop, press my button and go make coffee :)

Re: Getting Started with Tmux

#13
Tmux becomes more awesome when you use something like Alacritty or Kitty [EDIT: scratch Kitty, this mainly applies to Alacritty] and map your system's key (Apple's command key or... whatever it would be on Linux or Windows) and use that as your "tmux key". That way you can make single-chord bindings for all things tmux and life becomes better. If you use Vim, adding VimTmuxNavigator[0] improves things so much. For example, to seemlessly switch between panes, be they tmux panes or vim panes, I use `cmd-h`, `cmh-j`, `cmd-k`, `cmd-l`.

It's possible to achieve "command as tmux key" with iTerm which I did do for years but I don't recommend it. It's very hacky.

[0] https://github.com/christoomey/vim-tmux-navigator

Re: Getting Started with Tmux

#14
post #5

I've only used tmux for about One of my favorite scripts to run is a tmux script that creates a new session with about 7 windows of running my company's project (one window for notes, 3 windows for the backend (runner, code, tests), and 3 windows for the client (runner, code, tests). It's even tweaked further to open up the code in vim, and when used in conjunction with something like harpoon.nvim I have access to my…

Did you check out tmuxinator? Sounds like you reinvented it, cool, but maybe there’s some inspiration to be had.

Re: Getting Started with Tmux

#15
My favorite mod is something simple as renumbering the windows/tabs to range starting at 1, rather than being zero indexed, this way they align with the digits on my keyboard.

Re: Getting Started with Tmux

#16
Tmux made my first months with linux on server way easier

Great tool

I just wish that eg windows' (os) terminal was smarter when you have eg two windows in tmux next to eachother and try to select line or text with mouse then it was just selecting from one window, not many or all

Re: Getting Started with Tmux

#17
I would add Prefix + z for temporarily maximizing/minimizing pane to the full windows is very useful.

Config doesn't have to be very complicated, I've used this for a while.

  set -g mouse on                # allow mouse
  set -g history-limit 999999999 # unlimited history
  set -sg escape-time 0          # vim esc response faster

Re: Getting Started with Tmux

#18

Tmux becomes more awesome when you use something like Alacritty or Kitty [EDIT: scratch Kitty, this mainly applies to Alacritty] and map your system's key (Apple's command key or... whatever it would be on Linux or Windows) and use that as your "tmux key". That way you can make single-chord bindings for all things tmux and life becomes better. If you use Vim, adding VimTmuxNavigator[0] improves things so much. For ex…

I'm personally a fan of byobu - it moves the shortcuts to function keys.

Re: Getting Started with Tmux

#20
I used to use TMUX user, back in the days when I could SSH to servers. Now days, using a containorized stack (K8s) with cloud native deployment infra/tooling, cli's for accessing the remote resources, rigid access restrictions, etc. I found that I was only using it for managing multiple windows/panes for my local tooling. And have simplified my setup to just doing that inside local Terminal software (iTerm for me right now). (No more configuring copy/paste, scrolling buffers, custom key-bindings so they don't interfere with other emacs, shell bindings, configuring the prefix binding because hitting ctrl-b before each command is annoying, etc.). I used to also use tmux resurrect to persist between sessions, etc. but it often failed me as much as remembered where I left off.

My TL;DR: sure, use Tmux if you're directly accessing remote resources often, otherwise there's probably simpler solutions that might get you 95% of the way there.

Post reply on HN