Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cause lagging in vim #29

Open
aborilov opened this issue Jan 25, 2017 · 5 comments
Open

Cause lagging in vim #29

aborilov opened this issue Jan 25, 2017 · 5 comments

Comments

@aborilov
Copy link

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.

@lyokha
Copy link
Owner

lyokha commented Jan 25, 2017

Try it this way (for terminal):

vim --noplugin -c 'runtime plugin/xkbswitch.vim'

Is it still bad?

@aborilov
Copy link
Author

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'

@lyokha
Copy link
Owner

lyokha commented Jan 26, 2017

Try disable translation and Select mode mappings by putting in .vimrc lines

let g:XkbSwitchIMappings = []
let g:XkbSwitchSkipGhKeys = ['gh', 'gH']

@aborilov
Copy link
Author

aborilov commented Jan 26, 2017 via email

@xaiamov
Copy link

xaiamov commented Apr 30, 2020

I observed the same problem and found out that the reason was in sequence which was used for the arrow keys: https://stackoverflow.com/a/25111512/4177749

I just needed to switch back to the en_us 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 en_us 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants