One of the biggest improvements in my tmux productivity came when I changed my prefix (default Ctrl + b) to backtick (i.e. to `) I am a heavy user of tmux and spend a lot of time switching panes, switching windows, entering visual mode, detatching etc. so this really feels faster. # change prefix to backtick unbind-key C-b set-option -g prefix ` bind-key ` send-prefix
I might be missing something but how do you input character ` as is (in vim inside tmux for example) if it's bound to prefix?
Tmux Tutorial
71–80 of 166 posts
Re: Tmux Tutorial
#72I have been using screen for almost 10 years now, is it worth switching? I know it's not much learning but why switching when screen is not broken? It feels like there's more important stuff I can learn.
Re: Tmux Tutorial
#73One of the biggest improvements in my tmux productivity came when I changed my prefix (default Ctrl + b) to backtick (i.e. to `) I am a heavy user of tmux and spend a lot of time switching panes, switching windows, entering visual mode, detatching etc. so this really feels faster. # change prefix to backtick unbind-key C-b set-option -g prefix ` bind-key ` send-prefix
I've been using C-z for the prefix for ages. It's conveniently nearly under the default position where my fingers lay and it also masks the mostly useless suspend signal which I seemed to accidentally hit every now and then. (If I really want to suspend my program 'C-z z' will do just fine.)
Switching around using, for example, C-z C-n/C-p is pretty fast to key in. You can keep ctrl down for support and then it reduces down to typing 'zn' / 'zp'. YMMV.
Re: Tmux Tutorial
#74Earlier quoted context omitted.
Oh, yes there are. C-b is terrible for your wrist, especially in conjunction with the following commands. Choosing C-a isn't as much about preference as it is about not-terrible ergonomics. Now people are right to prefer anything other than C-a or C-b but C-a is objectively a much saner default than C-b.
Absolute nonsense, are you trying to press C-b with one hand?
Re: Tmux Tutorial
#75Am I the only one using screen? Couldn't switch to tmux since most of what i need is in screen.
Re: Tmux Tutorial
#76I 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.
Re: Tmux Tutorial
#77I of course use graphical applications for browsing, image editing, etc. but nearly everything else I do is from the command line and almost all of that happens over tmux, either locally or remotely. I prefer using a new Tmux window instead of a new graphical window for a temporary shell so I usually just end up having one terminal emulator running on my screen.
The value here is state: tmux keeps my state forever which gives me one less thing to worry about or remember. If I can't finish something right away, I know I'll just go back to the tmux window when I have time. Laptop running out of battery? No problems, I'll just reconnect when I find a charger and reboot my laptop.
For example, I have the exact cursor-to-cursor same view for what I do at work whether I'm at my desktop workstation in the office or using my laptop from the home couch. I can literally leave my cursor on a certain line, leave the office, go home, and continue exactly from where I was when I left, the same exact line. Especially using mosh makes it even more transparent: I just open my laptop at home and my work tmux session is already waiting there on my screen, and will update as soon as I reconnect the work vpn.
I'd much prefer to have something like this for browsing too. I'd like to run a browser muxer server that keeps all my tabs online with all the runtime state, making it available to me wherever I happen to connect from. Browsing something interesting on the train but then I had to hop off? No problem, I'd return to that session on the big screen as soon as I get home and open my laptop. Tab and bookmark syncing doesn't go far enough: I'd like to share one live browser process and access that from everywhere.
I could imagine I could rig up something like that using VNC and Xnest/Xephyr but a custom, hand-designed protocol for remote rendering natively in the browser might just work more seamlessly. I would like the browser in my phone to look like a mobile browser even if the content and state came from the browser server. And I definitely would not want to operate a desktop browser over VNC using my phone.
Re: Tmux Tutorial
#78They even show how to use Tmux with Vim which is my favourite setup
Re: Tmux Tutorial
#79 tmux attach || tmux new -s main
I also recommend remapping ctrl-b to ctrl-space (set -g prefix C-Space). Easier to hit and as a bonus, ctrl-b will work as expected when connected to a remote tmux session.Re: Tmux Tutorial
#80For 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.
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.