6 ms·
it's missing changing Ctrl+B to Ctrl+A: # ~/.tmux.conf set-option -g prefix C-a
by eu 2y ago
it's missing changing Ctrl+B to Ctrl+A:
# ~/.tmux.conf
set-option -g prefix C-a
- ravoori 2y agoYou must mean changing Ctrl-B to Ctrl-A
- anyfoo 2y agotmux changed screen's C-a prefix to a more sensible C-b. C-a is pretty universally used as "jump to beginning of line", which for screen meant that you'd have to git "C-a a" instead all the time. Seriously annoying, and therefore lots of screen configs changed the prefix away from C-a for that reason.
- yjftsjthsd-h 2y agoOkay, but C-b is "go back one char" and that's also pretty common? I'd personally lean towards saying maybe either C-z or C-s are better? Because suspending a process is a lot less useful when you've got a full multiplexer, and C-s is just... I guess somebody uses it, but I don't think I've ever used it on purpose and it's kind of annoying to accidentally freeze your terminal (and again, tmux has an actual scrollback mode which seems like it covers that use). Edit: Oh hey, https://superuser.com/questions/74492/whats-the-least-conflicting-prefix-escape-sequence-for-screen-or-tmux https://superuser.com/questions/74492/whats-the-least-confli... is a whole discussion of options
- anyfoo 2y agoGood point. Though C-s is fine unless you have software scroll control enabled, and it's used in emacs and anything that follows its key bindings very often as well for incremental search forward. (It's not used in the shell even though that typically implements emacs bindings, because there you usually want to incrementally search backward, i.e. C-r.) I think C-z is the perfect candidate for the reasons you mentioned.
- actinium226 2y agoBut, go back one char is also left arrow. Why do you need another key for that?
- reactordev 2y agoWe didn’t have arrows back then
- jwiz 2y agoLeft arrow is not where my fingers are, but ctrl-b is. I would have to move my whole hand over to the arrow keys, or I can use the edge of my right hand (on a full size keyboard, not laptop) to hit ctrl, and hit "b" with my left index finger.
- aaronbaugher 2y agoI use F2. Unlike the arrow keys, I don't have to move my hands and I can hit it reliably. I use it enough that I want it within reach, but not so often that I need it on the home row, and all Ctrl combinations there are already tied to emacs operations in my mind.
- yjftsjthsd-h 2y agoWhat, and move my entire hand to the far side of the keyboard like some sort of savage? (But seriously, I actually do prefer avoiding moving my hands for ergonomic reasons.)
- fragmede 2y agoYou should do whatever you want with your hands, but you should be aware that not moving your hands is bad for ergonomics. It promotes static posture and staying in one position for too long can cause muscle stiffness and strain. Moving around promotes blood flow and reduces fatigue. Consistent doing a small set of motions (ie never moving your hands) is what leads to RSI. Of course, a bad setup is a bad setup, and if you're moving your hands a lot because your workspace is poorly setup, you'll also have issues. For best results, you'll want to keep your hand movements natural and comfortable and your tools within easy reach. Take short breaks to move your hands, as well as your entire body.
- theshrike79 2y agoI can easily tap C-a with one hand with very minimal hand position change. C-b requires me to move my whole hand to reach both keys with my left hand. Thus: C-a wins
- ink_13 2y agoI set it to backtick (`) No need for that character 99% of the time, and hitting two in a row will still send it anyway
- ledauphin 2y agothis is the way. also works great in combination with `set -g base-index 1` so that switching between the first 9 windows can be done naturally, with `-1, `-2, etc.
- axiolite 2y agoI use backticks in shell scripts all the time. Meanwhile, I've never had a legit use for: Ctrl-y so that's my tmux escape.
- mdaniel 2y agoI don't intend this to yuck your yum, but if you haven't seen it shellcheck advises against backticks because they don't nest unlike $(basename $(dirname "...")) along with some other edge cases https://www.shellcheck.net/wiki/SC2006#rationale https://www.shellcheck.net/wiki/SC2006#rationale and https://mywiki.wooledge.org/BashFAQ/082 https://mywiki.wooledge.org/BashFAQ/082
- axiolite 2y agoI find most of shellcheck's opinions quite arbitrary. Wider shell compatibility is a good reason to use backticks. Avoiding nesting is always possible. Quoting may be a concern in more complex usage. But yes, I know well, and often also use $( ) syntax. Making a lot of noise about use of (the shellcheck author's) non-preferred syntax, which works perfectly fine in a given context, is a design flaw that renders shellcheck useless to me. I'm perfectly capable of finding an opinionated pedant on my own who will also critize the syntax I use (with little or no justification), and offer no actual help...
- tambourine_man 2y agoI use C-Space, easy to type, doesn’t conflict with other shortcuts
- _imnothere 2y agoUhh... only if you're not a CJK-language-user, C-Space is a common shortcut to switch between IME state.