On 2016-03-09 01:34, 童虎 wrote: > I have a file `a.txt`. > When I use root to edit this file `sudo vi a.txt`. Vim prompt:
First, I'd use "sudoedit" which invokes $SUDO_EDITOR environment variable, falling back to $VISUAL, and then $EDITOR if needed. Since it runs vim as you rather than as root, this might solve your problem as well. As a side-benefit, you don't have the vulnerability that comes from launching an editor that can shell out to root-shells. > `E474: Invalid argument: > listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣` > > But when I user `vi a.txt` without `sudo`. All things right. "space:" was added to 'listchars' in v7.4.710 on 2015-04-21 by Bram. My stock Debian install doesn't offer it so when I try your 'listchars' setting without using "space:␣" (or even "space:X" in case the character was causing the issue), it triggers the same message. When I try it with a recent build of vim, it works as expected. Are you sure that you're running the same vim binary when you run in each case? $ diff -u <(vim --version) <(sudo vim --version) or perhaps $ which vim $ sudo which vim -tim -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
