windows环境中vim插件配置(便利的vim)

        打开vim的文件类型自动检测功能:filetype on,就是在vimrc文件中加上filetype onjavascript

1.ctags 

1.1ctags功能:

        tags是个exe文件,在shell中执行来在工程目录中建立tags(就是函数的映射关系),适用ctrl ],和ctrl T 来寻找函数定义。注:Taglist是配合ctags来适用的!!!php

1.2ctags用法:

      在shell中html

ctags [options] [file(s)]java

<pre name="code" class="javascript">Usage: ctags [options] [file(s)]
  -e Output tag file for use with Emacs.
       Write tags to specified file. Value of "-" writes tags to stdout
  -F Use forward searching patterns (/.../) (default).
       Specify list of file extensions to be treated as include files.
       A list of tokens to be specially handled is read from either the
       A list of source file names are read from the specified file.
  -n Equivalent to --excmd=number.
  -N Equivalent to --excmd=pattern.
  -R Equivalent to --recurse.
  -u Equivalent to --sort=no.
  -x Print a tabular cross reference file to standard output.
       Should tags should be appended to existing tag file [no]?
      Include reference to 'file' in Emacs-style tag file (requires -e).
      Exclude files and directories matching 'pattern'.
       Uses the specified type of EX command to locate tags [mix].
      Include extra tag entries for selected information (flags: "fq").
      Include selected extension fields (flags: "afmikKlnsStz") [fks].
       Should tags scoped only for a single file (e.g. "static" tags
       Behave as a filter, reading file names from standard input and
  --filter-terminator=string
       Specify string to print to stdout following the tags for each file
       Force output of specified tag file format [2].
  --if0=[yes|no]
       Should C code within #if 0 conditional branches be parsed [no]?
       Enable/disable tag kinds for language <LANG>.
       Define a new language to be parsed with regular expressions.
       Override default mapping of language to source file extension.
       Force all files to be interpreted using specified language.
       Restrict files scanned for tags to those mapped to langauges
       specified in the comma-separated 'list'. The list can contain any
       Print details of software license.
       Should #line directives be processed [no]?
       Indicate whether symbolic links should be followed [yes].
       Output a list of all tag kinds for specified language or all.
  --list-maps=[language|all]
       Output list of language mappings.
       Specify file from which command line options should be read.
       Recurse into directories supplied on command line [no].
       Define regular expression for locating tags in specific language.
       Should tags be sorted (optionally ignoring case) [yes]?.
       Should paths be relative to location of tag file [no; yes when -e]?
       Print statistics about source and tag files [no].
       Enable verbose messages describing actions on each source file.
       Print version identifier to standard output.
  -a   Append the tags to an existing tag file.
  -B   Use backward searching patterns (?...?).
  -f <name>
       ["tags"; or "TAGS" when -e supplied].
  -h <list>
       [".h.H.hh.hpp.hxx.h++"].
  -I <list|@file>
       command line or the specified file.
  -L <file>
       If specified as "-", then standard input is read.
  -o   Alternative for -f.
  -V   Equivalent to --verbose.
  --append=[yes|no]
  --etags-include=file
  --exclude=pattern
  --excmd=number|pattern|mix
  --extra=[+|-]flags
  --fields=[+|-]flags
  --file-scope=[yes|no]
       be included in the output [yes]?
  --filter=[yes|no]
       writing tags to standard output [no].
       parsed when --filter is enabled.
  --format=level
  --help
       Print this option summary.
  --<LANG>-kinds=[+|-]kinds
  --langdef=name
  --langmap=map(s)
  --language-force=language
  --languages=[+|-]list
       built-in or user-defined language [all].
  --license
  --line-directives=[yes|no]
  --links=[yes|no]
  --list-kinds=[language|all]
  --list-languages
       Output list of supported languages.
  --options=file
  --recurse=[yes|no]
  --regex-<LANG>=/line_pattern/name_pattern/[flags]
  --sort=[yes|no|foldcase]
  --tag-relative=[yes|no]
  --totals=[yes|no]
  --verbose=[yes|no]
  --version


 

1.3ctags配置:

    下载一个ctags     http://ctags.sourceforge.net/,windows版的,将ctags.exe放到环境变量path中。linux

1.4ctags使用过程:

    1. 在shell中 ctags -R + 工程路径。此时工程里面应该错了一个tags名的文件2. vim中 :set tags = [tagsPath]。3. 如今找个函数而后 ctrl ]  , and then  ctrl  t已经完事了shell


