Open aborilov opened 7 years ago
Try it this way (for terminal):
vim --noplugin -c 'runtime plugin/xkbswitch.vim'
Is it still bad?
no, with just this plugin, work normally. that plugin in pair with some other break vim. here list of my plugins. may be you will see some suspicious plugin :)
Bundle 'Raimondi/delimitMate'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/syntastic'
Plugin 'airblade/vim-gitgutter'
Plugin 'scrooloose/nerdcommenter'
Plugin 'Valloric/YouCompleteMe'
Plugin 'altercation/vim-colors-solarized'
Plugin 'klen/python-mode'
Plugin 'tomasr/molokai'
Plugin 'vim-scripts/taglist.vim'
Plugin 'szw/vim-ctrlspace'
Plugin 'mileszs/ack.vim'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'edkolev/tmuxline.vim'
Plugin 'sjl/gundo.vim'
Plugin 'benmills/vimux'
Plugin 'ryanoasis/vim-devicons'
" start to work too slow
" Plugin 'lyokha/vim-xkbswitch'
Plugin 'machakann/vim-sandwich'
Plugin 'pearofducks/ansible-vim'
Plugin 'fatih/vim-go'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-unimpaired'
Plugin 'rizzatti/dash.vim'
Try disable translation and Select mode mappings by putting in .vimrc lines
let g:XkbSwitchIMappings = []
let g:XkbSwitchSkipGhKeys = ['gh', 'gH']
nope, didn't helped
I observed the same problem and found out that the reason was in
I just needed to switch back to the _enus layout in command mode without remembering current layout. So I have completely disabled the plugin solved the problem with this code in .vimrc:
function <SID>condLayout()
if mode() == "n"
call libcall('/usr/local/lib/libxkbswitch.dylib', 'Xkb_Switch_setXkbLayout', "2")
endif
endfunction
autocmd InsertLeave * call timer_start(200, { tid -> <SID>condLayout()})
The script checks current vim mode after 200 ms timeout and if it is "normal" - switches to _enus layout. Timeout helps to avoid switching layout on cursor movements.
Thank you guys for the library and this plugin which helped me to find the solution.
I used this plugin for a long time, but after I updated some other plugins, vim starts to lagging very hard(scrolling, moving cursor, etc). To research this problem, I turn off plugins one by one and it looks like xkbwitch cause of the problem. Don't know how updating of other plugins could break xkbswitch.