<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Hey Note - Medium]]></title>
        <description><![CDATA[Focus on Embedded Linux, RTOS, and Web Development. - Medium]]></description>
        <link>https://medium.com/heynote?source=rss----153c33457238---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Hey Note - Medium</title>
            <link>https://medium.com/heynote?source=rss----153c33457238---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 16:01:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/heynote" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Use Gtags/Gnu Global with Vim, replace ctags and cscope]]></title>
            <link>https://medium.com/heynote/use-gtags-gnu-global-with-vim-replace-ctags-and-cscope-15ae03f272e3?source=rss----153c33457238---4</link>
            <guid isPermaLink="false">https://medium.com/p/15ae03f272e3</guid>
            <category><![CDATA[gtag]]></category>
            <category><![CDATA[cscope]]></category>
            <category><![CDATA[ctags]]></category>
            <category><![CDATA[gnu-global]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Chenwei Yang]]></dc:creator>
            <pubDate>Sun, 07 May 2017 05:33:43 GMT</pubDate>
            <atom:updated>2017-05-07T13:02:58.595Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey man~</p><p>原本使用 Ctag + Cscope 去 trace code，在 C 語言可以很好的找到我想要的，但是在 python 或 javascript 有時候就沒這麼實用了，後來上網找到 <strong>Gnu Global</strong>，它結合了 Ctag 和 Cscope 各自優點，和支援許多語言，用起來很順手，所以就來分享給大家～</p><p>這是 ctags / cscope / gtags 和一些 tool 的比較</p><ul><li><a href="https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Similar-Tools">https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Similar-Tools</a></li></ul><h3>Linux 安裝</h3><p>安裝建置相依性套件：</p><pre>sudo apt-get build-dep global<br>sudo apt-get install libncurses5-dev libncursesw5-dev</pre><p>為了讓 gtags 支援 ctags 的解析器，需要另外去<a href="https://www.gnu.org/software/global/download.html">官網</a> 下載，再重新編輯，假設已經下載完，和已經解壓縮完在當前目錄下了，這時要確定你的 ctags-exuberant 位置在哪，可以使用以下指令查看</p><pre>type ctags-exuberant</pre><p>再來重新編輯它 ( 假設 ctags 安裝在 /usr/bin )</p><pre>$ ./configure --with-exuberant-ctags=/usr/bin/ctags-exuberant --with-sqlite3<br>$ make<br>$ sudo make install</pre><p>最後只要在 bashrc 設定路徑就可以開始使用了( 假設你的 gtags 安裝在 /usr/local/share/ )</p><pre>$ export GTAGSCONF=/usr/local/share/gtags/gtags.conf</pre><pre>$ export GTAGSLABEL=ctags-exuberant</pre><p>在介紹一下 pygaments，他對 ctags 做處理，讓 gtags 能更完美解析程式，在gnu global 6.5 之後已經內建這一個解析器，不用而外去下載，為了使用他，需要在bashrc 設定路徑</p><pre>export GTAGSLABEL=pygments</pre><h3><strong>Mac 安裝</strong></h3><p>mac 安裝可以透過 Homebrew下去安裝</p><pre>brew install global — with-exuberant-ctags — with-pygments</pre><p>安裝完再去 bash 設定路徑就可以，這部分跟上面講的步驟是一樣的</p><h3>在 vim 使用 gtags</h3><p>我在 vim 下透過 Vundle 安裝 gtags.vim 這一個套件</p><pre>Plugin ‘aceofall/gtags.vim’</pre><p>然後設置 vimrc 就可以透過 gtags 和 gtags-cscope 來取代 ctags 和 cscope了</p><pre>set cscopetag<br>set cscopeprg=’gtags-cscope’<br>let GtagsCscope_Auto_Load = 1<br>let GtagsCscope_Auto_Map = 1<br>let GtagsCscope_Quiet = 1</pre><p>最後就可以透過 cscope 的介面跟指令去 trace code了 ～</p><p>Happy coding !</p><h3>Reference</h3><ul><li><a href="https://www.gnu.org/software/global/global.html">https://www.gnu.org/software/global/global.html</a></li><li><a href="https://fossies.org/linux/global/plugin-factory/PLUGIN_HOWTO.pygments">https://fossies.org/linux/global/plugin-factory/PLUGIN_HOWTO.pygments</a></li><li><a href="http://descent-incoming.blogspot.tw/2016/08/globalgtags-with-vim.html">http://descent-incoming.blogspot.tw/2016/08/globalgtags-with-vim.html</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15ae03f272e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/heynote/use-gtags-gnu-global-with-vim-replace-ctags-and-cscope-15ae03f272e3">Use Gtags/Gnu Global with Vim, replace ctags and cscope</a> was originally published in <a href="https://medium.com/heynote">Hey Note</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>