7 ms·
I realise you can rebind them, but both screen and tmux do themselves a disservice by choosing binding keys which overlap with prominent keys in emacs and for u
by cturner 14y ago
I realise you can rebind them, but both screen and tmux do themselves a disservice by choosing binding keys which overlap with prominent keys in emacs and for users who use emacs mode in their shell.
First impressions count.
If you want to configure tmux to use just a backtick as the escape, create ~/.tmux.conf
unbind C-b
set -g prefix `
bind-key ` send-prefix
When you need to type a backtick just press it twice.
For screen, I used to do this:
escape ``
.. in ~/.screenrc, but I've just tried it and it seems that there's now no easy way to type a backtick when you need one.
Query: in screen I can switch between two buffers by doing ctrl+a, ctrl+a. This doesn't work in tmux. How do I configure this to work in tmux?
- stevekemp 14y ago> Query: in screen I can switch between two buffers by doing ctrl+a, ctrl+a. This doesn't work in tmux. How do I configure this to work in tmux? "Ctrl-b n" for next-window?
- cturner 14y agoThat's not quite what I'm after. I guess it's hard for non-screen people to know what I'm talking about from my vague description above :) Here's a scenario to show what I mean: you're in buffer 5. You switch to buffer 2. Now if you do ctrl+a, ctrl+a, you leap back to buffer 5. And if you do it again, you go back to buffer 2. This is great when you're editing code in one session and running it in the other.
- dwb 14y agoI use that screen behaviour for panes: bind C-a last-pane but last-window exists too.
- cturner 14y agoawesome. I hadn't thought of that but it's much better. thank you. I've now switched last-window to bind C-s last-window, because it's fast to tap out.
- pavel_lishin 14y agoIs there a way to set it up to do this if you hit (escape-key) (current buffer index)? That's the way weechat works, and I keep expecting it to work in tmux as well :/
- mpyne 14y agoI think the idea is to be able to pound on whatever the defined escape key is to be able to toggle buffers, not that's he unable to find a command to switch to the next window.
- zaius 14y agobind C-a last-window Switch the C-a for whatever your bind-key is.
- cturner 14y agothank you sir! I am now entirely migrated to tmux. :)
- latortuga 14y agoPer your query: ctrl+a ctrl+a is how I switch between two windows (tmux calls them windows, they're basically tabs). If you want to switch between two panes (divisions inside a window, the equivalent of splitting the screen in a regular editor or visible buffers in vim/emacs), use ctrl-a o. I also have these bindings in my tmux conf for moving between panes painlessly: # use hjkl for moving bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R
- cturner 14y agoNice one. I've now also added resize variations of these. bind-key C-j resize-pane -D 8 bind-key C-k resize-pane -U 8 bind-key C-h resize-pane -L 8 bind-key C-l resize-pane -R 8
- iambvk 14y agoI bind C-z as the escape character (in screen). It seems to serve me well :)
- pyre 14y agoI use ` as the prefix, so you might take a look at my tmux.conf[1] if you want help transitioning. [1] http://pastebin.com/g6frvnnr http://pastebin.com/g6frvnnr
- pavel_lishin 14y agoDitto; mine's at https://github.com/pavellishin/dotfiles/blob/master/.tmux.conf https://github.com/pavellishin/dotfiles/blob/master/.tmux.co... a
- cbsmith 14y agoEmacs users should be using Emacs as their terminal multiplexer...
- reedlaw 14y agoCould you elaborate? I'd love to try that.
- Derbasti 14y agoJust open several terminal buffers in Emacs.
- emidln 14y agoThis isn't very useful if what you want to run in your terminal buffer needs to constantly update its screen while you're working in a different buffer (e.g. irc, tailing log files, etc)
- cbsmith 14y agoUmm.. why is it not useful? Emacs will allow multiple buffers to update at once, and you can work in a third while watching them... That's kind of the idea.
- BCM43 14y agoM+x ansi-term should do it. I'm not sure how well that scales to many terminals though. M+x term also works. There is also eshell.
- easytiger 14y agoansi-term and term are massively buggy. I've never been able to get it to deal well with vast amounts of output well. Constant overwriting issues etc. Definitely prefer to use tmux + emacs considering the huge amount of stuff i end up throwing at my term.
- 14y ago
- philjackson 14y agoIf ctrl-a is your escape key then just do this: bind-key C-a last-window
- q_revert 14y agobindkey 'a' last-window bindkey C-a last-window if you use the command frequently enough, it might be worthwhile binding `^a a` and `^a^a`, similar to the tactic of binding F1 to <esc> in vim
- _kst_ 14y agoI use the null character in GNU screen: escape ^@^@ On most keyboards, you can enter it with control-space, which is very easy to type and rarely used for other purposes (though emacs uses for `set-mark-command`). Control-] can also be a good choice (at least for US-style keyboards that don't require shift for the square brackets).