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就能夠哈哈了。想要複雜的戳這裏

    未完待續...............................

相關文章
相關標籤/搜索