vim - 如何在 Vim 中默认禁用 ale 插件?
问题描述
我正在使用https://github.com/w0rp/ale插件。但这会使 vim 的响应速度降低...我有一个绑定ALETooggle
on <leader>l
。
最好默认禁用它并在需要时通过键盘快捷键启用它,我试图戴上ALEDisable
我的.vimrc
但它给了我下面的错误
Error detected while processing /Users/daniel/.vimrc:
line 94:
E492: Not an editor command: ALEDisable
Press ENTER or type command to continue
.vimrc
这是一个会触发问题的示例
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
Plugin 'w0rp/ale'
call vundle#end() " required
filetype plugin indent on " required
noremap <leader>l :ALEToggle<CR>
ALEDisable
解决方案
ALE 插件提供了一个名为g:ale_enabled
默认禁用 ALE 的选项,因此这种方式与插件管理器无关。
如果您设置g:ale_enabled
为,0
则 ALE 对任何缓冲区都禁用。该插件还提供了一个基于文件名控制 ALE 可用性的选项。这是一个示例:h g:ale_enabled
:
" Disable linting for all minified JS files.
let g:ale_pattern_options = {'\.min.js$': {'ale_enabled': 0}}
:ALEEnable
您可以使用或:ALEToggle
在您想要启用 ALE时启用它。
推荐阅读
- java - AndroidX SearchView 上的 NullPointer 异常
- html - 如何从带有角度的html制作弹出/视图功能
- python - 为什么即使使用 ResNet、Batchnorm、ReLU,我也会遇到爆炸性的 grad 问题?(张量流)
- android - 如何从 Android 向 Google Assistant 发送命令
- swift - 如何让用户上传不同尺寸的照片?
- reporting-services - SSRS 布局与报表生成器不同
- android - 将本机写入反应到短信而不发送它
- node.js - npm 命令未在请求中发送授权令牌 - 无法进行身份验证
- php - Wordpress - If 语句功能 - 多种帖子类型
- javascript - 我正在尝试在我的列表 ID 中循环并从我的猫鼬数据库中获取它们