" Usage " ----- " First of all, you must execute gtags(1) at the root of source directory " to make tag files. Assuming that your source directory is '/var/src', " it is neccessary to execute the following commands. " " [Load vim] " $ cd /var/src " $ gtags " $ vim " [Load gtags-cscope] " :GtagsCscope <ENTER> (in vim command line) " " Basic command " ------------- " Then you can use cs commands except for the 'd'(2) command. " Profitable commands are assigned to keys like follows: " " explanation command " ---------------------------------------------------------- " Find symbol :cs find 0 or s " Find definition :cs find 1 or g " Find functions called by this function (not implemented) " Find reference :cs find 3 or c " Find text string :cs find 4 or t " Find egrep pattern :cs find 6 or e " Find path :cs find 7 or f " Find include file :cs find 8 or i " Find assignments :cs find 9 or a " " You can move tag list using: " Go to the next tag :tn " Go to the previous tag :tp " Pop tag stack :pop
除了不能使用 :cs find d 命令,可以使用其他所有的命令,gtags-cscope.vim 使用快捷键替代了输入命令,常用的快捷键的含义如下:
ifhas("cscope") " To use the default key/mouse mapping: let GtagsCscope_Auto_Map = 1
" To deterring interruption: let GtagsCscope_Keep_Alive = 1 set cscopetag set csprg=/usr/bin/gtags-cscope set csto=1 set nocsverb " Set enviroment values let $GTAGSLABEL='native-pygments' let $GTAGSCONF='/etc/gtags.conf'
vim 确实是程序编辑的利器,但是在用vim 写中文文档的时候,有一个痛点,你在用 fcitx 写中文的时候想保存文档, vim 必须切换到 normal 模式才能输入保存的命令 :w,进入normal 模式的方法是连续按两下 ESC,好了现在你应该 输入命令了,但是你没法输入你现在还在打中文呢,没有办法你必须先切换到英文输入法,然后才能正确地输入 :w 痛苦啊。