Example: copy in one tmux pane (via vim), then switch to another pane (running another vim instance) and paste using the vim paste command. I know this can be done via tmux (using prefix+]) but it would be really handy if I can copy and paste using vim bindings since i'm just switching between different panes running vim.
Any ideas?
Assuming your tmux command shortcut is the default: Ctrl + b , then: Ctrl + b , [ Enter copy(?) mode. Move to start/end of text to highlight.
Sorry, I'm trying to convince you to use vim built-in features.
To make the copy/paste
easy, you can open files in another Tabpages:
:tabe /path/to/another/file
Use gt or gT to switch Tabpages.
Or split the window to edit another file:
:sp /path/to/another/file
Use Ctrl-ww to switch Windows.
To split the window vertically, please use :vsp file
This is my .tmux.conf
file:
# vim setw -g mode-keys vi bind [ copy-mode bind -t vi-copy v begin-selection bind -t vi-copy y copy-selection bind -t vi-copy V rectangle-toggle bind ] paste-buffer # buffer bind Space choose-buffer
I only use them when I need to copy terminal output.
I've been used this handy binding for several years :)
" copy to buffer vmap <C-c> :w! ~/.vimbuffer<CR> nmap <C-c> :.w! ~/.vimbuffer<CR> " paste from buffer map <C-p> :r ~/.vimbuffer<CR>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With