Neovim 在没有配置的情况下执行不需要的检查

Neovim Performing Unwanted Linting Without Configuration

我已经使用 Neovim 和 vim-plug 几个月没有问题,但是在更改我的项目设置后,Neovim 似乎正在调用 JSHint,尽管事实上我从未告诉它调用 JSHint - 事实上,即使在删除 init.vim 中的所有配置后,Neovim 仍然使用 JSHint 进行 linting。我之前的配置:

"
" vim-plug
"

call plug#begin('~/.cache/vim-plug')

" Plugins
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" File Tree
Plug 'scrooloose/nerdtree'
" Executing build/syntax checking for projects
Plug 'neomake/neomake'
" JavaScript syntax
Plug 'pangloss/vim-javascript'
" Agda syntax
Plug 'derekelkins/agda-vim'
" Rust syntax
Plug 'rust-lang/rust.vim'
" Idris syntax
Plug 'idris-hackers/idris-vim'
" JSX syntax
Plug 'mxw/vim-jsx'
" Reason syntax + helpers
Plug 'reasonml-editor/vim-reason-plus'
Plug 'autozimu/LanguageClient-neovim', {
    \ 'branch': 'next',
    \ 'do': 'bash install.sh',
    \ }
" Optional 'multi-entry selection UI' for LanguageClient
Plug 'junegunn/fzf'
" Color schemes
Plug 'frankier/neovim-colors-solarized-truecolor-only'

call plug#end()

"
" General Config
"

" Custom Leader
let mapleader = ","

" Syntax highlighing
syntax enable

" Indent
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab

" Show cursor line and column number
set ruler
" Show line number at beginning of each line
set number

" Syntax highlighing
syntax enable

" Indent
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab

" Color scheme
set termguicolors
colorscheme solarized
set background=dark

" Color scheme
set termguicolors
colorscheme solarized
set background=dark

" Recognize .vue as .html
au BufRead,BufNewFile *.vue setfiletype html
" Prolog is not perl
au BufRead,BufNewFile *.pl setfiletype prolog
" Agda
au BufNewFile,BufRead *.agda setf agda
" Use JSX in .js files
let g:jsx_ext_required = 0
" Support flow type annotations in js
let g:javascript_plugin_flow = 1

" Use system clipboard
set clipboard=unnamedplus

" Allow use of the mouse
set mouse=a

" Resizing buffers/splits shortcuts
nnoremap <silent> <Leader>h :vertical resize -5<CR>
nnoremap <silent> <Leader>j :resize -5<CR>
nnoremap <silent> <Leader>k :resize +5<CR>
nnoremap <silent> <Leader>l :vertical resize +5<CR>

"
" deoplete.nvim
"

call deoplete#enable()

"
" Neomake
"

autocmd! BufWritePost * Neomake

let g:neomake_javascript_enabled_makers = ['eslint']

"
" Language Client
"

let g:LanguageClient_serverCommands = {
    \ 'reason': ['ocaml-language-server', '--stdio'],
    \ 'ocaml': ['ocaml-language-server', '--stdio'],
    \ }

nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr>
nnoremap <silent> gf :call LanguageClient_textDocument_formatting()<cr>
nnoremap <silent> <cr> :call LanguageClient_textDocument_hover()<cr>

最小配置(仍然执行 linting)

call plug#begin('~/.cache/vim-plug')
" File Tree
Plug 'scrooloose/nerdtree'
call plug#end()

我也试过PlugClean。 Neovim 是否默认启用了 linters?如果是这样,我该如何禁用它们?

尝试在没有配置和插件的情况下启动 neovim - nvim -u NONE

如果问题解决了,那么插件文件仍在某处加载。 Vim 也可以加载 vim-plug 不知道的插件。加载插件的本机方式是 vim 将在您的 runtimepath 中搜索任何名为 plugin 的子目录,并获取其中找到的所有脚本(这就是 vim-plug 的工作方式,它只是将每个插件目录附加到运行时路径)。我的猜测是你在 ~/.config/nvim/plugin/ 中插入了一些东西并忘记了它(或者你定义 XDG 的任何地方)

您可以使用 :set rtp?:echo &rtp 检查您的运行时路径(rtp 可与 runtimepath 互换)。更有用的是,您可以检查 neovim 使用 :scriptnames 命令获取的每个脚本,这应该可以帮助您查明任何意外情况。

显然这一切都有帮助:

:h -u
:h 'runtimepath'
:h plugin