2.tagList:

2.1tagList功能:

    将已经配置好的tags,以分裂窗口的形式出如今vim中。注:必定是ctags命令产生了tags文件后才能够用。里面包括全局变量,宏,typedef,函数,类……express

               

2.2tagList使用方法:

    vim中 :Tlist,  :TlistOpen  :TlistClosevim

2.3tagList配置:

    http://www.vim.org/scripts/script.php?script_id=273下载,没版本,都行。解压后将plugin和doc中的文件分别放在vim安装目录中的doc和plugin中windows

    而后在vimrc中app

if MySys() == "windows"                "设定windows系统中ctags程序的位置
    let Tlist_Ctags_Cmd = 'ctags'
elseif MySys() == "linux"              "设定linux系统中ctags程序的位置
    let Tlist_Ctags_Cmd = '/usr/bin/ctags'
endif
    let Tlist_Show_One_File = 1            "不一样时显示多个文件的tag,只显示当前文件的
    let Tlist_Exit_OnlyWindow = 1          "若是taglist窗口是最后一个窗口,则退出vim
    let Tlist_Use_Left_Window = 1          "在左侧窗口中显示taglist窗口

2.4tagList使用全过程:

    1.安装ctags,以即可以生成工程tags

    2.taglist下载配置

    3.:Tlist

完事了……


3.WinManager:

3.1WinManager功能:

    此插件的做用是将TagList窗口和netrw窗口整合起来  

3.2配置方法:

    http://www.vim.org/scripts/script.php?script_id=159 下一个,解压放到vim74/plugin里面,能够了。

个人vimrc中是这样设置的,参考http://blog.csdn.net/minico/article/details/1938050

"把gui的工具栏去掉(要去掉,把等号前面的加号变成一个减号便可)
set guioptions+=T
"把gui的右边的滑动条去掉
set guioptions+=r
"把gui的左边的滑动条去掉
set guioptions-=L
"把gui的菜单去掉
set guioptions+=m
filetype on
let Tlist_Show_Menu = 1

"经过WinManager插件来将TagList窗口和netrw窗口整合起来
let g:winManagerWindowLayout='FileExplorer|TagList'
nmap wm :WMToggle<cr>

此时按F2就能够出现Tlist了,而后wm就直接WMToggle了。so easy

3.3使用:

    注意必定要先有ctags,Tlist和WinManager都是根据ctags生成的tags文件来生成窗口的。在用ctags生成tags之后再vim中:WMToggle看看粗来了啥?

最上面那行显示*.cpp文件的那个窗口时MiniBufExplore一会介绍,左下是Tlist窗口,左上是Flie list,是 WinManager干的

3.4WinManager使用全过程

1.工程目录下要有已经生成好的tags文件

2.要有Tlist插件

3.配置,而后我都会了


4.MiniBufExplore

就是下载而后放到vim74/plugin中。而后就能够看到你想看的了


5.omnicppcomplete

5.1功能说明:

    这玩意是按tab自动补全的,一样首先都要有tags文件,同事他要配合supertab来实现。我就是用很差,谁有详细的方法请赐教

5.2配置

     下载解压放到vimfile里面的类似路径中,由于加压文件中有doc,ftplugin,autoload……

在vimrc中加入

"打开文件类型检测
filetype plugin indent on
:set nocp


6.supertab

6.1功能说明

    同omnicppcomplete一块儿使用,前提有tags文件!!!

        

    直接下载插件放到plugin中。就能够用了


7.a

7.1功能说明

        搞笑的名字~,能够再.cpp和.h之间闪电转换。

7.2配制方法

        直接下载,将a.vim放到plugin中

如今插件就这么多.....................基本上在网上均可以找到,也是最基本的最实用的了,谁有好的能够告诉,谢谢了

7.3使用

        就是:A,就跳了


8.括号自动补齐

    这个不是插件,是几句vim的脚本........  

                        :inoremap { {}<ESC>i

                        :inoremap [ []<ESC>i

                        :inoremap ( ()<ESC>i

    在vimrc中加上这几句,完了你的vim就能够哈哈了。想要复杂的戳这里

    未完待续...............................

相关文章
相关标签/搜索