Vim Mode Copy-Paste Not Working on Tmux

Vim Mode Copy-Paste Not Working on Tmux

I am new at using Tmux. I have seen that it is quite difficult to copy-paste inside Tmux. So I searched for an easier method. Some sites suggested that I should use vim mode as I am quite familiar with vim. But, vim mode copy-paste isn't working. I don't know what I am doing wrong. But default copy-paste key binding working perfectly. Like Ctrl-Space is selecting text and Ctrl-w or Alt-w is copying the selected text inside Tmux. This is my ~/.tmux.conf file.

# Improve colors
set -g default-terminal 'screen-256color'

# Set scrollback buffer to 10000
set -g history-limit 10000

# Customize the status line
set -g status-fg  green
set -g status-bg  black

set -g mouse on

bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

# remap prefix to Control + a
set -g prefix M-a
# bind 'C-a C-a' to type 'C-a'
bind M-a send-prefix
unbind C-b



# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@
# set -g @plugin 'git@

set -g @plugin 'jimeh/tmux-themepack'

set -g @themepack 'powerline/block/blue'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

I am using Tmux 2.5. Thanks in advance for your help.

0

1 Answer

The solution was to add this option in my .tmux.conf file.

setw -g mode-keys vi
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.