[20081118] How To Trace Code Like Source Insight Through Vim

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    4 Favorites

    [20081118] How To Trace Code Like Source Insight Through Vim - Presentation Transcript

    1. Payton Chou 2008/11/18 How to trace code like source insight through vim?
    2. Vim hierarchy
      • /etc/vim
      • |-- colors # theme
      • |   `-- ir_black.vim
      • |-- doc # related intro .
      • |   |-- SuperTabContinue.txt
      • |   `-- Trinity.txt
      • |-- gvimrc # configure for gvim (vim-gnome)
      • |-- oldvimrc
      • |-- plugin # vim plugin
      • |   |-- NERD_tree.vim
      • |   |-- cscope_maps.vim
      • |   |-- srcexpl.vim
      • |   |-- supertab.vim
      • |   |-- taglist.vim
      • |   `-- trinity.vim
      • |-- vimrc # configure for vim
      • `-- vimrc.tiny # configure for vi
      EeePC SWRD Chi-Heng Chou
    3. How to equip vim
      • Install it
        • apt-get install vim vim-gnome exuberant-ctags cscope
      • Modify your vimrc
      • The vimrc also effect the configure of gvim
      • Go to official site and put the vim plugin in /etc/vim/plugin
      • Enjoy vimming
      EeePC SWRD Chi-Heng Chou
    4. Basic setting of vim
      • set showmatch        " Show matching brackets.
      • set ignorecase        " Do case insensitive matching
      • set incsearch        " Incremental search
      • set mouse=a        " Enable mouse usage (all modes) in terminals
      • syntax on
      • set autoindent
      • set tabstop=4
      • set shiftwidth=4
      • set expandtab
      • set softtabstop=4
      EeePC SWRD Chi-Heng Chou
    5. The killer of trace code tools
      • Trinity (trinity.vim)
        • NERD_tree.vim
          • file browser
        • srcexpl.vim
          • source browser
        • taglist.vim
          • class browser
      • Enhance of ctag
        • cscope_maps.vim
          • symbol search tools
      • Enhance Auto complete
        • supertab.vim
      EeePC SWRD Chi-Heng Chou
    6. Advance setting of vim – font, theme, key mapping
      • Font
        • set gfn=Consolas 12
      • Theme
        • colorscheme ir_black
      • Key mapping
        • Toggle taglist
          • nnoremap <silent> <F12> :TlistToggle<CR>
        • Trinity: Open and close all the three plugins on the same time
          • nmap <F8>   :TrinityToggleAll<CR>
        • Trinity: Open and close the srcexpl.vim separately
          • nmap <F9>   :TrinityToggleSourceExplorer<CR>
        • Trinity: Open and close the taglist.vim separately
          • nmap <F10>  :TrinityToggleTagList<CR>
        • Trinity: Open and close the NERD_tree.vim separately
          • nmap <F11>  :TrinityToggleNERDTree<CR> 
      EeePC SWRD Chi-Heng Chou
    7. Advance setting of vim - devhelp
      • &quot; vim macro to jump to devhelp topics.
      • &quot; --------------------------------------------
      • function! DevHelpCurrentWord()
      •         let word = expand(&quot;<cword>&quot;)
      •         exe &quot;!devhelp -s &quot; . word
      •         redraw!
      • endfunction
      • &quot; Example: bind <ESC>h to start devhelp and search for the word under the
      • &quot; cursor
      • nmap <ESC>h :call DevHelpCurrentWord()<CR>
      EeePC SWRD Chi-Heng Chou
    8. Advance setting of vim – Search on line
      • &quot; online doc search
      • &quot; --------------------------------------------
      • function! OnlineDoc()
      •     let s:browser = &quot;firefox&quot;
      •     let s:wordUnderCursor = expand(&quot;<cword>&quot;)
      •     if &ft == &quot;cpp&quot; || &ft == &quot;c&quot; || &ft == &quot;ruby&quot; || &ft == &quot;php&quot; || &ft == &quot;python&quot;
      •     let s:url = &quot; http://www.google.com/codesearch?q=&quot;.s:wordUnderCursor.&quot;+lang:&quot;.&ft
      •     elseif &ft == &quot;vim&quot;
      •     let s:url = &quot; http://www.google.com/codesearch?q=&quot;.s:wordUnderCursor
      •     else
      •     return
      •     endif
      •     let s:cmd = &quot;silent !&quot; . s:browser . &quot; &quot; . s:url
      •     execute  s:cmd
      •     redraw!
      • endfunction
      • map <ESC>k :call OnlineDoc()<CR>
      EeePC SWRD Chi-Heng Chou How to use cscope?
    9. Demo trace code through vim
      • Supertab
      • Trinity
      • Online help
      • devhelp
      • ctag and cscope
        • ctags * & cscope -R
      EeePC SWRD Chi-Heng Chou
    10. Reference (1/3)
      • My vim package
        • http://vip-file.com/download/8dd841907924/vim.tar.bz2.html
      • vim 的老家
        • http://vim.sf.net 或者 www.vim.org , 这里有很多 vim 的 tips 和 scripts
      • vim 的中文文档
        • http://vimcdoc.sourceforge.net/ , 这里有 pdf 格式下载 , 可以下载了慢慢看 .
      • Best of Vim Tips
        • http://www.rayninfo.co.uk/vimtips.html
        • 在你询问某个技巧之前 , 先看看这篇 Best of Vim Tips, 很有可能你就找到答案了 . 作者搜集整理了大量的 vim 技巧 , 15 Years of Vi + 3 years of Vim and still learning , 作者这么说 .
        • 那我们呢 ?vim 的学习是无止境的 , 学的越多 , 你的效率就越高
      • VIM Quick Reference Card
        • 这个对于新手很有用 , 也许刚开始你记不住那么多 vim 的快捷键 , 没关系 , 打印一张卡片放在手边 , 忘记了可以看看 .
        • http://tnerual.eriogerg.free.fr/vim.html , 这里有 pdf, dvi 和 tex 格式的供下载
      • vim 新手指南
        • vimtutor: vim 内置的快速指南 , 强烈建议新手先看看这个交互式的入门教程
        • 执行方法 : vimtutor, 如果是 windows, 在 vim 的安装目录下也有一个 vimtutor.bat 文件
      • http://www.vi-improved.org/
        • 这里有给新手的一些建议 , 还有 vimrc 和 gvimrc 的实例 , 稍作修改就可以为己所用 .
      • Vim Cookbook
        • http://www.oualline.com/vim-cook.html
      EeePC SWRD Chi-Heng Chou
    11. Reference (2/3)
      • VIM Reference Card
        • http://www.linux.ie/articles/tutorials/vim-3.0.refcard.html
      • http://www.pinkjuice.com/howto/vimxml/index.xml
        • 如果需要用 vim 编辑 XML, 看看这里的文章 Vim as XML Editor
      • 如果需要用 vim 编辑 LaTex, 看看这里
        • http://vim-latex.sourceforge.net/
      • 如果你需要 vim 也能像 source insight 一样的代码自动完成 , 可是试试这个 : Vim Intellisense
        • http://insenvim.sourceforge.net/
        • 它支持 c++,c#,java,JSP,xml,html 和 SQL 种语言 , 依赖 perl . 缺点是仅仅支持 windows 平台
      • Vim 的杯子
        • http://www.cafepress.com/vimrefmug.25635024
        • 你没有看错 , 是 vim 的杯子 ! 上面印着 Vim Reference , 不过一个需要 $10.99, 看清楚 , 是美元
      • color scheme
        • a) for JAVA
        • http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-java.html
        • b) for HTML
        • http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-html.html
        • c) for PERL
        • http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-pl.html
        • d) for LaTex
        • http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-tex.html
      EeePC SWRD Chi-Heng Chou
    12. Reference (3/3)
      • 最后强烈推荐水木社区 bbs 的 vim 版面 : http://bbs.newsmth.net ,那里面高手如云,是国内最好的有关 vim 的专业版面。
      • http://yurinfore.blogspot.com/2008/11/vim-google-code-search.html
      • http://blog.roodo.com/thinkingmore/archives/7515251.html
      • http://bhoadmin.blog.sohu.com/99498576.html
      EeePC SWRD Chi-Heng Chou
      • Thanks for your kind attention
      EeePC SWRD Chi-Heng Chou

    + payton345payton345, 2 years ago

    custom

    1764 views, 4 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1764
      • 1760 on SlideShare
      • 4 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 19
    Most viewed embeds
    • 4 views on http://chihengchou.blogspot.com

    more

    All embeds
    • 4 views on http://chihengchou.blogspot.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags