Gvim install Vundle/Ctags/taglist in Windows environment

table of Contents

One, install Vundle for Windows

1. Install Git

2. Install Curl

3. Install Vundle

Two, ctags download and installation

1. Generate Tag file

2. A quick glance at the code

Three, Taglist download and installation  

1. Set tagslist in _vimrc

2. Configuration and use of taglist

Fourth, download from the network disk: including: gvim81, ctags, taglist, git


One, install Vundle for Windows

1. Install Git

1 download Git for Windows installer

2 To configure the PATH so that the git program can be used anywhere

3Check if the installation is in place by command

2. Install Curl

Extension: cURL is a file transfer tool that uses URL syntax to work under the command line . It was first released in 1997. It supports file upload and download, so it is a comprehensive transmission tool, but traditionally, it is customary to call cURL a download tool. CURL also includes libcurl for program development.

The communication protocols supported by cURL are FTP , FTPS , HTTP , HTTPS , TFTP , SFTP , Gopher , SCP , Telnet , DICT, FILE , LDAP , LDAPS, IMAP , POP3 , SMTP and RTSP .

curl also supports SSL authentication, HTTP POST, HTTP PUT, FTP upload, HTTP form based upload, proxies, HTTP/2, cookies, username + password authentication (Basic, Plain, Digest, CRAM-MD5, NTLM, Negotiate and Kerberos) , File transfer resume, proxy tunneling

 Win10 system comes with Curl , check it, as shown below

3. Install Vundle

Description: Gvim ON Windows with configuration files _vimrcinstead of .vimrc,用 vimfiles目录instead of.vim目录。 

1 Configure the $VIM environment variable, such as $VIM = d:\Vim81 

2 Run the following command to copy Vundle from github

git clone https://github.com/VundleVim/Vundle.vim.git $VIM/vimfiles/bundle/Vundle.vim,

3 Configure _vimrc file

filetype off
set nocompatible 
set rtp+=$VIM/vimfiles/bundle/Vundle.vim
call vundle#begin('$VIM/vimfiles/bundle')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Bundle 'taglist.vim'  

" All of your Plugins must be added before the following line
"
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

Two, ctags download and installation

This installation is very simple. Download the windows version ctags58.zip at http://ctags.sourceforge.net/ , but the official website is too slow. You can download various downloads in CSDN
and unzip it, and add the path where the .exe is located in the Path You can, or just put it under $VIM/Vim81 and gvim.exe together, so that you can avoid configuring PATH.

After the installation is complete, use ":ctags -R" to generate tags files in the directory. Record index
ctag is a tool that is specially used to generate tags files (under the original file directory), which can be understood as making various tags for source files The tool file, generated tags file has the ability to cross-view, and taglist can be understood as a Vim plug-in that further facilitates the use of tags file, so if you don't install taglist, you can view it with Vim itself.

1. Generate Tag file

Command: - cyclic generator subdirectories tags function c ++ declaration ctags record file and various external declarations and forward ctags required information described, where i represents if inheritance, the identified parent class; if the element is a class A represents For members, indicate their calling authority (that is, public or private); S means that if it is a function, it identifies the signature of the function. It is mandatory for ctags to do the following operations-if a syntax element is a member of a class, ctags will record a line for it by default, and you can ask ctags to record another line for the same syntax element, so as to ensure that multiple functions with the same name in VIM can pass Different paths to distinguish.ctags -R –c++-kinds=+px –fields=+iaS –extra=+q
R:ctags
–c++-kinds=+px
–fields=+iaS
–extra=+q

