Thanks again for everything you do for this wonderful file manager!
I created the :togglescreen command, as :screen doesn't provide any output, so it isn't immediately clear if you just enabled or disabled integration with a terminal multiplexer.
" Disable Tmux integration at startup
screen! | screen
" View if Tmux integration is enabled
nnoremap <Space>c :screen?<CR>
" Toggle Tmux integration
nnoremap <Space>C :togglescreen<CR>
command! togglescreen
\ :if $VIFM_SCREEN == 1
\ | echo 'Disabling Tmux integration'
\ | let $VIFM_SCREEN = 0
\ | screen
\ |else
\ | echo 'Enabling Tmux integration'
\ | let $VIFM_SCREEN = 1
\ | screen
\ |endif
Is there a way to read its current status, so there's no need to use variables, something like &screen?
A related question; I am trying to create a mapping that first makes sure Tmux integration is enabled and then opens the selected files in Vim in a split:
noremap <silent> <C-v>v :screen! | :!$EDITOR %f %v<CR>
This works great, but it opens just one file in Vim, even if I selected multiple files. Comparing the results from !echo %f %m and screen! | !echo %f %m confirms that the second command doesn't receive the full file list when two commands are combined.
Things I have tried:
- using :execute
- Doubling the % sign (read here)