一、Ubuntu14.04下配置

1、配置vimrc文件

输入:version课查看vimrc文件及位置:

system vimrc file: "$VIM/vimrc"

user vimrc file: "$HOME/.vimrc“(建议放置位置)

2nd user vimrc file: "~/.vim/vimrc"

user exrc file: "$HOME/.exrc"

system gvimrc file: "$VIM/gvimrc"

user gvimrc file: "$HOME/.gvimrc"

2nd user gvimrc file: "~/.vim/gvimrc"

system menu file: "$VIMRUNTIME/menu.vim"

打开vim,输入:! echo $VIM 即可知道VIM的安装路径

2、ctags安装和配置

1) 安装

sudo apt-get install ctags

2) ~/.vimrc配置

相关配置在后边列出vimrc文件。

3、taglist插件安装及配置

1)查找插件

官网http://www.vim.org中查找taglist插件

http://www.vim.org/scripts/script.php?script_id=273

2) 安装:

官方说明(加黑部分为我放置的位置):

  1. Download the taglist.zip file and unzip the files to the $HOME/.vim or the
        $HOME/vimfiles or the $VIM/vimfiles directory. After this step, you should
        have the following two files (the directory structure should be preserved):

    plugin/taglist.vim - main taglist plugin file
             doc/taglist.txt    - documentation (help) file

    Refer to the |add-plugin|, |add-global-plugin| and |runtimepath| Vim
       help pages for more details about installing Vim plugins.
    2. Change to the $HOME/.vim/doc or $HOME/vimfiles/doc or $VIM/vimfiles/doc
        directory, start Vim and run the ":helptags ." command to process the
        taglist help file. Without this step, you cannot jump to the taglist help
        topics.
    3. If the exuberant ctags utility is not present in your PATH, then set the
        Tlist_Ctags_Cmd variable to point to the location of the exuberant ctags
        utility (not to the directory) in the .vimrc file.
    4. If you are running a terminal/console version of Vim and the terminal
        doesn't support changing the window width then set the
        'Tlist_Inc_Winwidth' variable to 0 in the .vimrc file.
    5. Restart Vim.
    6. You can now use the ":TlistToggle" command to open/close the taglist
        window. You can use the ":help taglist" command to get more information
        about using the taglist plugin.

3) ~/.vimrc配置

配置在后边列出vimrc文件

4、SrcExpl 插件

https://www.vim.org/scripts/script.php?script_id=2179

配置在后边列出vimrc文件

5、Trinity插件

已经包含了NERD_tree插件

安装步骤:我的安装路径$VIM/vimfiles【doc和plugin】

配置在后边列出vimrc文件

6、Cscope安装

sudo apt-get install cscope

7、配置文件

runtime! debian.vim

if has("syntax")
    syntax on
endif

colorscheme desert

set showcmd
set showmatch
set ignorecase
set smartcase
set incsearch
set autowrite
set hidden
set mouse=a

set number
set hlsearch

set tabstop=
set softtabstop=
set shiftwidth=
set expandtab

set autoindent
set cindent

"map the keys to jump from one window to another
"left window
nmap <C-H> <C-W>h
"bottom window
nmap <C-J> <C-W>j
"up window
nmap <C-K> <C-W>k
"right window
nmap <C-H> <C-W>l

if filereadable("/etc/vim/vimrc.local")
    source /etc/vim/vimrc.local
endif

""""""""""""""""""""""""""""""""""""""
"plugin

""""""""""""""""""""""""""""""""""""""

"cscope would not allow this action
"set autochdir

"ctags setting
"press F5 to generate tags in current directory
nnoremap <F5> :!ctags -R .<CR>
"find tags in parent directory
set tags=tags;/

"taglist setting
let Tlist_WinWidth=
let Tlist_Exit_OnlyWindow=
let Tlist_Use_Left_Window=
let Tlist_Show_One_File=
let Tlist_File_Fold_Auto_Close=
let Tlist_Process_File_Always=

"Source Explorer setting
" // The switch of the Source Explorer                                         "
" nmap <F8> :SrcExplToggle<CR>
"                                                                              "
" // Set the height of Source Explorer window                                  "
let g:SrcExpl_winHeight =
"                                                                              "
" // Set 500 ms for refreshing the Source Explorer                             "
let g:SrcExpl_refreshTime =
"                                                                              "
                                                           "
" // In order to avoid conflicts, the Source Explorer should know what plugins "
" // except itself are using buffers. And you need add their buffer names into "
" // below listaccording to the command ":buffers!"
let g:SrcExpl_pluginList = [
        \ "__Tag_List__",
        \ "_NERD_tree_",
        \ "Source_Explorer"
    \ ] 

