Closed marryton007 closed 2 years ago
[ SpaceVim ] [11:25:56] [ Error ] npm or yarn is required to build iamcco/markdown-preview and neoclide/vim-node-rpc
Error: node is not executable!
- ERROR: Failed to run healthcheck for "treesitter" plugin. Exception:
这些关键的依赖似乎你都有安装呀。
这个问题很无聊,普通用户可以,普通用户+sudo就不能执行了。
我试过sudo apt install nodejs, checkhealth结果说node版本太低,后来通过在Root目录下使用nvm 安装新版本也不行。普通用户就是通过nvm安装的
上面的 checkhealth 信息都是在 sudo 模式下获取的吗? 普通用户模式下的 checkhealth 应该都是正常的吧。
我使用 sudo vim 运行,这些插件都是不会加载的。
是的,前面的信息都是通过sudo执行后获取的日志信息 。 普通用户是正常的。
前面是删除了系统vim包,将vim软链接到nvim上。
刚才删除了软链接,重新安装了vim包,错误变了
~ » sudo vim /etc/ssh/sshd_config jiaxi@ehome-hwrd-1
Error detected while processing /home/jiaxi/.SpaceVim.d/plugin/defx.vim:
line 4:
E117: Unknown function: defx#custom#option
Error detected while processing /home/jiaxi/.SpaceVim.d/plugin/lua.vim:
line 1:
E319: Sorry, the command is not available in this version: lua << EOF
line 2:
E492: Not an editor command: -- You dont need to set any of these options. These are the default ones. Only
line 3:
E492: Not an editor command: -- the loading is important
line 4:
E492: Not an editor command: require('telescope').setup {
line 5:
E492: Not an editor command: extensions = {
line 6:
E492: Not an editor command: fzf = {
line 7:
E492: Not an editor command: fuzzy = true, -- false will only do exact matching
line 8:
E492: Not an editor command: override_generic_sorter = true, -- override the generic sorter
line 9:
E492: Not an editor command: override_file_sorter = true, -- override the file sorter
line 10:
E492: Not an editor command: case_mode = "smart_case", -- or "ignore_case" or "respect_case"
line 11:
E492: Not an editor command: -- the default case_mode is "smart_case"
line 12:
E492: Not an editor command: }
line 13:
E492: Not an editor command: },
line 14:
E492: Not an editor command: }
line 15:
E492: Not an editor command: -- To get fzf loaded and working with telescope, you need to call
line 16:
E481: No range allowed: -- load_extension, somewhere after setup function:
line 17:
E492: Not an editor command: require('telescope').load_extension('fzf')
line 18:
E492: Not an editor command: EOF
coc.nvim works best on vim >= 8.1.1719 and neovim >= 0.4.0, consider upgrade your vim.
You can add this to your vimrc to avoid this message:
let g:coc_disable_startup_warning = 1
Note that some features may behave incorrectly.
[coc.nvim] "node" is not executable, checkout https://nodejs.org/en/download/
Press ENTER or type command to continue
出现这个提示是因为vim版本低了, vim不支持lua特性
~ » vim --version jiaxi@ehome-hwrd-1
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 20 2021 12:26:53)
Included patches: 1-1453
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_sgr -tag_any_white
+arabic +file_in_path -mouse_sysmouse -tcl
+autocmd +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
-balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
-browse +fork() -mzscheme +textobjects
++builtin_terms +gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages -toolbar
+cindent +insert_expand +path_extra +user_commands
-clientserver +job -perl +vertsplit
-clipboard +jumplist +persistent_undo +virtualedit
+cmdline_compl +keymap +postscript +visual
+cmdline_hist +lambda +printer +visualextra
+cmdline_info +langmap +profile +viminfo
+comments +libcall -python +vreplace
+conceal +linebreak +python3 +wildignore
+cryptv +lispindent +quickfix +wildmenu
+cscope +listcmds +reltime +windows
+cursorbind +localmap +rightleft +writebackup
+cursorshape -lua -ruby -X11
+dialog_con +menu +scrollbind -xfontset
+diff +mksession +signs -xim
+digraphs +modify_fname +smartindent -xpm
-dnd +mouse +startuptime -xsmp
-ebcdic -mouseshape +statusline -xterm_clipboard
+emacs_tags +mouse_dec -sun_workshop -xterm_save
+eval +mouse_gpm +syntax
+ex_extra -mouse_jsbterm +tag_binary
+extra_search +mouse_netterm +tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-xbvndG/vim-8.0.1453=. -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm
是啊,因为 lua 支持需要 0.5 及其以上的
我在自己的.zshrc里有一句
alias vim='nvim'
不知道这句有没有影响?
注释掉这句,再执行 vim 还是会加载spacevim的配置,还是会出现上面的错误
Error detected while processing /home/jiaxi/.SpaceVim.d/plugin/defx.vim:
line 4:
E117: Unknown function: defx#custom#option
Error detected while processing /home/jiaxi/.SpaceVim.d/plugin/lua.vim:
line 1:
E319: Sorry, the command is not available in this version: lua << EOF
line 2:
E492: Not an editor command: -- You dont need to set any of these options. These are the default ones. Only
line 3:
E492: Not an editor command: -- the loading is important
line 4:
E492: Not an editor command: require('telescope').setup {
line 5:
E492: Not an editor command: extensions = {
line 6:
E492: Not an editor command: fzf = {
line 7:
因为 vim 和 neovim 其实是两个程序,neovim 兼容 vim ,而且有自己的很多新特性,只有 neovim 0.5 以上才支持 lua, vim 目前没有支持 lua 。spacevim 可以基于 vim 或者 nvim 运行。因为我的配置中有 lua.vim,所以必须要求 neovim 0.5
在vimscript里可以判断一下是否支持lua特性,再加载Lua脚本?
在vimscript里可以判断一下是否支持lua特性,再加载Lua脚本?
可以
但是我没有具体的搞过
其实 lua.vim 里面的配置就是给 telescope 的一些额外配置,你可以删除掉也不太影响
这样写可以去掉前面的lua错误
diff --git a/plugin/lua.vim b/plugin/lua.vim
index 389a407..294c3ca 100644
--- a/plugin/lua.vim
+++ b/plugin/lua.vim
@@ -1,3 +1,4 @@
+:if has('lua')
lua << EOF
-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
@@ -16,3 +17,4 @@ require('telescope').setup {
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
EOF
+:endif
在哪个地方可以控制是否加载coc.vim?
不加载 coc.nvim 的话,整个跳转都没有办法用啊,按道理可以直接删除 coc.nvim 就可以了
我做了如下修改,现在基本可用了
diff --git a/plugin/defx.vim b/plugin/defx.vim
index 981d0aa..36c66f3 100644
--- a/plugin/defx.vim
+++ b/plugin/defx.vim
@@ -1,4 +1,6 @@
" defx 将会自动忽略如下的文件
+if executable('node')
call defx#custom#option('_', {
\ 'ignored_files': ".*,*.class,*.out,*.o,*.bc,*.a,compile_commands.json,*.d,*.mod*,*.cmd,.tmp_versions/,modules.order,Module.symvers,Mkfile.old,dkms.conf,*.ko,*.elf,*.img,*.so,*.qcow2,*.iso",
\ })
+endif
diff --git a/plugin/lua.vim b/plugin/lua.vim
index 389a407..bbf42d7 100644
--- a/plugin/lua.vim
+++ b/plugin/lua.vim
@@ -1,3 +1,4 @@
+if has('lua')
lua << EOF
-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
@@ -16,3 +17,4 @@ require('telescope').setup {
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
EOF
+endif
为什么会有在 root 用户使用 VIM 的情形呢?你可以使用 sudoedit
来编辑文件,它既有 root 权限加载的又是当前用户的配置。
e.g.
$ sudoedit /etc/passwd
@kang8 如你所示,也是因为临时要编辑系统文件,需要root权限。以前真不知道sudoedit这个命令.
刚才试了一下,好用!sudoedit默认使用nano编译器,要想使用vim作为默认编译器需要设置
export EDITOR='vim'
[ ] Describe the bug 已删除系统vim包,将vim软链到nvim。 使用 sudo vim xxx 有出错提示;不使用sudo可正常运行,无错误提示。
[ ] ccls --version ccls version
clang version 10.0.0
[ ] nvim --version NVIM v0.6.0-dev+434-g7f93b2ab0 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/jiaxi/git/neovim/build/config -I/home/jiaxi/git/neovim/src -I/home/jiaxi/git/neovim/.deps/usr/include -I/usr/include -I/home/jiaxi/git/neovim/build/src/nvim/auto -I/home/jiaxi/git/neovim/build/include Compiled by jiaxi@ehome-hwrd-1
Features: +acl +iconv +tui See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/share/nvim"
Run :checkhealth for more info
[ ] Operating System No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.6 LTS Release: 18.04 Codename: bionic
[ ] SPDebugInfo
SpaceVim debug information
SpaceVim options :
SpaceVim layers :
SpaceVim Health checking :
SpaceVim clipboard support check report: Checking +clipboard: SUCCEED! SpaceVim environment check report: Current progpath: vim(/usr/local/bin/nvim) version: 800 OS: linux [shell, shellcmdflag, shellslash]: ['/bin/bash', '-c', 0] SpaceVim lua support check report: Checking +lua: Failed : Known issue, neovim do not support lua now. SpaceVim python support check report: Checking +python3: SUCCEED! Checking +python: SUCCEED!
SpaceVim runtime log :
[ ] CocInfo Error: node is not executable!
[ ] checkhealth screenshot
出错信息: