Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我经常gvim -d用两个文件名调用;我希望以只读方式系统地打开第二个(因为它位于参考目录中,不应修改)。但是,第一个不应该是只读的,因为我会将第二个中的一些差异拉入其中。那么我必须做些什么来实现这一目标?
gvim -d
$ gvim -d file1 file2 +'wincmd l | set ro | wincmd h'
成功了。
假设您使用 bash,您可以将其放入别名中:
alias vd='/usr/bin/gvimdiff +"wincmd l | set ro | wincmd h"'