mscoutermarsh / dotfiles

my Vim/Tmux config :muscle::zap:
https://mikecoutermarsh.com/boston-vim-learning-vim-in-a-week/
Other
765 stars 181 forks source link

Tmux - Use vim keybindings in copy mode #10

Closed AlessandroSteri closed 6 years ago

AlessandroSteri commented 6 years ago

Hi, I've got the following errors:

~/.tmux.conf:42: invalid or unknown command: bind-key -t vi-copy v begin-selection ~/.tmux.conf:43: invalid or unknown command: bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" ~/.tmux.conf:45: invalid or unknown command: unbind -t vi-copy Enter ~/.tmux.conf:46: invalid or unknown command: bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" ~/.tmux.conf:48: invalid or unknown command: unbind -t vi-copy Space ~/.tmux.conf:49: invalid or unknown command: bind -t vi-copy Space jump-again I think keybindings must be updated as suggested here: https://github.com/tmux/tmux/issues/754 to make compatible with new tmux

I have solved this way:

setw -g mode-keys vi bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi y send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"

unbind-key -T copy-mode-vi Enter bind-key -T copy-mode-vi Y send-keys -X Enter copy-pipe "reattach-to-user-namespace pbcopy"

unbind-key -T copy-mode-vi Space bind -T copy-mode-vi V send-keys -X Space jump-again

bind y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy ' bind C-y run 'tmux save-buffer - | reattach-to-user-namespace pbcopy '

do you think is it ok? best

mscoutermarsh commented 6 years ago

@AlessandroSteri thanks!

Yes, that's great. I just updated the repository to be compatible with latest tmux. 😄