Refactor tmux and set-clipboard detection
Move logic to `autoload/tmux.vim` to detect the `vim` is being run inside a `tmux` sessions and if the `set-clipboard` option is enabled. This cleans up adding the optional `oscyank.vim` plugin when needed.
This commit is contained in:
4
vimrc
4
vimrc
@@ -200,9 +200,7 @@ Pack 'jrozner/vim-antlr'
|
||||
|
||||
" Plugins for remote integrations
|
||||
Pack 'greymd/oscyank.vim', {'type': 'opt'}
|
||||
let g:use_osc52 = $TMUX !=# '' &&
|
||||
\ trim(system('tmux show-options -g set-clipboard')) ==# 'set-clipboard on'
|
||||
if g:use_osc52 && isdirectory(expand('~/.vim/pack/minpac/opt/oscyank.vim'))
|
||||
if tmux#isSetClipboardOn()
|
||||
packadd oscyank.vim
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user