dotfiles/.vim/pack/plugins/start/vim-fzf-cscope/README.md

2.5 KiB
Executable File

fzf_cscope.vim

CSCOPE settings for vim using popup and preview window """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

image-20210314031215254

This file contains settings for vim's cscope interface to fzf (can use vim* >8 advanced popup feature), " plus some keyboard mappings that I've found useful.

Prerequisites :

  1. cscope -- install using 'sudo apt install cscope' on ubuntu
  2. https://github.com/junegunn/fzf
  3. https://github.com/junegunn/fzf.vim

Installation:

Install fzf & fzf.vim before installing fzf_csope.vim and using it

Using pathogen.vim, and then simply copy and paste:

mkdir -p ~/.vim/bundle
cd ~/.vim/bundle
git clone https://github.com/nmaiti/fzf_cscope.vim.git

using vim Plug add following in your ~/.vimrc

Plug 'nmaiti/fzf_cscope.vim'

key mappings

Search options -

's'   symbol: find all references to the token under cursor.
'g'   global: find global definition(s) of the token under cursor
'c'   calls:  find all calls to the function name under cursor.
't'   text:   find all instances of the text under cursor.
'e'   egrep:  egrep search for the word under cursor.
'f'   file:   open the filename under cursor.
'i'   includes: find files that include the filename under cursor.
'd'   called: find functions that function under cursor calls.
'a'   Assigned: Assigned to this symbol.
<Leader>k<search option key>  ------- search word/file under the current cursor
e.g.sc
<Leader>kc  -   find callers of current keyword/symbol

// Interactive cscope search

<Leader><Leader>k<search option key>  ------- search something
e.g.
<Leader><Leader>ks  -   find symbol

NOTE:

  1. These key maps use multiple keystrokes (2 or 3 keys). If you find that vim " keeps timing you out before you can complete them, try changing your timeout " settings, as explained below
  2. cscope_map.vim can also be used independently with it's own key mappings. If not csope_maps.vim is not present fzf_cscope.vim can use csope_maps.vim's keyboard shortcuts for convenience of programmers. In that case instead of 'k', '<Ctrl - >' can be used.

Self promotion:

Try zsh_vim config to_plug branch for latest vim features and plugins