" // The color schemes used by Source Explorer. There are five color schemes           "
" // supported for now - Red, Cyan, Green, Yellow and Magenta. Source Explorer         "
" // will pick up one of them randomly when initialization.
let g:SrcExpl_colorSchemeList = [
        \ "Red",
        \ "Cyan",
        \ "Green",
        \ "Yellow",
        \ "Magenta"
    \ ] 

" // Enable/Disable the local definition searching, and note that this is not  "
" // guaranteed to work, the Source Explorer doesn't check the syntax for now. "
" // It only searches for a match with the keyword according to command 'gd'   "
let g:SrcExpl_searchLocalDef =
"                                                                              "
" // Workaround for Vim bug @https://goo.gl/TLPK4K as any plugins using autocmd for    "
" // BufReadPre might have conflicts with Source Explorer. e.g. YCM, Syntastic etc.    "
let g:SrcExpl_nestedAutoCmd =
"                                                                              "
" // Do not let the Source Explorer update the tags file when opening          "
let g:SrcExpl_isUpdateTags =
" // Set "<F12>" key for updating the tags file artificially                   " let g:SrcExpl_updateTagsKey = "<F12>" 
" // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to "
" //  create/update a tags file                                                "
let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ." 

" // Set "<F3>" key for displaying the previous definition in the jump list    " let g:SrcExpl_prevDefKey = "<F3>" " // Set "<F4>" key for displaying the next definition in the jump list        " let g:SrcExpl_nextDefKey = "<F4>" let g:SrcExpl_jumpkey = "<ENTER>"let g:SrcExpl_gobackkey = "<SPACE>"

"trinity setting" Open and close all the three plugins on the same time nmap <F8>   :TrinityToggleAll<CR> " Open and close the srcexpl.vim separately nmap <F9>   :TrinityToggleSourceExplorer<CR> " Open and close the taglist.vim separately nmap <F10>  :TrinityToggleTagList<CR> " Open and close the NERD_tree.vim separately nmap <F11>  :TrinityToggleNERDTree<CR> 

"cscope setting"press F6 to generate cscope.out in current directory"cscope.in.out and cscope.po.out will also be generatednnoremap <F6> :!cscope -Rbkq<CR>

"add cscope.outif filereadable("cscope.out")    cs add cscope.outendif

"key mapping, <leader> is '\' defaultif has("cscope")    "Ctrl+] and Ctrl+t to jump like ctags    set cscopetag    "check cscope for definition of a symbol before checking ctags    "set to 1 if you want to reverse search order    set csto=1

    "set cscopequickfix=s-, g-, d-, c-, t-, e-, i-    "find where c symbols apper    nmap <leader>s :cs find s <C-R>=expand("<cword>")<CR><CR>
    "find where symbols define, like ctags    nmap <leader>g :cs find g <C-R>=expand("<cword>")<CR><CR>
    "find the function called by this function    nmap <leader>d :cs find d <C-R>=expand("<cword>")<CR><CR>
    "find the function call this function    nmap <leader>c :cs find c <C-R>=expand("<cword>")<CR><CR>
    "find string    nmap <leader>t :cs find t <C-R>=expand("<cword>")<CR><CR>
    "like egrep but fast    nmap <leader>e :cs find e <C-R>=expand("<cword>")<CR><CR>
    "find and open file, like find in vim    nmap <leader>f :cs find f <C-R>=expand("<cword>")<CR><CR>
    "find the file containing this file    nmap <leader>i :cs find i <C-R>=expand("<cword>")<CR><CR>
endif

srcexpl.vim文件中,需要将

exe "set autochdir"

这句注释掉,否则cscope会有问题。

二、Windows10下配置

1、配置vimrc文件

输入:version课查看vimrc文件及位置:

在$HOME/_vimrc更改设置

2、ctags安装和配置

1) 安装

http://ctags.sourceforge.net/ 下载ctags58

将压缩包解压到$VIM/vimfiles/plugin

在系统变量Path中添加$VIM/vimfiles/plugin

2) ~/.vimrc配置

在$HOME/_vimrc中插入相同的代码

其余参考ubuntu的操作,用trinity后方便很多。

