如何以root身份在ranger中打开文件?

Pat*_*ner 9 root sudo file-management ranger

如何使用超级用户权限在文件管理器“ranger”中打开文件?

虽然“ :open_with vim ”使用vim以非root身份打开文件,但我正在寻找类似“:open_with sudo vim”的东西,但这不起作用。

小智 10

据人说:

标志为您提供了一种修改衍生进程行为的方法。它们用于命令 ":open_with" (key "r") 和 ":shell" (key "!")。

   f   Fork the process.  (Run in background)
   c   Run the current file only, instead of the selection
   r   Run application with root privilege (requires sudo)
   t   Run application in a new terminal window
Run Code Online (Sandbox Code Playgroud)

在您的情况下,您需要使用 :open_with r vim