如何将vim设置为默认的cscope编辑器?

时间:2022-04-06 19:26:57

cscope opens my files in vi. Is there a way to change it so that it opens files in vim instead ?

cscope在vi中打开我的文件。有没有办法改变它,以便它在vim中打开文件?

Edit: I tried:

编辑:我试过:

export CSCOPE_EDITOR=vim

For some weird reason, if I type :help on the file opened, it shows vim help which indicates it is opened in vim but it doesn't seem to read my .vimrc. How can I make it read my .vimrc ?

出于一些奇怪的原因,如果我输入:打开文件的帮助,它显示vim帮助,表明它在vim中打开但它似乎没有读取我的.vimrc。如何让它读取我的.vimrc?

Edit 2: Machine/tool info

编辑2:机器/工具信息

[user@machine] $  printenv | grep -i cscope    
CSCOPE_EDITOR=vim

[user@machine] $  vim --version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 10 2012 08:48:09)
Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237

[user@machine] $  cscope -V
cscope: version 15.5

1 个解决方案

#1


6  

Just make sure that your .vimrc is at the same location as .bashrc. And then in .bashrc, add the following line:

只需确保.vimrc与.bashrc位于同一位置。然后在.bashrc中添加以下行:

export CSCOPE_EDITOR=vim

This worked for me.

这对我有用。

#1


6  

Just make sure that your .vimrc is at the same location as .bashrc. And then in .bashrc, add the following line:

只需确保.vimrc与.bashrc位于同一位置。然后在.bashrc中添加以下行:

export CSCOPE_EDITOR=vim

This worked for me.

这对我有用。