14 ms·
For those who customize their configs and, like me, SSH into all kinds of different short- and long-lived servers regularly: How do you stay sane? I don't want
by Legogris 7y ago
For those who customize their configs and, like me, SSH into all kinds of different short- and long-lived servers regularly: How do you stay sane?
I don't want to have to scp over my tmux conf to every single server I jump on, but OTOH difference in pretty much anything but the prefix gets really frustrating with habits. Particularly remembering all the emacs mode-keys when I really want the vi ones.
- abcdef123xyz123 7y agoI customize/copy my configs on the boxes I use regularly and just learn enough of the defaults to get by on boxes I am using only occasionally (eg I know enough vi to get by but if I am using a box for a bit I install emacs and if I am using it a lot I copy my .emacs as well). It helps that I keep my configs small and in a single file for each program so I can copy them quickly if I need to. For tmux, it will look at VISUAL/EDITOR so for vi keys you could just try to remember to run it as "VISUAL=vi tmux" or to run "tmux set -g mode-keys vi" if you forget.
- Legogris 7y agoDidn't consider that the mode can be set from environment variable, then it can just be automatically set from my ssh command, thanks for the tip! Searching back in the buffer in emacs mode is the one thing I've been keep having to look up
- mmahemoff 7y agoI have a Github dotfiles repo so I can set it up on any server in a couple of minutes, just by cloning the repo and running a script within it. If you're jumping between different servers, I would highly recommend having a quick way to setup config like this. It's a short investment that pays dividends for many years - not just for tmux config, but setup for bash, vim, and any other utils you rely on. I use one tmux prefix for the local machine and another one for ssh sessions (setup in bash_profile using something like `if [[ -n "$SSH_CLIENT" ]] ; then tmux set-prefix ... etc`. You need different prefixes when using tmux recursively like this, so you can navigate both the inner and outer session. I also use a different color theme for ssh sessions, whch helps to know which prefix to use until it becomes somewhat subconscious.
- Legogris 7y agoUsed to have that actually, it's just too much of a hassle in today's cloud environment (I can easily SSH into dozens of fresh instances over a day and there's no way I'm baking my personal config into an image). I was considering to revisit and streamline that, but I imagine the cognitive overhead of different remote hosts having different configs is worse than what I have now (local=my config, remote=vanilla). I just bind a different prefix and moved the bar to the top locally (I use urxvt+tmux with Ctrl+arrow keys etc to navigate tmux tabs instead of a tabbed terminal client) to get around the nesting issue.
- lunchables 7y agoI use git and GNU stow. ssh in, clone the repo, stow tmux. Takes ~10 seconds on a new host. Also includes all the other dot files I use (bash, vim, etc).
- Legogris 7y agoCan't believe I missed stow, this goes straight to the bucket list!
- bloopernova 7y agoif you use iterm2 on a Mac, and aren't colour-blind, then there's a somewhat cool thing you can do with zsh+ssh: based on the hostname, change the colour of the tab to represent something like dev/test/qa/uat/stage/prod/etc. Here's roughly what I use: https://gist.github.com/anthonyclarka2/f2aae1e167c7899d7d263a3d89cd4349 https://gist.github.com/anthonyclarka2/f2aae1e167c7899d7d263... It could also be adapted to anything other than ssh. For instance kubectl, aws cli, virtualenvs, etc etc. Let me know if this helps, and if you have any suggestions!