Coder Social home page Coder Social logo

pursuitxh / cscope.vim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brookhong/cscope.vim

0.0 0.0 0.0 53 KB

A vim plugin to help you to create/update cscope database and connect to existing proper database automatically.

Vim Script 100.00%

cscope.vim's Introduction

Introduction

Cscove(new name for this plugin, since cscope.vim is used too widely.) is a smart cscope helper for vim.

It will try to find a proper cscope database for current file, then connect to it. If there is no proper cscope database for current file, you are prompted to specify a folder with a string like --

Can not find proper cscope db, please input a path to create cscope db for.

Then the plugin will create cscope database for you, connect to it, and find what you want. The found result will be listed in a location list window. Next time when you open the same file or other file that the cscope database can be used for, the plugin will connect to the cscope database automatically. You need not take care of anything about cscope database.

When you have a file edited/added in those folders for which cscope databases have been created, cscove will automatically update the corresponding database.

Cscove frees you from creating/connecting/updating cscope database, let you focus on code browsing.

Example settings

The default key mappings has been removed from the plugin itself, since users may prefer different choices. So to use the plugin, you must define your own key mappings first.

Below is the minimum key mappings.

nnoremap <leader>fa :call CscopeFindInteractive(expand('<cword>'))<CR>
nnoremap <leader>l :call ToggleLocationList()<CR>

Some optional key mappings to search directly.

" s: Find this C symbol
nnoremap  <leader>fs :call CscopeFind('s', expand('<cword>'))<CR>
" g: Find this definition
nnoremap  <leader>fg :call CscopeFind('g', expand('<cword>'))<CR>
" d: Find functions called by this function
nnoremap  <leader>fd :call CscopeFind('d', expand('<cword>'))<CR>
" c: Find functions calling this function
nnoremap  <leader>fc :call CscopeFind('c', expand('<cword>'))<CR>
" t: Find this text string
nnoremap  <leader>ft :call CscopeFind('t', expand('<cword>'))<CR>
" e: Find this egrep pattern
nnoremap  <leader>fe :call CscopeFind('e', expand('<cword>'))<CR>
" f: Find this file
nnoremap  <leader>ff :call CscopeFind('f', expand('<cword>'))<CR>
" i: Find files #including this file
nnoremap  <leader>fi :call CscopeFind('i', expand('<cword>'))<CR>

Screencast

Please note that line number changes in location list after file saved. cscove.vim

cscope.vim's People

Contributors

brookhong avatar yveoch avatar

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.