Ubuntu 上是否存在类似“rvim”的东西?

Ubuntu 上是否存在类似“rvim”的东西?

我读这里关于如何使用安全地编辑文件sudo,我确实sudoedit大多数时候都会使用,但是我有兴趣知道 Ubuntu 上是否有类似的东西rvim

我正在运行带有 GNOME 3.20 的 Ubuntu GNOME 16.04,由于我在存储库中找不到具有相同或相似名称的任何内容,我想知道rvimUbuntu 中是否存在类似的限制性文本编辑器?

答案1

似乎没有独立的rvim二进制文件,但是安装vim包会使用以下机制创建符号链接update-alternatives

Setting up vim (2:7.4.1689-3ubuntu1.1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode

点击该链接,我们发现该链接最终解析为vim.basic

$ readlink -f $(which rvim)
/usr/bin/vim.basic

据推测这里面存在一些argv[0]魔法vim.basic,使得它在被调用时以受限模式运行rvim

根据vim手册页,您还可以使用以下-Z选项:

rvim rview rgvim rgview
          Like the above, but with restrictions.  It will not be possi‐
          ble to start shell commands, or suspend  Vim.   Can  also  be
          done with the "-Z" argument.

vim它提供与相同的功能rvim,但并非真正调用rvim

相关内容