LoginSignup
0
0

More than 3 years have passed since last update.

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

Last updated at Posted at 2019-08-17

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0