tmux/Q/Is there a way to do rectangular selection when using oh-my-tmux and tmux with vim visual selection mode?
Is there a way to do rectangular selection when using oh-my-tmux and tmux with vim visual selection mode?
My Notes
- I haven't done this successfully yet. I find it difficult to quickly determine what to edit at which layer - of configuration; there's tmux itself, then there's oh-my-tmux, then there are my configurations layered on top in the .tmux.conf.local. Could use some CLI/Coaching.
Answer
- AI/Response
- Yes. tmux copy mode with vi keys supports rectangular (block) selection. Behavior depends on your bindings.
Default / toggle-based (no config) AI/Need/Confirmation
Vim-like bindings (recommended)
- If oh-my-tmux has already bound
vtobegin-selection, rectangle mode can be unavailable unless you add explicit bindings. In.tmux.conf.local(oh-my-tmux's user override - .tmux.conf.local), you can make it behave like vim: v= character-wise selection,C-v= rectangular selection,y= yank. No need to press Space afterC-v:- text
bind -T copy-mode-vi v send -X rectangle-off \; send -X begin-selection bind -T copy-mode-vi C-v send -X rectangle-on \; send -X begin-selection bind -T copy-mode-vi y send -X copy-selection-and-cancel - Use
rectangle-on/rectangle-offrather thanrectangle-togglesovandC-vdon't flip state in confusing ways.
- If oh-my-tmux has already bound
tmux version
Sources
- AI/Response