Code Monkey home page Code Monkey logo

Comments (5)

eapache avatar eapache commented on June 5, 2024

Does https://github.com/eapache/starscope/blob/master/doc/USER_GUIDE.md#editor-and-workflow-integration answer your question? Vim's cscope integration is quite good already.

If you want to build proper, native integration you will need to write a vim plugin. http://mattmargolis.net/scripting_vim_with_ruby.pdf is a bit old and might be out-of-date, but will probably point you in the right direction.

from starscope.

jonahx avatar jonahx commented on June 5, 2024

Thanks for the reply, Evan.

I do use tpopes setup for ctags. But I'm still a little unclear on the steps to use starscope with vim's builtin cscope support. Can you confirm I have it right?

  1. Add the line: starscope --quiet -e cscope & i to the tpope git hook files.
  2. Now a cscope db file with the name 'cscope' will be added... where exactly? Inside of '.git', like the ctags file?
  3. Now I have a cscope file vim can use, and so at this point it's just a matter of :he cscope and then setting up the mappings I want to vim's various cscope commands -- is that correct?
  4. Continuing point 3, I would have to :cs add .git/cscope or something like this, to setup the connection to the cscope db file created by starscope?
  5. Use :cs find... commands to implement "Find references..." and other similar queries.
  6. Roll my own vimscript if I want those commands wrapped up with nice names in a dropdown from the cursor?

Just want to make sure I'm understanding everything from a high-level before embarking on the actual setup...

Thanks again.

from starscope.

eapache avatar eapache commented on June 5, 2024
  1. You don't need to use it with git hooks. If you're still experimenting, you might do better to run it manually until you have a setup you're happy with.
  2. I'm not sure what the current working directory will be... your best bet is simply to run it once and see. I suspect it will either be inside the .git folder or it will be right at the root of your repository. It shouldn't be anywhere else so it will be easy to check.
  3. Yup, you can also :cscope help for a summary help.
  4. Yes, wherever the file ends up.
  5. Yes.
  6. I use bindings derived from http://cscope.sourceforge.net/cscope_maps.vim which you may find helpful.

from starscope.

eapache avatar eapache commented on June 5, 2024

For what it's worth, the exact section of my .vimrc dedicated to cscope looks like this:

set cscopetag                                                                    
set cscopetagorder=1                                                                       
cscope add cscope.out  

nnoremap <Leader>s :cs find s <C-R>=expand("<cword>")<CR><CR>                    
nnoremap <Leader>c :cs find c <C-R>=expand("<cword>")<CR><CR>                    
nnoremap <Leader>t :cs find t <C-R>=expand("<cword>")<CR><CR>                    
nnoremap <Leader>f :cs find f <C-R>=expand("<cfile>")<CR><CR>                    
nnoremap <Leader>i :cs find i <C-R>=expand("<cfile>")<CR><CR>

from starscope.

jonahx avatar jonahx commented on June 5, 2024

Very helpful, ty.

from starscope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.