EDIT: After checking the source code, I've re-written my answer completely.
I originally thought this wasn't possible because I couldn't get this to work, but the other answers are correct about
v being the correct key for this, but it's not obvious how to use this, especially if you are used to vim.
Also, it wouldn't work for me because I had
v bound to
begin-selection - I think I must have blindly copied this idea from somewhere else to mimic the vim way to start a character wise selection, not knowing it would cause problems further down the road with block selections.
$ tmux -V
$ tmux list-keys -t vi-copy | grep " v "
bind-key -t vi-copy v begin-selection # suppressed my block selection mode
Once I took away this binding (by commenting out the line in my
.tmux.conf and restarting tmux), it started to work, but it's still rather confusing because it's not the same as vim at all.
With default bindings, it should work as follows:
- Make sure you have tmux unning with
setw -g mode-keys vi in your
C-a [ to start copy mode
- move the cursor to where you want to begin the selection
Space to start the selection
- move the cursor and you will see a rectangular selection
- you can press
v again to toggle the selection back into character-wise selection or vice-versa.
You don't have to type the
v before you press
Space. You could start the the character-wise selection with
Space first and press
v afterwards to toggle to rectangular selection mode.
It's quite different from vim in that in tmux you have to type two characters:
v to get into rectangular selection mode. In vim you only have to type
Also in vim
v starts a character-wise selection, not block.
Sadly, there doesn't seem to be a line-wise selection mode in tmux (
Shift-v in vim).
EDIT: It looks like Tmux version 2.0 provides a line-wise selection mode with
Shift-v (I haven't tried it yet though!)