Hacker News new | past | comments | ask | show | jobs | submit login

The thing about tmux bindings is that, as far as I know, very few people like the defaults.

I've taken the approach of 'learn the defaults' for vim, but on tmux that simply won't stand because the defaults have so much room for improvement.

Pretty much everything I've read on tmux suggests the - and | bindings for window splits, same goes for hjkl bindings for movement. Adding these bindings would go a long way towards standardizing tmux.




Yeah, I learned screen defaults, so ^A is far too strong of a habit to change.


I use screen, and in my book the choice of ^A for the default escape is a giant WTF, and remapping that is the first thing I do on a new account before starting to use screen (I use ^o, for no particular reason I suppose except it's not used by anything else I use). Don't the screen developers ever need to go to the beginning of a line in the shell or editor?


> Don't the screen developers ever need to go to the beginning of a line in the shell or editor?

C-a a. Using emacs with screen for many years, this is almost automatic for me.


When not using tmux/screen, the complete invocation is C-a a M-x roll-eyes RET Backspace.


This is really easy to remedy: just bind send-prefix to C-a C-a. That way you'll be able to easily go to line beginning inside tmux, and outside you won't type the unnecessary 'a' character.

Moreover, I forgot if it's the default or if I set it somehow, but in Emacs a single C-a goes back to the beginning of a line, but C-a C-a goes back to the beginning of text on the line, which is almost always what I want anyway. So I press C-a twice anyway, everywhere, and I don't have the problem you described at all :)


content of dot screenrc file:

defbce on

defutf8 on

escape ^]^]

markkeys "h=^B:l=^F:$=^E"

setenv LANG en_US.UTF-8

startup_message off

term $TERM

Copy pasted from somewhere, i do not recall from where.

ctrl-A is now ctrl-]

This does not clashes with Emacs, ctrl-A


At this point it's muscle memory for me to use C-a a to get to the beginning of a line, to the point that when I'm not in screen there will be extra "a"s at the beginning of my commands.

As for editors, I use vim. (With almost no customization, as others have advocated.)


A friend suggested remapping the Screen command key to ` (backquote), and it changed my life. Maybe it's because I grew up using Esc key combos a lot (terminals with broken/missing meta keys), but it feels natural to treat it like another modifier key there on the left edge of the keyboard.


I did that as well, and it was Great and Good and obviously the Right Thing — right up until I pasted in a some shell code which used `` instead of $(). Never again.

These days I use C-z for tmux. It works, and C-z z is easy enough to type when I want to put something in the background.


I'm a committed (interpret that as you like) tcsh user, so yeah, that keybinding gets in the way. On the flip side, it's gotten me out of the habit of blindly copying/pasting shell code, which is a security win, right? ;)


I'm going to interpret that as "committed to an institution" :) Tcsh makes my brain hurt.


I just switched from C-z to C-q and couldn't be happier. C-z was fine, but I realized it was a really unergonomic stretch. With caps lock as ctrl, C-q is only a slight movement of my ring finger.


Well, I think a lot of it is because not everyone has historically had emacs mode defaulted in their shell. Lots of people who learned to use the shell in ksh (myself included) probably share similar feelings towards the emacs bindings. With that in mind, ctrl-a makes a lot of sense when you're not in emacs mode. `set -o vi` is a wonderful command ;).


I never used screen and still did the rebind simply for the easy 1-handed operation. I ignored the prefix change because I've actually hear some people prefer the default ^B. I know of no-one who prefers % and " for pane splits.


That, and switching to the vi-like keybindings for copy mode, are the only two things I change. And even so, I can and do use an unconfigured tmux with only minor irritation. Configuration just looks like an elaborate way to make sure you're unable to use other people's systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: