VIM配置笔记(cscope+NERDTree)

vim+ctags+cscope+Taglist+NERDTree打造成SourceInsight Vim神器,将Vim改造为强大的IDE 阅读详情
cscope安装

在www.sourceforge.net搜索下载cscope的tar包,解压之后进入解压之后的目录依次执行下面的命令

sudo apt-get install libncurses5-dev
sudo apt-get install flex
sudo apt-get install byacc
./configure
make
make install

从以下内容到文件~/.vimrc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CSCOPE settings for vim           
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" This file contains some boilerplate settings for vim's cscope interface,
" plus some keyboard mappings that I've found useful.
"
" USAGE:
" -- vim 6:     Stick this file in your ~/.vim/plugin directory (or in a
"               'plugin' directory in some other directory that is in your
"               'runtimepath'.
"
" -- vim 5:     Stick this file somewhere and 'source cscope.vim' it from
"               your ~/.vimrc file (or cut and paste it into your .vimrc).
"
" NOTE:
" 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.
"
" Happy cscoping,
"
" Jason Duell       jduell@alumni.princeton.edu     2002/3/7
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


" This tests to see if vim was configured with the '--enable-cscope' option
" when it was compiled.  If it wasn't, time to recompile vim...
if has("cscope")

    """"""""""""" Standard cscope/vim boilerplate

    " use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
    set cscopetag

    " check cscope for definition of a symbol before checking ctags: set to 1
    " if you want the reverse search order.
    set csto=0

    " add any cscope database in current directory
    if filereadable("cscope.out")
        cs add cscope.out  
    " else add the database pointed to by environment variable
    elseif $CSCOPE_DB != ""
        cs add $CSCOPE_DB
    endif

    " show msg when any other cscope db added
    set cscopeverbose  


    """"""""""""" My cscope/vim key mappings
    "
    " The following maps all invoke one of the following cscope search types:
    "
    "   '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
    "
    " Below are three sets of the maps: one set that just jumps to your
    " search result, one that splits the existing vim window horizontally and
    " diplays your search result in the new window, and one that does the same
    " thing, but does a vertical split instead (vim 6 only).
    "
    " I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's
    " unlikely that you need their default mappings (CTRL-\'s default use is
    " as part of CTRL-\ CTRL-N typemap, which basically just does the same
    " thing as hitting 'escape': CTRL-@ doesn't seem to have any default use).
    " If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all
    " of these maps to use other keys.  One likely candidate is 'CTRL-_'
    " (which also maps to CTRL-/, which is easier to type).  By default it is
    " used to switch between Hebrew and English keyboard mode.
    "
    " All of the maps involving the macro use '^$': this is so
    " that searches over '#include " return only references to
    " 'time.h', and not 'sys/time.h', etc. (by default cscope will return all
    " files that contain 'time.h' as part of their name).


    " To do the first type of search, hit 'CTRL-\', followed by one of the
    " cscope search types above (s,g,c,t,e,f,i,d).  The result of your cscope
    " search will be displayed in the current window.  You can use CTRL-T to
    " go back to where you were before the search.  
    "

    nmap s :cs find s =expand("")    
    nmap g :cs find g =expand("")    
    nmap c :cs find c =expand("")    
    nmap t :cs find t =expand("")    
    nmap e :cs find e =expand("")    
    nmap f :cs find f =expand("")    
    nmap i :cs find i ^=expand("")$
    nmap d :cs find d =expand("")    


    " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
    " makes the vim window split horizontally, with search result displayed in
    " the new window.
    "
    " (Note: earlier versions of vim may not have the :scs command, but it
    " can be simulated roughly via:
    "    nmap s :cs find s =expand("")    

    nmap s :scs find s =expand("")    
    nmap g :scs find g =expand("")    
    nmap c :scs find c =expand("")    
    nmap t :scs find t =expand("")    
    nmap e :scs find e =expand("")    
    nmap f :scs find f =expand("")    
    nmap i :scs find i ^=expand("")$    
    nmap d :scs find d =expand("")    


    " Hitting CTRL-space *twice* before the search type does a vertical
    " split instead of a horizontal one (vim 6 and up only)
    "
    " (Note: you may wish to put a 'set splitright' in your .vimrc
    " if you prefer the new window on the right instead of the left

    nmap s :vert scs find s =expand("")
    nmap g :vert scs find g =expand("")
    nmap c :vert scs find c =expand("")
    nmap t :vert scs find t =expand("")
    nmap e :vert scs find e =expand("")
    nmap f :vert scs find f =expand("")    
    nmap i :vert scs find i ^=expand("")$    
    nmap d :vert scs find d =expand("")


    """"""""""""" key map timeouts
    "
    " By default Vim will only wait 1 second for each keystroke in a mapping.
    " You may find that too short with the above typemaps.  If so, you should
    " either turn off mapping timeouts via 'notimeout'.
    "
    "set notimeout
    "
    " Or, you can keep timeouts, by uncommenting the timeoutlen line below,
    " with your own personal favorite value (in milliseconds):
    "
    "set timeoutlen=4000
    "
    " Either way, since mapping timeout settings by default also set the
    " timeouts for multicharacter 'keys codes' (like ), you should also
    " set ttimeout and ttimeoutlen: otherwise, you will experience strange
    " delays as vim waits for a keystroke after you hit ESC (it will be
    " waiting to see if the ESC is actually part of a key code like ).
    "
    "set ttimeout
    "
    " personally, I find a tenth of a second to work well for key code
    " timeouts. If you experience problems and have a slow terminal or network
    " connection, set it higher.  If you don't set ttimeoutlen, the value for
    " timeoutlent (default: 1000 = 1 second, which is sluggish) is used.
    "
    "set ttimeoutlen=100

endif

使用方法参考文件的帮助

NERDTree安装

从http://www.vim.org/scripts/script.php?script_id=1658下载安装包,解压后将plugin/NERD_tree.vim和doc/NERD_tree.txt分别拷到~/.vim/plugin和 ~/.vim/doc目录

使用方法就去网上搜吧,很多
vim+ctags+cscope+taglist+nerdtree vim+ctags+cscope+taglist+nerdtree ctags 1、安装ctags 1) sudo apt-get install ctags  或者 2) 在http://ctags.sourceforge.net/ 下载源代码包之后,解压缩生成源代码目录 进入源代码目录执行./configure & make & make install 2、v 阅读详情

相关推荐

vim完整开发环境配置(taglist/cscope/nerdtree/ctrlp)

原文地址:vim完整开发环境配置前言打算在linux下使用vim作为文本编辑器。但是vim本身的功能有限,需要借助其他插件,来实现更丰富的功能,以满足基本的代码阅读或者开发的需求。当然了,用vim作为一个IDE是一个不太推荐的做法。 安装配置vim插件因为接下来要安装较多插件,因此,先安装一个插件管理软件Vundle,用它来管理我们安装的软件,不仅方便,而且清爽。安装Vundle1.git clo

守望的博客-编程珠玑 3418

ctags,cscope,nerdtree,tmux 笔记

ctags相关   首先肯定是下载安装了。这点不用多讲,根据自己的操作系统或者平台,使用相应的包管理工具或者源码编译安装都可以。   下载完之后,在想要使用ctags帮助查找的文件夹(一般是项目的根目录)下输入如下命令:   ctasg -R1   命令执行完毕后就会在这个路径下生成一个tags文件,然后就可以通过下面两个最实用的命令来进行代码的跳转了, 具体的操作步骤如下:   1.

mmp591的博客 432

Vim+ctags+cscope+Nerdtree+Taglist入门

介于linux下并没有什么像Source Insight这样优秀的内核源码阅读工具,只有一些模仿的都不伦不类,所以我用打造vim为一个合格的源码阅读器,看着贼爽。 可能一下子看起来那么多东西可能怕怕的,但是可以一个一个来。Vim+ctags可以先用着,能够实现自动跳转。然后再一点一点加入其他的来完善。 下面就是我的vim的效果图(实际上不难,别被吓到),左边是Taglist 右边是Nerdtr

cnh294141800的专栏 2174

vim中使用cscope的方法

一、安装cscope 安装方式比较多样,可以在各自linux软件管理工具中安装,也可以去官网下载安装。 sudo apt-get install cscope 二、插件安装 这里选择的是Vundle来管理vim插件,所以只需要在.vimrc中添加Plugin ‘brookhong/cscope.vim’,然后执行:PluginInstall就搞定了。 三、生成标记库 cscope在执行过程中实际上是通过扫描标记库来首先找到标记以及标记的位置,从而实现跳转的,因此首先需要为个人的代码项目生成一个完整的标记库

习惯就好zz的专栏 2347

实战配置ubuntu下的vim开发环境

因为想在linux环境下开发网络程序,所以装了个ubuntu,很早就听说用vim来写程序效(zhuang)率(bi)很(li)高(qi),所以即使在linux上已经有了诸如Netbeans,VsCode,等编辑器,有CodeBlock这样的IDE,我还是去装了一个Vim。果然如传言一样,Vim是个高级货,光安装配置就花了不少时间。在我的安装过程中,我也上网查了不少资料,但几乎没有一篇文章是能完全解决

