-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve documentation comments, configuration variables, and autocmds
- Loading branch information
Showing
3 changed files
with
43 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
call system('type xkbswitch') | if !v:shell_error | ||
if !exists('g:barbaric_default') | ||
let g:barbaric_default = system('xkbswitch -g') | ||
endif | ||
if executable('xkbswitch') | ||
" The input method for Normal mode (as defined by `xkbswitch -g`) | ||
let g:barbaric_default = system('xkbswitch -g') | ||
|
||
if !exists('g:barbaric_scope') | ||
let g:barbaric_scope = 'buffer' | ||
endif | ||
" The scope where alternate input methods persist (buffer, window, tab, global) | ||
let g:barbaric_scope = 'buffer' | ||
|
||
if !exists('g:barbaric_timeout') | ||
let g:barbaric_timeout = -1 | ||
endif | ||
" Forget alternate input method after n seconds in Normal mode (disabled by default) | ||
" Useful if you only need IM persistence for short bursts of active work. | ||
let g:barbaric_timeout = -1 | ||
|
||
augroup barbaric | ||
autocmd! | ||
autocmd InsertEnter * call barbaric#switch('insert') | ||
autocmd InsertLeave * call barbaric#switch('normal') | ||
autocmd FocusGained * call barbaric#switch('focus') | ||
autocmd FocusLost * call barbaric#switch('unfocus') | ||
autocmd VimLeave * call barbaric#switch('unfocus') | ||
augroup END | ||
endif |