0
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

vim-multiple-cursors中はALEを無効にして速くする

vimでマルチカーソルできるプラグインterryma/vim-multiple-cursors
とても便利なのですがデフォルト設定だと、複数選択してinsertモードにすると
ALEによるシンタックスチェックが走ってしまうため物凄く遅くなります。

Interaction with other pluginsを参考にしてALEとLSPのCoCをON/OFFすると補完もシンタックスチェックも実行されなくなるので非常に軽快になります。

function! s:multiple_cursors_before()
    if exists(':ALEDisableBuffer')==2
        exe 'ALEDisableBuffer'
    endif
    if exists(':CocDisable')==2
        exe 'CocDisable'
    endif
endfunction

function! s:multiple_cursors_after()
    if exists(':ALEEnableBuffer')==2
        exe 'ALEEnableBuffer'
    endif
    if exists(':CocEnable')==2
        exe 'CocEnable'
    endif
endfunction

augroup multiple_cursors
    autocmd User MultipleCursorsPre  call s:multiple_cursors_before()
    autocmd User MultipleCursorsPost call s:multiple_cursors_after()
augroup END
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
0
Help us understand the problem. What are the problem?