英文:
neovim (AstroNvim) treesitter/highlighter error on comment-lines
问题
我刚刚安装了Astronvim,并且遇到了以下问题:当文件中有任何注释(例如Python中的#
、Lua中的--
等)时,treesitter/highlighter会显示以下错误:
一些额外信息:
- 我没有额外的配置。只是使用了gruvbox主题和一些小插件(使用了Astronvim文档中的配置模板)。
- 我已经尝试了纯粹的AstroNvim,没有任何改变。
- 我已经检查了
:TSUpdate
命令。所有解析器都已安装和更新。 - 我已经尝试了使用
rm -rf
删除Neovim的缓存、共享和状态后重新安装AstriNvim。 - 在treesitter上运行
:checkhealth
不显示任何错误或警告。
nvim --version
命令输出:
NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/nvim/parts/nvim/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include -I/build/nvim/parts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include
全局系统vimrc文件: "$VIM/sysinit.vim"
默认$VIM值: "/usr/share/nvim"
运行 :checkhealth 获取更多信息
如果问题出在我的配置中,这里是配置的链接:https://github.com/ALittleMoron/AstroNvimConfig
英文:
I've just installed astronvim and have the following issue: when there is any comment in the file (python #
, lua --
, etc.), treesitter/highlighter displays the following error:
Some extra-information:
- I have no extra configure. Just gruvbox theme and some little plugins (with config template from astronvim docs).
- I've already tested it with pure AstroNvim - nothing changed.
- I've already checked
:TSUpdate
command. All parsers are installed and updated. - I've already tried reinstall AstriNvim with
rm -rf
on cache, share and state of neovim. :checkhealth
on treesitter shows no errors or warnings.
nvim --version
command output:
NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/nvim/parts/nvim/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include -I/build/nvim/parts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include
общесистемный файл vimrc: "$VIM/sysinit.vim"
значение $VIM по умолчанию: "/usr/share/nvim"
Run :checkhealth for more info
If the problem in my config, here is a link to it: https://github.com/ALittleMoron/AstroNvimConfig
答案1
得分: 1
解决方案很简单,但我忘记去做:
我通过 which nvim
检查了 neovim 的位置,然后意识到我的 neovim 是通过 snap 安装的,所以我只是删除了它,然后通过本机包管理器重新安装:sudo pacman -S neovim
,没有重新设置配置。现在一切都正常工作。
英文:
The solution was simple, but I forgot to do it:
I checked neovim location with which nvim
and realized, that my neovim was installed via snap, so I just delete it and reinstall via native package manager: sudo pacman -S neovim
with no config resetting. All work ok now.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论