1

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@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'

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

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

setw -g mode-keys vi
2
  • 1
    Thanks for sharing the answer! Please note though that cross-posting is strongly discouraged on the Stack Exchange network - please try to avoid that in future. – Zanna Jul 6 '20 at 15:27
  • 1
    Okay, I will. Thanks for notifying me. – Merajul Arefin Pial Jul 6 '20 at 15:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.