Installation of Vundle under Linux and code jump using Vim

  linux, Vim plug-in

Installation of Vundle under Linux and code jump using Vim

Installation dependency

Vundle is a plug-in manager of vim, and it is also a plug-in of vim, which can search, install, update and clean up plug-ins. Vundle installation requires git and curl support. If you do not have the above two packages, you can download them first.
yum install crul
yum install git

Installing Vundle

First download the required files

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Modify~/.vimrcFile, if you are not root, please modify the.vimrcFile, such as user name is bar, please modify/home/bar/.vimrcDocuments, no.vimrcThe file is created.

Append the following text to.vimrcIn the file

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}

" 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          - list configured plugins
" :PluginInstall(!)    - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!)      - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

Install plug-ins with Vundle in two ways

1. Open vim and enter

​ :PluginInstall

Vundle will be automatically installed in the configuration file.call vundle#begin()Andcall vundle#end()The plug-in recorded between will be displayed after the installation is completed.done. The process may take a little time.

2. Install from the command line

At the command line, enter:vim +PluginInstall +qall, wait for a period of time until it is displayeddone

Use the code jump function

Open the source code file with vim, place the cursor on the function to be viewed,Ctrl+]You can jump.Ctrl+tCan return, if there are multiple jump options, press the number keys to select which one to jump to.

Vundle other commands, fromVundle.com

 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

Problems encountered after installation

  1. E492: Not an editor command:XXX。 For example, the following

Error detected while processing /root/.vimrc:
line 14:
E492: Not an editor command: Plugin ‘VundleVim/Vundle.vim’
line 19:
E492: Not an editor command: Plugin ‘tpope/vim-fugitive’
line 23:
E492: Not an editor command: Plugin ‘git://git.wincent.com/command-t.git’
line 28:
E492: Not an editor command: Plugin ‘rstacruz/sparkup’, {‘rtp’: ‘vim/’}
Press ENTER or type command to continue

This may be the case with commandsviThis is because vi is not vim and is read when vi is used.$HOME/.vimrcConfiguration files can be resolved by setting aliases.

alias vi=vim

It is also possible that you directly copied the configuration files on windows$HOME/.vimrcTo linux, the newline character in windows is /r/n, and the newline character in linux is /n. Therefore, the configuration file should be changed$HOME/.vimrc
Reference link:
https://stackoverflow.com/questions/24185580/vundle-e492-not-an-editor-command-plugininstall
https://segmentfault.com/a/1190000003795535? utm_source=tag-newest

Vundle website:https://github.com/VundleVim/Vundle.vim
References:https://www.jianshu.com/p/1839f1fb3f08