狼行天下 2万+

将VIM配置为IDE

前言 我们在服务器上做开发时,可以选择使用字符界面或者GUI界面。 由于远程GUI界面比较吃资源,因此其流畅度和本地操作系统的GUI界面相差甚远,使用体验往往不尽人意。 因此,一般首选字符界面做开发,VIM 编辑器是字符界面下的一款神器。 VIM 编辑器在配置好各种插件后,可以媲美 Windows 下功能强大的 IDE 而又不显得臃肿。 本文的配置非常方便快捷,Ubuntu 下只需通过 apt 安...

zhwenx3的博客 1734

【从入门到进阶】vim基础配置+ 常用插件(NERDTree, cscope, rainbow等)

文章目录前言一、vim基础配置二、常用插件2.1 Vundle2.1.1 Vundle安装2.1.2 Vundle配置2.1.3 安装插件2.1.4 Vundle常用指令2.2 NERDTree2.2.1 NERDTree安装2.2.2 NERDTree配置2.3 NERD Commenter2.3.1 NERD Commenter安装2.3.1 NERD Commenter配置总结 前言 在Windows平台上阅读/写代码常用的工具估计是VS Code或者Source Insight,在Linux平

Young824的博客 1万+

利用ctag+cscope+taglist+Nerdtree打造功能等价于sourceinsight的内核代码阅读神器

注:网络上关于利用ctag+cscope+taglist+Nerdtree打造功能等价于sourceinsight的博文数不胜数,本人这篇博文谈不上锦上添花,更遑论雪中送炭。把这个打造过程记录下来,仅仅只是希望能够为他人提供些许帮助,对我个人而言就已经很开心了。 1. 环境描述 ubuntu16.04 LTS,64操作系统。 2.安装ctag,cscope $sudo apt-get ins...

梦中溅了一身泥 2007

VIM下的cscope使用方法(图文并茂&简易上手)

一、cscope安装 sudo apt-get install cscope 二、创建cscope数据库 在需要建立cscope索引的源码目录下,运行下面这个命令即可生成cscope索引。 cscope -Rbq 而后在当前目录下会产生三个文件,cscope.out、cscope.in.out和cscope.po.out 创建数据库的各个参数含义如下: -R:递归解析所有的子目录。 -b:仅...

悟已往之不谏 知来者之可追 4987

cscope_map.vim

修改vimrc文件,关联cscope。修改方法为将if到endif的代码拷贝到/etc/vimrc文件中。

第二章 零差云控关节模组内部构造

对零差云控的eRob70I进行了拆解

SFY__优快云的博客 5957

Vim Cscope配置与使用

Cscope 是一个交互式的屏幕下使用的工具,本文主要简介其安装配置与使用等问题

一晌贪欢 6406

利用 Openocd 和 FT2232H 实现 ARMv8(Coretex-A53)高效调试方案

本文详细介绍了如何利用开源工具OpenOCD与高性能USB转接芯片FT2232H,构建一套针对ARMv8架构(如Cortex-A53)的高效、低成本调试方案。内容涵盖从环境搭建、驱动配置、核心调试架构解析到实战问题排查的全过程,帮助开发者实现对多核处理器的透明、可控调试,是嵌入式Linux及底层开发的实用指南。

weixin_29163581的博客 280

Vim神器 | vim+ctags+cscope+Taglist+Nerdtree打造成sourceinsight

