I'm trying to become more proficient with tmux, but I ran into ( what seems to me ), a weird issue. Here's my tmux.conf:
1 TERM=screen-256color
2 set-option -g default-terminal $TERM
3
4 TMUX_COLOUR_BORDER="colour237"
5 TMUX_COLOUR_ACTIVE="colour231"
6 TMUX_COLOUR_INACTIVE="colour16"
7
8 set-window-option -g window-status-activity-bg $TMUX_COLOUR_BORDER
9 set-window-option -g window-status-activity-fg $TMUX_COLOUR_ACTIVE
10 set-window-option -g window-status-current-format "#[fg=$TMUX_COLOUR_ACTIVE]#I:#W#F"
11 set-window-option -g window-status-format "#[fg=$TMUX_COLOUR_INACTIVE]#I:#W#F"
12
13
14 set -g prefix C-a
15
16 bind-key o split-window -v
17 bind-key e split-window -h
18
19 bind-key w kill-pane
I'm trying to copy paste between two panes. So, I hit Ctrl-a-[ , and then Ctrl-space. The thing is, I don't see a visual selection of the block, and alt-w also does not work ( since I guess it's not even entering copy mode ). Is there an obvious error in my tmux.conf? Can you spot what I'm doing wrong?
tmux has an option, mode-keys
, you can find it in man page.
default is emacs
, but if your $EDITOR
is vim/vi, tmux will use vi
.
So the key binding will be in vi mode.
E.g. your Alt-w
won't work, it is emacs binding. you can see a table of key-binds in tmux man page.
some related to your question:
Function vi emacs
Copy selection Enter M-w
Start selection Space C-Space
so you should go with the vi-mode keys.
I used vim mode too, and did a little customization (to make it same as vim) in my tmux.conf, maybe you could give it a try:
bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind-key -t vi-copy 'y' copy-selection # Yank selection in copy mode.
In case it helps, I had a correct tmux configuration (with vi like settings for selection & copy/paste) but needed to set these two environment variables in my .zshrc file (using Zsh & Neovim):
export EDITOR='nvim'
export VISUAL='nvim'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With