免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4062 | 回复: 4
打印 上一主题 下一主题

怪异问题:使用cscope后的vi如何语法高亮? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-08 09:51 |只看该作者 |倒序浏览
在~/.vimrc中设置 'syntax on' 后,vi打开的文件可以正常语法高亮。
但通过 'cscope -R'  打开的文件,语法高亮却没有了。很疑惑,在网上搜了很久,也没答案。


cscope --version
cscope: version 15.5

vi --version:
VIM - Vi IMproved 7.0 (2006 May 7, compiled May  9 2007 19:02:35)
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-235, 237
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2    -D_REENTRANT -D_GNU_SOURCE  -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  -I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE  -I/usr/include/python2.4 -pthread   
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE   -L/usr/local/lib -o vim       -ltermcap  -lselinux  -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE  -L/usr/local/lib /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -lperl -lresolv -lutil -lc -L/usr/lib/python2.4/config -lpython2.4 -lutil -lm -Xlinker -export-dynamic

论坛徽章:
0
2 [报告]
发表于 2008-09-08 11:22 |只看该作者
'cscope -R',生成标签,但不退出cscope
'cscope -Rb’,生成标签,并退出cscope

我用的是'cscope -R',在cscope的界面中打开的文件,就没有语法高亮了。

只好自己顶一下了先。

论坛徽章:
0
3 [报告]
发表于 2008-09-16 10:28 |只看该作者
找到原因了。cscope的默认editor是vi,而不是vim,所以,需要设置export CSCOPE_EDITOR=vim
非常感谢CSND 的同学 guosha同学提醒我看:help cscope.txt, Thank you!

论坛徽章:
0
4 [报告]
发表于 2013-01-05 11:18 |只看该作者
allenlu1212 发表于 2008-09-16 10:28
找到原因了。cscope的默认editor是vi,而不是vim,所以,需要设置export CSCOPE_EDITOR=vim
非常感谢CSND 的 ...



不知道这么长时间还有回应不,我想问“export CSCOPE_EDITOR=vim”在哪里设置啊?

论坛徽章:
0
5 [报告]
发表于 2016-05-27 09:12 |只看该作者
在~/.bashrc文件中添加
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP