Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make FocusGained/Lost work in command mode.

Also gets rid of "No matching autocommands" warning.
  • Loading branch information...
commit 556e249d705b69669a4b68ac142120c3ac561e2b 1 parent 9ad4120
@aaronjensen aaronjensen authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 plugin/vitality.vim
View
16 plugin/vitality.vim
@@ -127,9 +127,25 @@ function! s:Vitality() " {{{
inoremap <silent> <f24> <c-o>:doautocmd FocusLost %<cr>
inoremap <silent> <f25> <c-o>:doautocmd FocusGained %<cr>
+ cnoremap <silent> <f24> <c-r>=vitality#DoFocusLost()<cr>
+ cnoremap <silent> <f25> <c-r>=vitality#DoFocusGained()<cr>
+
+ autocmd FocusLost * :
+ autocmd FocusGained * :
+
" }}}
endfunction " }}}
+function vitality#DoFocusLost()
+ :doautocmd FocusLost %
+ return ''
+endfunction
+
+function vitality#DoFocusGained()
+ :doautocmd FocusGained %
+ return ''
+endfunction
+
if s:inside_iterm
call s:Vitality()
endif
Please sign in to comment.
Something went wrong with that request. Please try again.