打造vim成类source insight的更多相关文章

  1. 打造linux下的source insight——vim插件安装使用总结

    source insight是windows下的优秀编辑器,适合阅读管理代码,主要有以下功能: 查找函数,变量或者宏的定义. 查找函数,变量或者宏的引用位置. 查找函数被调用的位置 查找某个符号在工程 ...

  2. vim 绑定到 source insight 快捷键

    1. optioons -> custom commands 2. 选择然后写入run命令: "D:\Program Files (x86)\Vim\vim74\gvim.exe&qu ...

  3. 如何将vim打造成Linux下的source insight

    编写者:龙诗科 邮箱:longshike2010@163.com 2016-01-06 众所周知,windows下的source insight是阅读项目代码的神器,其神奇之处在于可以根据当前鼠标所指 ...

  4. source insight和vim同时使用

    https://blog.csdn.net/wangn222/article/details/72721993 1.Source Insight中,Options->Custom Command ...

  5. 给Source Insight做个外挂系列之五--Insight “TabSiPlus”

    “TabSiPlus 外挂插件”主要有两部分组成,分别是“外挂插件加载器”和“插件动态库”.“插件动态库”完成Source Insight窗口的Hook,显示Tab标签栏,截获Source Insig ...

  6. 给Source Insight做个外挂系列之二--将本地代码注入到Source Insight进程

    上一篇文章介绍了如何发现正在运行的“Source Insight”窗口,本篇将介绍“TabSiPlus”是如何进行代码注入的.Windows 9x以后的Windows操作系统都对进程空间进行了严格的保 ...

  7. 给Source Insight做个外挂系列之一--发现Source Insight

    一提到外挂程序,大家肯定都不陌生,QQ就有很多个版本的去广告外挂,很多游戏也有用于扩展功能或者作弊的工具,其中很多也是以外挂的形式提供的.外挂和插件的区别在于插件通常依赖于程序的支持,如果程序不支持插 ...

  8. Source Insight设置

    Source Insight设置 1.背景色选择     要改变背景色Options->preference->windows background->color设置背景色,设置自定 ...

  9. 【转】破解Source Insight 3.5.0072过程 附:安装软件+注册机

    转载地址:http://blog.csdn.net/qs_hud/article/details/8884867 注册机及软件下载地址:http://download.csdn.net/detail/ ...

随机推荐

  1. win下配置java环境变量

    系统变量→新建 JAVA_HOME 变量 . 变量值填写jdk的安装目录(本人是 E:\Java\jdk1.7.0)  系统变量→寻找 Path 变量→编辑 在变量值最后输入 %JAVA_HOME%\ ...

  2. 微信小程序-使用腾讯Wxpage

    微信小程序想要更快的速度吗? 满足你 https://github.com/tvfe/wxpage#-c%E5%AE%9A%E4%B9%89 使用超简单(导入wxpage.js,最后使用对象名:P): ...

  3. VC6 在使用VC助手(Visual AssistX)在Win7下不能使用↑↓←→及回车键选择的解决的方法

    VC6使用Visual AssistX版本号的问题,换一个版本号.如"Visual Assist X 10.8.2029"就可以解决. http://pan.baidu.com/w ...

  4. leetcode-Symmetric Tree 对称树

    Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...

  5. IE对CSS样式的数量和大小的限制

    项目中遇到的问题,css写的样式无法渲染,各种百度后发现大概是这个原因: IE对CSS样式的数量和大小的限制 文档中只有前31个link或style标记关联的CSS能够应用. 从第32个开始,其标记关 ...

  6. Win8.1离线安装.Net Framework 3.5

     在线安装太慢了! 只要一个命令搞掂 不希望使用Internet连接,可以使用DISM (部署映像服务和管理工具)离线部署 .NET Framework 3.5   1. Win+X选择命令提示符(管 ...

  7. typedef,结构体,共用体,联合体

    typedef的用途: 封装数据类型,方便移植 简化函数指针的定义 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/ ...

  8. 如何在cmd中启动redis

    首先要指定redis安装的目录,然后输入: redis-server.exe redis.windows.conf 如果成功,则会出现redis的标志,失败的话 请转帖到: http://www.cn ...

  9. PHP计划任务:如何使用Linux的Crontab执行PHP脚本(转)

    我们的PHP程序有时候需要定时执行,我们可以使用ignore_user_abort函数或是在页面放置js让用户帮我们实现.但这两种方法都不太可靠,不稳定.我们可以借助Linux的Crontab工具来稳 ...

  10. 集群通信组件Tribes之怎样维护集群成员信息

    一个集群包括若干成员,要对这些成员进行管理就必需要有一张包括全部成员的列表.当要对某个节点做操作时通过这个列表能够准确找到该节点的地址进而对该节点发送操作消息.怎样维护这张包括全部成员的列表是本节要讨 ...