2. A quick glance at the code

  • Ctrl +] Find the label definition at the cursor position, which is equivalent to finding the definition
  • Ctrl + T returns to the identifier before the jump. Here you can only jump back to "one step", so you can only switch back and forth between the current identifier and the identifier of the previous step.
  • Ctrl + O Note that this is the letter "O". The difference between this command and the above command is that you can trace the identifier all the way up
  • Ctrl + [l finds the global identifier. Vim will list the matching lines it finds, not only in the current file, but also in all included files.
  • Ctrl + [i Find the first position that contains the identifier pointed to by the cursor from the beginning of the current file
  • Ctrl + i] is similar to the above [i, but here is to search down from the current position of the cursor. This command is quite commonly used
  • [{ }] [( )] [/ /] Putting these commands together, the first is [ ] This is similar to a block positioning command. Its function is to locate the two ends of the block where the cursor is currently located. { } Represents the block {} where the cursor is to be located, ( ) represents the block ( ) where the cursor is located, / jumps to both ends of the comment block where the cursor is located, only for /*.. ..*/ Style comments are valid
  • { Jump to the previous blank line
  • } Jump to the next blank line
  • gd jump to the definition of the identifier under the cursor
  • * Go to the next occurrence of the identifier pointed to by the current cursor.
  • # Go to the place indicated by the cursor on the identifier of the first occurrence of the current.

Three, Taglist download and installation  

Taglist is a plug-in for vim that provides a structured view of source code symbols.

         1) Download the installation package from http://www.vim.org/scripts/script.php?script_id=273 , or download it from http://vim-taglist.sourceforge.net/index.html .

        2) Enter the $VIM/vimfile directory, decompress the Taglist installation package, and copy the decompressed plugin and doc directories to the $VIM/vimfile directory.

        3) Run the "help tags" command under Vim to view the taglist help.

1. Set tagslist in _vimrc

"Let the taglist window appear on the left side of Vim.
let Tlist_Use_Left_Window = 1 
"When displaying tags in multiple files at the same time, set it to 1, to make the taglist only display the current file tags, and the tags of other files are folded.
let Tlist_File_Fold_Auto_Close = 1 
"Only display tags in one file, the default is to display multiple
let Tlist_Show_One_File = 1 
"Tag sorting rules, sort by name. The default is to sort in the order in which it appears in the file.
Let Tlist_Sort_Type ='name' 
"When the Taglist window is opened, it will immediately switch to the focused state.
Let Tlist_GainFocus_On_ToggleOpen = 1 
"If the taglist window is the last window, exit vim
let Tlist_Exit_OnlyWindow = 1 
"Settings The window width is 32. You can set
let Tlist_WinWidth = 32 to 
set the position of ctags according to your preference , because the path
let Tlist_Ctags_Cmd ='ctags' has been set in the front,
"Hot key setting, I set it to Leader+t to call out and close the Taglist
map <F2> :TlistToggle<CR>

2. Configuration and use of taglist

Taglist depends on ctags, so you need to install ctags and generate tag files before you can use taglist. If it is not set to automatically open taglist when vim starts, you can

  • Use " :TlistToggle " to switch between on and off
  • Use " :TlistOpen " to open the taglist window and ":TlistClose" to close the taglist window.
  • Use " ctrl+w+w " to switch between the normal editing area and the tags area
  • Locate the specified content in the tags area, move the cursor to the variable or function name, and press Enter (or double-click a tag), it will automatically locate the specified content in the normal editing area.

  • 回车 Jump to the position defined by the tag under the cursor, and double-click the tag with the mouse to have the same function

  • o Display the tag under the cursor in a newly opened window
  • 空格 (Space) Display the prototype definition of the tag under the cursor
  • u Update the tag in the taglist window
  • s Change the sorting method, switch between sorting by name and sorting by appearance order
  • x The taglist window is zoomed in and out for easy viewing of longer tags
  • + Open a fold, same as zo
  • - Fold the tag, same as zc
  • * Open all folds, same as zR
  • = Fold all tags together, same as zM
  • [[ Skip to the previous file
  • ]] Skip to the next file
  • q Close the taglist window

Fourth, download from the network disk: including: gvim81, ctags, taglist, git

Link: https://pan.baidu.com/s/1KgbJ7QGlaK0gYmqncqwl1A
Extraction code: 8dix 
 

Guess you like

Origin blog.csdn.net/miracle_eicont/article/details/112857805