Martins3 / My-Linux-Config

:clap: Modern neovim configuration based on native lsp
https://martins3.github.io/My-Linux-Config/
GNU General Public License v3.0
336 stars 62 forks source link

startup error with sudo #37

Closed marryton007 closed 2 years ago

marryton007 commented 2 years ago

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

SpaceVim debug information

SpaceVim options :

  auto_disable_touchpad = 1
  autocomplete_method = 'coc'
  autocomplete_parens = 1
  bootstrap_after = 'myspacevim#after'
  bootstrap_before = 'myspacevim#before'
  buffer_index_type = 4
  checkinstall = 1
  code_runner_focus = 0
  colorscheme = 'OceanicNext'
  colorscheme_bg = 'dark'
  colorscheme_default = 'desert'
  commandline_prompt = '➭'
  custom_color_palette = []
  custom_plugins = [['mhartington/oceanic-next', {'name': 'mhartington/oceanic-next', 'merged': 0, 'overwrite': 1}], ['neoclide/coc.nvim', {'name': 'neoclide/coc.nvim', 'merge': 0, 'overwrite': 1}], ['antoinemadec/coc-fzf', {'name': 'a
ntoinemadec/coc-fzf', 'branch': 'release', 'overwrite': 1}], ['junegunn/fzf.vim', {'name': 'junegunn/fzf.vim', 'overwrite': 1}], ['dhruvasagar/vim-table-mode', {'name': 'dhruvasagar/vim-table-mode', 'overwrite': 1}], ['liuchengxu/vista
.vim', {'name': 'liuchengxu/vista.vim', 'overwrite': 1}], ['simeji/winresizer', {'name': 'simeji/winresizer', 'overwrite': 1}], ['jackguo380/vim-lsp-cxx-highlight', {'name': 'jackguo380/vim-lsp-cxx-highlight', 'overwrite': 1}], ['skywi
nd3000/vim-cppman', {'name': 'skywind3000/vim-cppman', 'overwrite': 1}], ['rhysd/git-messenger.vim', {'lazy': 1, 'name': 'rhysd/git-messenger.vim', 'on_cmd': 'GitMessenger', 'overwrite': 1}], ['voldikss/vim-floaterm', {'name': 'voldiks
s/vim-floaterm', 'overwrite': 1}], ['google/vim-searchindex.git', {'name': 'google/vim-searchindex.git', 'overwrite': 1}], ['honza/vim-snippets', {'name': 'honza/vim-snippets', 'overwrite': 1}], ['nvim-lua/plenary.nvim', {'name': 'nvim
-lua/plenary.nvim', 'overwrite': 1}], ['nvim-telescope/telescope.nvim', {'name': 'nvim-telescope/telescope.nvim', 'overwrite': 1}], ['fannheyward/telescope-coc.nvim', {'name': 'fannheyward/telescope-coc.nvim', 'overwrite': 1}], ['Coati
Software/vim-sourcetrail', {'name': 'CoatiSoftware/vim-sourcetrail', 'overwrite': 1}], ['nvim-treesitter/nvim-treesitter', {'build': 'TSUpdate', 'name': 'nvim-treesitter/nvim-treesitter', 'overwrite': 1}], ['nvim-telescope/telescope-fz
f-native.nvim', {'build': 'make', 'name': 'nvim-telescope/telescope-fzf-native.nvim', 'overwrite': 1}], ['puremourning/vimspector', {'name': 'puremourning/vimspector', 'overwrite': 1}]]
  data_dir = '/home/jiaxi/.cache/'
  debug_level = 1
  default_custom_leader = '<Space>'
  default_indent = 2
  disabled_plugins = []
  enable_bepo_layout = 0
  enable_cursorcolumn = 0
  enable_cursorline = 1
  enable_debug = 0
  enable_googlesuggest = 0
  enable_guicolors = 1
  enable_javacomplete2_py = 0
  enable_key_frequency = 0
  enable_language_specific_leader = 1
  enable_neocomplcache = 0
  enable_os_fileformat_icon = 0
  enable_powerline_fonts = 1
  enable_projects_cache = 1
  enable_statusline_bfpath = 0
  enable_statusline_display_mode = 0
  enable_statusline_mode = 0
  enable_statusline_tag = 1
  enable_tabline_filetype_icon = 1
enable_tabline_ft_icon = 0
  enable_vimfiler_filetypeicon = 1
  enable_vimfiler_welcome = 1
  enable_ycm = 0
  error_symbol = '✖'
  escape_key_binding = 'jk'
  expand_tab = 1
  file_searching_tools = []
  filemanager = 'defx'
  filetree_direction = 'right'
  filetype_icons = {}
  force_global_config = 0
  gitcommit_issue_icon = ''
  gitcommit_pr_icon = ''
  github_username = ''
  guifont = ''
  hiddenfileinfo = 1
  home_files_number = 6
  hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
  info_symbol = 'ⓘ'
  keep_server_alive = 1
  language = ''
  leader_guide_default_group_name = ''
  leader_guide_flatten = 1
  leader_guide_hspace = 5
  leader_guide_max_size = 0
  leader_guide_position = 'botright'
  leader_guide_run_map_on_popup = 1
  leader_guide_sort_horizontal = 0
  leader_guide_submode_mappings = {'<C-C>': 'win_close'}
  leader_guide_vertical = 0
  lint_engine = 'neomake'
  lint_on_save = 1
  lint_on_the_fly = 0
  max_column = 120
  plugin_bundle_dir = '/home/jiaxi/.cache/vimfiles/'
  plugin_manager = 'dein'
  plugin_manager_processes = 16
  plugin_name = 'vimtex'
  project_auto_root = 1
  project_rooter_outermost = 1
  project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/', '.SpaceVim.d/']
  projects_cache_num = 20
  realtime_leader_guide = 1
  relativenumber = 0
  search_tools = ['rg', 'ag', 'pt', 'ack', 'grep', 'findstr', 'git']
  sidebar_direction = ''
  sidebar_width = 30
  smartcloseignoreft = ['tagbar', 'vimfiler', 'defx', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal', 'SpaceVimTabsManager']
  smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
  snippet_engine = 'neosnippet'
  src_root = 'E:\sources\'
  statusline_iseparator = 'nil'
  statusline_left_sections = ['winnr', 'filename', 'major mode', 'search count', 'syntax checking', 'minor mode lighters', 'vcs', 'hunks']
  statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
  statusline_separator = 'bar'
  statusline_unicode = 1
  terminal_cursor_shape = 2
  todo_labels = ['@fixme', '@question', '@todo', '@idea']
  update_retry_cnt = 3
  version = '1.9.0-dev'
  vim_help_language = 'en'
  vimcompatible = 0
  warning_symbol = '⚠'
  wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg'
  windows_index_type = 3
  windows_leader = 'c'
  windows_smartclose = 'q'
  wrap_line = 0

SpaceVim layers :

[[layers]]
  name="autocomplete"
[[layers]]
  name="format"
[[layers]]
  name="edit"
[[layers]]
  name="ui"
[[layers]]
  name="core"
[[layers]]
  name="core#banner"
[[layers]]
  name="core#statusline"
[[layers]]
  name="core#tabline"
[[layers]]
  name="tools"
[[layers]]
  name="VersionControl"
  enable-gtm-status=1
[[layers]]
  name="git"
  git-plugin='fugitive'
[[layers]]
  name="fzf"
[[layers]]
  name="lang#markdown"
[[layers]]
  name="lang#latex"

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 :

[ SpaceVim ] : logger file  does not exists, only log for current process will be shown!
[ SpaceVim ] [11:25:56] [ Info ] Startup with argv: ['plugin/lua.vim']
[ SpaceVim ] [11:25:56] [ Info ] Can not find project local config, start loading global config
[ SpaceVim ] [11:25:56] [ Info ] global_dir is: /home/jiaxi/.SpaceVim.d/
[ SpaceVim ] [11:25:56] [ Info ] start to apply config [glob]
[ SpaceVim ] [11:25:56] [ Info ] SpaceVim server startup at:/tmp/spacevim_nvim_server
[ SpaceVim ] [11:25:56] [ Info ] the func has been added to mode:spell-checking
[ SpaceVim ] [11:25:56] [ Info ] the func has been added to mode:paste-mode
[ SpaceVim ] [11:25:56] [ Error ] npm or yarn is required to build iamcco/markdown-preview and neoclide/vim-node-rpc
[   rooter ] [11:25:56] [ Info ] Load projects cache from: /home/jiaxi/.cache/SpaceVim/projects.json
telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - WARNING: nvim-treesitter not found. 

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0 (rev 7ec2fd51ba)
  - OK: fd: found fd 8.2.1

## ===== Installed extensions =====

treesitter: health#treesitter#check
========================================================================
  - ERROR: Failed to run healthcheck for "treesitter" plugin. Exception:
    function health#check[24]..health#treesitter#check, line 2
    Vim(lua):E5108: Error executing lua [string ":lua"]:1: attempt to call field 'check_health' (a nil value)

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/jiaxi/.cache/nvim/lsp.log
  - INFO: Log size: 46 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13coc: health#coc#check    
========================================================================    
  - ERROR: Executable node.js not found, install node.js from http://nodejs.org/    
  - ERROR: /bin/bash: node: command not found    

  - ERROR: Unable to detect version of node, make sure your node executable is http://nodejs.org/    
  - OK: Javascript bundle build/index.js found    
  - ERROR: service could not be initialized    
    - ADVICE:    
      - Use command ":messages" to get error messages.    
      - Open a issue at https://github.com/neoclide/coc.nvim/issues for feedback.    

coc_fzf: health#coc_fzf#check    
========================================================================    
## ctags (optional)    
  - OK: ctag found    

## fzf.vim (optional)    
  - WARNING: fzf.vim not found. 'location' won't work, previews won't be available    
    - ADVICE:    
      - Install the following vim plugin    
      -   Plug 'junegunn/fzf.vim'    

floaterm: health#floaterm#check    
========================================================================    
## common    
  - INFO: Platform: linux    
  - INFO: Nvim: NVIM v0.6.0-dev+434-g7f93b2ab0    
  - INFO: Plugin: fatal: not a git repository (or any of the parent directories): .git    

## terminal    
  - OK: Terminal emulator is available    

## floating    
  - OK: Floating window is available    

nvim: health#nvim#check    
========================================================================    
## Configuration    
  - OK: no issues found    

## Performance    
  - OK: Build type: RelWithDebInfo    

## Remote Plugins    
  - OK: Up to date    

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - INFO: `g:python_host_prog` is not set.  Searching for python2 in the environment.
  - INFO: Executable: /usr/bin/python2
  - INFO: Python version: 2.7.17
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.6.9
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
  - INFO: Host: /usr/local/bin/neovim-ruby-host
  - OK: Latest "neovim" gem is installed: 0.9.0

## Node.js provider (optional)
  - WARNING: `node` and `npm` (or `yarn`) must be in $PATH.
    - ADVICE:
      - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - WARNING: nvim-treesitter not found. 

## Checking external dependencies
  - OK: rg: found ripgrep 13.0.0 (rev 7ec2fd51ba)
  - OK: fd: found fd 8.2.1

## ===== Installed extensions =====

treesitter: health#treesitter#check
========================================================================
  - ERROR: Failed to run healthcheck for "treesitter" plugin. Exception:
    function health#check[24]..health#treesitter#check, line 2
    Vim(lua):E5108: Error executing lua [string ":lua"]:1: attempt to call field 'check_health' (a nil value)

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/jiaxi/.cache/nvim/lsp.log
  - INFO: Log size: 46 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 13

出错信息: image

Martins3 commented 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:

这些关键的依赖似乎你都有安装呀。

marryton007 commented 2 years ago

这个问题很无聊,普通用户可以,普通用户+sudo就不能执行了。

我试过sudo apt install nodejs, checkhealth结果说node版本太低,后来通过在Root目录下使用nvm 安装新版本也不行。普通用户就是通过nvm安装的

Martins3 commented 2 years ago

上面的 checkhealth 信息都是在 sudo 模式下获取的吗? 普通用户模式下的 checkhealth 应该都是正常的吧。

Martins3 commented 2 years ago

我使用 sudo vim 运行,这些插件都是不会加载的。 DeepinScreenshot_Alacritty_20211009171947

marryton007 commented 2 years ago

是的,前面的信息都是通过sudo执行后获取的日志信息 。 普通用户是正常的。

marryton007 commented 2 years ago

前面是删除了系统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      
Martins3 commented 2 years ago

是啊,因为 lua 支持需要 0.5 及其以上的

marryton007 commented 2 years ago

我在自己的.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:
Martins3 commented 2 years ago

因为 vim 和 neovim 其实是两个程序,neovim 兼容 vim ,而且有自己的很多新特性,只有 neovim 0.5 以上才支持 lua, vim 目前没有支持 lua 。spacevim 可以基于 vim 或者 nvim 运行。因为我的配置中有 lua.vim,所以必须要求 neovim 0.5

marryton007 commented 2 years ago

在vimscript里可以判断一下是否支持lua特性,再加载Lua脚本?

Martins3 commented 2 years ago

在vimscript里可以判断一下是否支持lua特性,再加载Lua脚本?

可以

Martins3 commented 2 years ago

但是我没有具体的搞过

Martins3 commented 2 years ago

其实 lua.vim 里面的配置就是给 telescope 的一些额外配置,你可以删除掉也不太影响

marryton007 commented 2 years ago

这样写可以去掉前面的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
marryton007 commented 2 years ago

在哪个地方可以控制是否加载coc.vim?

Martins3 commented 2 years ago

不加载 coc.nvim 的话,整个跳转都没有办法用啊,按道理可以直接删除 coc.nvim 就可以了

marryton007 commented 2 years ago

我做了如下修改,现在基本可用了

  1. 删除系统vim包,软链接到nvim上
  2. 修改Spacevim配置
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
kang8 commented 2 years ago

为什么会有在 root 用户使用 VIM 的情形呢?你可以使用 sudoedit 来编辑文件,它既有 root 权限加载的又是当前用户的配置。

e.g.

$ sudoedit /etc/passwd
marryton007 commented 2 years ago

@kang8 如你所示,也是因为临时要编辑系统文件,需要root权限。以前真不知道sudoedit这个命令.

刚才试了一下,好用!sudoedit默认使用nano编译器,要想使用vim作为默认编译器需要设置

export EDITOR='vim'