听说vi很强大?是的,最近笔者需要在Linux下编写一些C代码和查看一些C源码,但是默认的vi并不支持函数之间的跳转、查看函数的定义等等,所以笔者就将vi打造成了一个ide(可以勉强称得上吧)。首先我们来看一下搭建完成之后的样子: [外链图片转存失败(img-3mOLMI8K-1566136798119)(https://img.dawnguo.cn/Linux/vim_to_si_2.jpg)]...

多选参数-程序锅 1616

Arduino+L298N电机驱动模块避坑指南:从接线到PWM调速的5个常见错误

本文详细解析了使用Arduino与L298N电机驱动模块时,从电源配置、跳线帽使用到PWM调速的5个常见错误与避坑指南。重点阐述了如何正确分离逻辑与电机电源、拔掉ENA/ENB跳线帽以实现PWM调速、理解H桥接线逻辑以控制直流电机正反转,并提供优化代码与散热建议,帮助开发者稳定驱动电机。

rust6ferris的博客 561

[Unity_Plastic SCM小技巧] 使用 UnityYAMLMerge 工具合并场景和预制件文件

首先YAMLMerge工具其实并不局限于PlasticSCM,git也可以,它是内置在Editor内的一个更加智能的版本控制工具,只不过正常不会启用,他的目录在C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe(Unity Editor安装目录),MAC上:/Applications/Unity/Unity.app/Content...

unityofficial的博客 1143

将Vim改造为强大的IDE—Vim集成Ctags/Taglist/Cscope/Winmanager/NERDTree/OmniCppComplete(有图有真相)

工欲善其事,必先利其器。一个强大的开发环境可以大大提高工作效率。好吧,我知道这是废话。。。不过,我想一定有很多跟我一样打算进入Linux平台开发的新手,一开始都为找不到一个像Windows下的VS那样可以一键安装并且功能几乎完美无缺的开发工具而郁闷不已,甚至打算收回刚刚迈出的脚步。所幸的是,通过几天努力,我总算配置出了一个功能完备的基于Vim的开发环境。这个开发环境除了基本的Vim外,还包括Cta

Road Ahead 14万+

PVE 9.0 保姆级安装及优化教程(换源、网络配置、远程唤醒等)【基础篇】

最近,Proxmox VE 推出了基于 Debian 13 的 9.0 版本。正巧我手头有一台闲置的老电脑,与其闲置,不如装上 PVE,让它化身 All in One,继续发挥它的余热。G4560 算是一颗 NAS 神 U,十几元的售价就能有双核四线程,比起什么 J1900 不知道强到哪里去了,尽管定位上是奔腾处理器,但性能甚至能和同代的酷睿 i3-7100 掰掰手腕,并且它还自带 HD 610 的核显,对于解码的支持也还不错。

zc_mk的博客 7510

vim NERDTree cscope配置

find source_dir  -name *.[ch] -o-name *.cpp > ./cscope.files cscope -kbq ctags -R NERDTree 配置: 下载nerdtree-master.zip 解压缩, ll /root/NERDTree/nerdtree-master total 24 drwxr-xr-x. 2 root root 409

813

QT上位机开发(掌握一点c++基础)

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】 c++是c语言的补充和扩展,本身的语法构成也是在一直迭代中。相信很多同学上大学读书的时候,或多或少对c语言有所了解,对它的变量、指针、函数也应该不陌生。既然大家都有c语言基础的话,那么在这方面稍微拓展一下的话,就可以学会c++了。当然c++本身的内容很多,很多方面还很琐碎,但我们学习的时候还是应该把精力放在那些经常使用到的语法上面。

嵌入式-老费,一个分享专业嵌入式知识的blog 1131

流体动力学仿真软件:SU2_(1).SU2简介与安装

SU2 是一个开源的计算流体动力学(CFD)和计算结构动力学(CSD)仿真软件,由斯坦福大学的航空航天系开发。它主要用于解决流体动力学问题,包括但不限于空气动力学、热力学、化学反应流等。SU2 的特点在于其高度的灵活性和可扩展性,使其成为科研和工业领域中非常受欢迎的工具。SU2 采用有限体积法(FVM)和有限元法(FEM)进行数值求解,支持多种物理模型和求解器,如 Euler 方程、Navier-Stokes 方程、RANS 方程等。

kkchenjj的博客 1311

Vim + ctags + cscope + taglist + nerdtree + winmanager 搭建详情

作为一个内核开发者,使用vim是必须的,而适当的插件帮助也是必不可少的,下面来看下一个vim新手搭建的详细过程! 一、首先安装vim sudo apt-get install vim 新安装的vim没有被配置,这时可以把他默认的配置拿到我们用户的配置下 cp /usr/share/vim/vim73/vimrc_example.vim ~/.vimrc vim启动的时候会读取

carmenloklok的专栏 2220

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

VIM 配置ctags/cscope 函数跳转

VIM 配置ctags/cscope 函数跳转 时间 2014-02-28 10:59:38 小文博客 原文  http://zhaoyuwen.org/vim-配置ctagscscope-函数跳转.html 主题 Vim 工欲善其事,必先利其器。一个强大的开发环境可以大大提高工作效率。好吧,我知道这是废话。。。不过,我想一定有很多跟我一样打算进入Lin

__Career Path ... __In Meredith Life 3931

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

linux代码阅读:Vim+ctags+cscope+Nerdtree+Taglist

参考文章:https://blog.youkuaiyun.com/cnh294141800/article/details/78208409 本人使用ubuntu16.04版本。 vim使用 首先安装vim:sudo apt install vim 安装完成后在命令行输入:vimtutor 根据教程半小时左右即可使用vim了 ctags安装 sudo apt install ctags taglist安装 解...

weixin_43327540的博客 359

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

上一篇: rabbitmq的简单管理命令笔记
下一篇: java发送json请求
liujinliu001
博客等级 码龄12年 22粉丝 59原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值