vim-tmux-focus-events
vim-tmux-focus-events copied to clipboard
Can we avoid reserving <F24>?
trafficstars
In the plugin code,
" When Tmux 'focus-events' option is on, Tmux will send <Esc>[O when the
" window loses focus and <Esc>[I when it gains focus.
exec "set <F24>=\<Esc>[O"
exec "set <F25>=\<Esc>[I"
where we have a normal map
nnoremap <silent> <F24> :silent doautocmd <nomodeline> FocusLost %<CR>
nnoremap <silent> <F25> :doautocmd <nomodeline> FocusGained %<CR>
However, I would like to use <F24> for another mapping. In some terminals (e.g. xterm-256color) & neovim environments, <F24> is <Shift-F12>. As this plugin reserves <F24> for <Esc>[O, I cannot map custom commands to <Shift-F12>. Is the choice of <F24> or <F25> compulsory, or can we use another special key sequence?
In vanilla vim, <F24> and <Shift-F12> are recognized differently (this might vary depending on TERM). However in neovim they are treated same. So for neovim, I can currently work around by simply not using this plugin (See #1).