bring color to cscope output in vim?

2019-04-05 01:37发布

I am using vim7.4. cscope output in vim is all white. can it be made more colorful?

I tried cecscope, which uses quickfix to bring color to vim. But the output of it is not small-screen friendly. it is not that useful when using a laptop.

so is there some other way to add color to cscope output? I like the ctags output in vim, or can cscope have the same style?

Thanks.

标签: vim cscope
5条回答
等我变得足够好
2楼-- · 2019-04-05 01:57

For me, all the above suggestions didn't work.
What I was searching for is something like this:

CScope highlight search result

I achieved it by gluing up several vim commands:

nnoremap * 
    \ :exec("cs find s ".expand("<cword>"))<CR> 
    \ :copen<CR> 

* - highlight word under cursor
:exec("cs find s ".expand("<cword>"))<CR> - cscope find word under cursor
:copen - open cscope search results window

查看更多
做个烂人
3楼-- · 2019-04-05 02:09

Exporting CSCOPE_EDITOR in ~/.bashrc worked for me.

export CSCOPE_EDITOR=/usr/bin/vim

Thanks Anirudh. 'which vim' will tell which executable of vim is in use.

查看更多
女痞
4楼-- · 2019-04-05 02:17

The default editor for Cscope is vi not VIM. Vi has no option for Syntax highlighting and other features of plugins etc. Just change the default editor to vim. All your Vim settings will come to Cscope output.

$ export CSCOPE_EDITOR=vim

Done.

查看更多
SAY GOODBYE
5楼-- · 2019-04-05 02:19

Use this in .vimrc --

syntax enable

-- rather than --

syntax on

This worked for me.

查看更多
Emotional °昔
6楼-- · 2019-04-05 02:21

You can set color to cscope editor by changing its default editor to vim from vi. You need to just add an environment variable CSCOPE_EDITOR as /usr/bin/vim (get your absolute path for vim using which vim command). Add the below line to your .cshrc file in your home folder to make it retain (I tried in REDHAT).

setenv CSCOPE_EDITOR /usr/bin/vim
查看更多
登录 后发表回答