tmux-plugins / tmux-logging

Easy logging and screen capturing for Tmux.
MIT License
1.05k stars 114 forks source link

How can I remap the keybindings? #41

Closed BlissfulTarpon closed 4 years ago

BlissfulTarpon commented 4 years ago

Hello! I would love to use the save the whole pane option (prefix+Alt+Shift+P) but I already have Alt+Shift mapped as a system shoftcut and it's causing problems (Changing keyboard language). Ideally I would like to use something else, but I don't know where to remap this? Would it be something in my .tmux.conf file along the lines of

set -g @complete-history 'prefix+Shift+O'

Also not sure of the name of the command here. Thanks a lot!

Kr1ss-XD commented 4 years ago

Yep, you can define it in the tmux config file.

set-option -g @save-complete-history-key '<YOUR_BINDING>'

but omit the prefix in the definition.

E/ This file contains the variables (including this and the other keybindings) you can modify via ~/.tmux.conf.

BlissfulTarpon commented 4 years ago

Thanks so much for the reply. It doesn't seem to work for me but that could be my binding that's messed up?

set-option -g @save-complete-history-key 'Alt+O'

Also tried

'Shift+O' 'Shift + O'

With no luck. I have killed the server before. Thanks!

Kr1ss-XD commented 4 years ago

Instead of Alt+O, could you try to enter M-O into the config ? That should work.

E/ btw Shift+O would rather be O. (just a capital O)

BlissfulTarpon commented 4 years ago

I'm having no luck. I am a beginner so maybe I don't do it correctly. This is my config and nothing happens.

set-option -g @save-complete-history-key 'M-O' Capital O

Kr1ss-XD commented 4 years ago

You did reload the config, right ?

BlissfulTarpon commented 4 years ago

Yes, and this is the output of the link you posted

[~] -> tmux show-option -gqv "@save-complete-history-key" M-O

Kr1ss-XD commented 4 years ago

Okay sorry didn't intend to cause confusion with the link. I just wanted to point out what else you could configure regarding this plugin.

If you'd post your .tmux.conf, I could edit that line for you if you like.

BlissfulTarpon commented 4 years ago

Thanks so much and no worries! I need to go slowly haha

`# remap prefix from 'C-b' to 'backtick' unbind C-b set-option -g prefix ' bind-key ' send-prefix

split panes using | and -

bind | split-window -h bind - split-window -v unbind '"' unbind %

switch panes using Alt-arrow without prefix

bind -n M-Left select-pane -L bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D

don't rename windows automatically

set-option -g allow-rename off

bigger scrollback history limit

set-option -g history-limit 10000

List of plugins

set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tmux-plugins/tmux-logging'

set-option -g @save-complete-history-key 'M-O'

set -g @continuum-restore 'on'

Search mode VI

set-window-option -g mode-keys vi

STATUS BAR

source-file '~/.tmux/powerline'

Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)

run -b '~/.tmux/plugins/tpm/tpm' `

Edit: And I can't post properly here apparently smh

Kr1ss-XD commented 4 years ago

Never mind.

It's actually entered properly in your config. Could you please try

tmux show-option -gv "@save-complete-history-key"

in a shell inside tmux and post the output ?

BlissfulTarpon commented 4 years ago

[~] -> tmux show-option -gv "@save-complete-history-key" M-O Just to be clear, I tried physically:

Prefix key + Shift + O Prefix key + O Prefix key + M + O

Kr1ss-XD commented 4 years ago

Ah I think I see now.

M is a synonym fot the Alt key. So If you type PREFIX+Alt+Shift+O it should work.

Crossing fingers :laughing:

BlissfulTarpon commented 4 years ago

OMG got it!! Thanks so much for this. I'm really sorry for the bother, love the work and it will come in handy! You're the best!

Kr1ss-XD commented 4 years ago

Never mind, you're welcome. Glad we sorted it out. Have a good night !