Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vi-copy and vi-choice not working #592

Closed
will118 opened this issue Oct 17, 2016 · 30 comments

Comments

@will118
Copy link

commented Oct 17, 2016

I recently did a brew upgrade and tmux updated (to HEAD d54e990).

With the following config file:

❯ cat .tmux.conf
bind-key -t vi-copy v begin-selection

I get this when starting tmux: unknown key table: vi-copy

There is similar issue (#585) but it seems this user resolved their problem somehow.

From what I can tell, the vi-edit and vi-copy options are deprecated in favour of vi-choice?

However if I replace it with this:

❯ cat .tmux.conf
bind-key -t vi-choice v begin-selection

then I get: unknown command: begin-selection

Then I searched the source and found how it was being set, and used that:

❯ cat .tmux.conf
bind -Tcopy-mode-vi v send -X begin-selection

This works but I'm not convinced it's the correct solution?

Apologies if I missed something obvious. I also realise that I'm not exactly running a release.

@nicm

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2016

This was documented in the commit message for 76d6d36.

@nicm nicm closed this Oct 17, 2016

@will118

This comment has been minimized.

Copy link
Author

commented Oct 17, 2016

Seems I didn't look hard enough, thanks a ton Nicholas.

Speedy reply!

@nicm

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2016

Basically you now need to bind your key in the copy-mode-vi table now, look at how the default key bindings are done with "tmux lsk". For your example: bind -Tcopy-mode-vi v send -X begin-selection

@jayniz

This comment has been minimized.

Copy link

commented Oct 24, 2016

Perhaps this can save somebody one or two minutes:

bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection

can be changed to

bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection

Bonus: on MacOS Sierra you can drop reattach-to-user-namespace, but make sure you have the "Applications in terminal may access clipboard" option set when using iTerm2.

@CallumHoward

This comment has been minimized.

Copy link

commented Nov 15, 2016

It seems like reattach-to-user-namespace is still required in OSX Terminal, I have:

bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe "reattach-to-user-namespace pbcopy"

copy-selection is nice however because it seems like it doesn't jump to the bottom after copying, any way to use copy-selection with reattach-to-user-namespace?

sajoku added a commit to sajoku/dotfiles that referenced this issue Nov 16, 2016
ibigbug pushed a commit to ibigbug/dotfiles that referenced this issue Dec 5, 2016
duncanjbrown pushed a commit to duncanjbrown/dotfiles that referenced this issue Jan 10, 2017
Duncan Brown
Update vi-mode bindings for tmux 2.4
tmux/tmux#592

Also explicitly name tmux 2.4 in the readme
duncanjbrown pushed a commit to duncanjbrown/dotfiles that referenced this issue Jan 11, 2017
Duncan Brown
Update vi-mode bindings for tmux 2.4
tmux/tmux#592

Also explicitly name tmux 2.4 in the readme
azat added a commit to azat/dot_files that referenced this issue Feb 14, 2017
@kesselborn

This comment has been minimized.

Copy link

commented Mar 11, 2017

Late comment on @CallumHoward's question:

bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"

jumps to the bottom after copying

eddiezane referenced this issue in eddiezane/dotfiles Apr 20, 2017
carakan added a commit to carakan/dotfiles that referenced this issue Apr 20, 2017
joshukraine added a commit to joshukraine/dotfiles that referenced this issue Apr 21, 2017
@1ambda

This comment has been minimized.

Copy link

commented Apr 21, 2017

my configuration for tmux 2.4 looks like

bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
esamson added a commit to esamson/dotfiles that referenced this issue Apr 24, 2017
joshdick added a commit to joshdick/dotfiles that referenced this issue Apr 28, 2017
johnliu55tw added a commit to johnliu55tw/dotfiles that referenced this issue Apr 29, 2017
marcoslhc added a commit to marcoslhc/dotfiles that referenced this issue Apr 29, 2017
laomaiweng added a commit to laomaiweng/dotfiles that referenced this issue Apr 29, 2017
marocchino added a commit to marocchino/dotfiles that referenced this issue May 1, 2017
aperezdc added a commit to aperezdc/dotfiles that referenced this issue May 3, 2017
Julian added a commit to Julian/dotfiles that referenced this issue May 3, 2017
dtchepak added a commit to dtchepak/dotfiles that referenced this issue May 4, 2017
Updated tmux.conf for tmux 2.4
Original thoughtbot stuff is out of date. Found new commands in github
issue[0], plus "set-option -g default-command" stuff in
reattach-to-user-namespace github readme [1].

[0]: tmux/tmux#592
[1]: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
@mrolli

This comment has been minimized.

Copy link

commented May 4, 2017

To confirm what @jayniz has posted above:
With iterm-2.4 on Sierra using iTerm2 with activated "Applications in terminal may access clipboard" the following works for me:

bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy

reattach-to-user-namespace is NOT necessary anymore!
Using copy-pipe-and-cancel makes it jump to bottom after copy action, as it was previously. If you don't want this behavior just used copy-selection (without pbcopy then) and you're done.

tupton added a commit to tupton/dotfiles that referenced this issue May 6, 2017
Update vi copy mode key tables
See tmux/tmux#592 for more details.
Ledarium added a commit to Ledarium/dotfiles that referenced this issue Jun 12, 2017
hpurmann added a commit to hpurmann/dotfiles that referenced this issue Jun 20, 2017
Update tmux config
tmux changed the syntax of these commands, see
tmux/tmux#592
nguyening pushed a commit to nguyening/dotfiles that referenced this issue Jul 5, 2017
@barcher

This comment has been minimized.

Copy link

commented Jul 7, 2017

Just a piece of feedback: I don't think that a GH issue, or a commit is the best place to document a breaking change. You might consider an, "Updating to New Releases" section in the future to be proactive.

david-pitty added a commit to david-pitty/dotfiles that referenced this issue Aug 2, 2017
RobinClowers added a commit to RobinClowers/dotfiles that referenced this issue Aug 4, 2017
loganlinn added a commit to loganlinn/dotfiles that referenced this issue Aug 7, 2017
possibilities added a commit to possibilities/dotfiles that referenced this issue Aug 15, 2017
matthewtodd pushed a commit to matthewtodd/dotfiles that referenced this issue Aug 25, 2017
sdvcrx added a commit to sdvcrx/dotfiles that referenced this issue Oct 7, 2017
cburmeister added a commit to cburmeister/dotfiles that referenced this issue Nov 5, 2017
fonglh added a commit to fonglh/dotfiles that referenced this issue Nov 30, 2017
zgulde added a commit to zgulde/dotfiles that referenced this issue Dec 1, 2017
Updates tmux config for new tmux version
sometime in the last year an update came around that broke my old config

see tmux/tmux#592 (comment)
zgulde added a commit to zgulde/dotfiles that referenced this issue Dec 1, 2017
Updates tmux config for new tmux version
sometime in the last year an update came around that broke my old config

see tmux/tmux#592 (comment)
LandonSchropp added a commit to LandonSchropp/dotfiles that referenced this issue Dec 12, 2017
Fix tmux configuration issues
* Tmux changes the way it configures Vim commands.
  (tmux/tmux#592)
* The readme instructions did not include instructions on how to install
  tpm.
@vcavallo

This comment has been minimized.

Copy link

commented Jan 16, 2018

I'm on OS X 10.11.6 and Tmux 2.6 and for me begin-selection doesn't actually begin the selection. However <shift>-v does work to begin a line-wise selection (and copying / the clipboard works fine).
Sorta stumped on this one...

update:

Ok, it looks like no matter how I try to define my v for beginning selection, it gets overwritten by space. that is, space will trigger begin-selection. I'll assume this is some dumb issue with my local config files - but if anyone has any other ideas feel free to let me know.

update two:

Yep, dumb stuff on my end. combination of not restarting sneaky tmux servers and managing my own dotfiles framework. All is well!

bitifet added a commit to bitifet/dotfiles that referenced this issue Jan 24, 2018
willprice pushed a commit to willprice/dotfiles that referenced this issue Jan 31, 2018
Will Price
[tmux] Update tmux vi keybindings
See the following tmux commit for the change that makes this configuration
changes necessary
tmux/tmux@76d6d36

Also: tmux/tmux#592
matthewtodd added a commit to matthewtodd/dotfiles that referenced this issue Feb 8, 2018
@arcseldon

This comment has been minimized.

Copy link

commented Feb 24, 2018

The following provided exactly what I wanted (combination of settings from above). Thanks for the contributions.


# vi like copy paste behaviour
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
bind-key -Tcopy-mode-vi Escape send -X cancel
bind-key -Tcopy-mode-vi V send -X rectangle-toggle
@alphaCTzo7G

This comment has been minimized.

Copy link

commented Apr 6, 2018

Wonder if there is a good plugin that handles the differences between versions and provides good settings for vi-mode in tmux?

Otherwise, it seems people are manually setting this everywhere, in their tmux conf. It would be cleaner to just use a plugin

sergeylukin added a commit to sergeylukin/dotfiles that referenced this issue Oct 8, 2018
kusold added a commit to kusold/dotfiles that referenced this issue Oct 9, 2018
ngs added a commit to ngs/dotfiles that referenced this issue Jan 17, 2019
henrybw added a commit to henrybw/dotfiles that referenced this issue Jan 21, 2019
Update tmux.conf vi copy mode syntax for tmux 2.4
Many thanks to this comment on the relevant tmux issue:

tmux/tmux#592 (comment)
henrybw added a commit to henrybw/dotfiles-min that referenced this issue Jan 21, 2019
Update tmux.conf vi copy mode syntax for tmux 2.4
Many thanks to this comment on the relevant tmux issue:

tmux/tmux#592 (comment)
cacack added a commit to cacack/dotfiles that referenced this issue Feb 19, 2019
wolframkriesing added a commit to wolframkriesing/dotfiles that referenced this issue Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.