Skip to content

blue119/cs-mgmt.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cs-mgmt.vim

Introduction

Providing a efficient way of managing the symbol cross-reference(cscope) and tag files(ctags).

  • Offer a menu for choosing which one referencing file you want to include.
  • There is one file contain all information about your referencing file structure.
  • One command to create item to cs-mgmt db. and then to operate your db with hotkey within buffer of cs-mgmt.
  • Providing attach, detach, delete, build, and rebuild function for referencing file operation.
  • All referencing files concentrated into same folder in $HOME/.cs-mgmt. so you can know how many that you have and attaching them on the fly by cs-mgmt's menu within vim.

Usage

Pressing cs, to display your cs-mgmt database within vim's buffer. And then you can operate these referencing file by hot-keys.

Command

:CsMgmt and cs

Used as toggle command to open or close cs-mgmt menu. the hot-key 'q' can be used to close cs-mgmt buffer as well.

:Csmgmtadd

It is used to add a configure to your cs-mgmt db file that is a JSON file. Currently, It only support two types of compress file: .tar.gz and .tar.bz2

Example

:Csmgmtadd <file|dir|url|apt> <src path> [<alias> [<group>]]
:Csmgmtadd dir ~/foo/bar  # Add a "bar" in top level
:Csmgmtadd dir ~/foo/bar foo_bar # Add a "foo_bar" in top level
:Csmgmtadd dir ~/foo/bar foo_bar group/foo/bar # Add a "foo_bar" in group/foo/bar level

Options

g:CsMgmtRefHome

your cscope's database will be putted into this folder.

let g:CsMgmtRefHome = $HOME.'/.cs-mgmt/'

g:CsMgmtDbFile

It is a txt file of JSON format. that defined your db structure.

let g:CsMgmtDbFile = $HOME.'/.cs-mgmt.json

g:CsMgmtSrcDepot

Where will put your source code that build by CsMgmtAdd comamnd.

let g:CsMgmtSrcDepot = g:CsMgmtRefHome.'.source_depot/'

g:CsMgmtReAttach

Re-attach your reference file after rebuilding.

let g:CsMgmtReAttach = 1

g:CsMgmtCtags

Support tags referencing file. It will also create a tags file of ctags after creating referencing file of cscope

let g:CsMgmtCtags = 1

g:CsMgmtDebugEnable

Enable debug mode. The default is based on Decho plugin.

let g:CsMgmtDebugEnable = 1

JSON File

The following JSON file is a simple configuration. It is only define a items for C standard library. If you'd like to edit this file by your self. I don't recommend you do this but I think following the fellowing configuration is a good start.

{
    'usr_include' : [
        '/usr/include/', 
        ],
}

Key Mapping In Menu

When you cursor focused on buffer of CsMgmt, following key can be used to manage your reference configuration.

Operation:

  • Press a to attach
  • Press d to detach
  • Press b to build db
  • Press r to rebuild db

Group Operation:

  • It will do group operation, if the cursor is under group tag.

Access Operation:

  • Press dd to delete a single reference or whole group.
  • Press oo to open all file on vim buffer at one time.

About

manage your cscope symbol cross-reference

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published