Linux how to install and use NeoBundle

  

Linux system To use the Vim editor, you must install the Vim plugin, (Vim plugin installation can refer to the system home Ubuntu install vim plugin steps), and timely management Vim plugin is very It is necessary, and NeoBundle can manage the Vim plugin. The following small series will introduce you to the method of using NeoBundle for Linux installation.

Why do we use the Plugin Manager? Vim supports a large number of plugins, but since it does not strictly define the framework, the plugin files can be distributed in different directories, which makes it difficult for users to manage them (LCTT: Of course, if you have a lot of plugins, there is a little obsessive-compulsive disorder). I feel that these plugins will be comfortable in my mind.) And a plugin manager makes management a lot easier. Pathogen, Vundle and NeoBundle work to create a directory for different plugins and then throw those directories into the ~/.vim/bundle directory. This file sorting method allows you to easily and completely remove the plugin, use ‘rm -rf "plugin directory" & rsquo; or directly delete the directory where the plugin is located in the file manager, absolutely no green residue. At the same time, this approach also minimizes incompatibilities between plugins and plugins.

NeoBundle is a project based Vundle as Vundle, they can install and upgrade plug-ins. However, NeoBundle's documentation clearly states: “NeoBundle is not a stable plugin manager. If you want a stable one, please choose Vundle”. There is also a warning on the latest release-note. "This may cause compatibility issues" —— This is a note written by the developer that the manager is not yet safe to use.

So why do we use NeoBundle? It does not guarantee stable operation! Ok, it still has merit. Vundle only supports Git, a version control system, and NeoBundle supports Subversion and Mercurial. Another reason is that if you don't want to crash your Vim ecosystem when the plugin is upgraded, you can lock the NeoBundle to use only a fixed version of a plugin.

In addition, the NeoBundle creator, Shougo Matsuishita (LCTT: name looks like Japanese), is adding its command interface to other plug-in projects to reduce their command usage. NeoBundle now supports three plugins: unite.vim, the file and cache manager used by Vim, vimshell.vim, the script used by Vim, and vimproc.vim, which is run in vimshell.vim for support for asynchronous events. All of the above are special cases, lacking English documentation, so users hope someone can perfect them. Before we can use them officially, we need to focus our attention on some basic operations.

Installing and Initializing NeoBundle

NeoBundle supports Vim 7.2.051 or higher and requires git and cURL (for downloading files). You can either download NeoBundle manually or use cURL to download its library on GitHub. Use the following command in your home directory to download the NeoBundle plugin to the .vim/bundle/neobundle.vim directory, and NeoBundle can manage it yourself.

curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh |  Sh

You also need to modify the .vimrc file. NeoBundle's GitHub home page provides a .vimrc template, but using this template directly, NeoBundle requires you to install 5 possible plugins. If you don't need them, you can use the following minimum configuration:

if has(‘vim_starting’)

set nocompatible

set runtimepath+=~/.vim/bundle /neobundle.vim/

call neobundle#begin(expand(‘~/.vim/bundle/’))

NeoBundleFetch‘Shougo/neobundle.vim’

call neobundle#end()

filetype plugin indent on

The above configuration is useful for starting NeoBundle and upgrading itself like other plugins. NeoBundle is downloaded and upgraded by default from GitHub. If you happen to be using GitHub, you only need to specify the maintainer's username and path for this plugin. In the above configuration, NeoBundleFetch only needs to be specified as “Shougo/neobundle.vim” instead of the full GitHub path. If you want to use a different website, such as a Subversion or Mecurial website, you will need to add the full URL.

If you want to install other plugins, you can use the following command:

curl -k https://github.com/[project maintainer]/[plugin path] ~~/.vim/bundle/[plugin path]

For example: if you want to install vim-abolish, a super NB text search and replace plugin, use the following command:

curl - k https://github.com/tpope/vim-abolish 》 ~/.vim/bundle/abolish

If you want to auto-upgrade it, add a line below the line NeoBundleFetch:

NeoBundle‘tpope/vim-abolish’

Introduce a little trick: you can specify a branch or version number for the plugin. What do you mean? NeoBundle will only use one branch or version of this plugin, ignoring its version update. If you are using a plugin that is in a high-speed development process, you can use this technique to avoid using buggy plugin versions. For example:

NeoBundle‘Shougo/vimshell’,{‘rev’:‘3787e5’}

Another trick: add a line to the .vimtc file about “NeoBundleCheck&rdquo ; the attribute. NeoBundle checks for plugins that are not installed based on the configuration and prompts you to install them. You can also install or upgrade the plugin using the command <;NeoBundleInstall" (LCTT: This is to be entered in the Vim editor's command mode).

NeoBundle Usage

Many NeoBundle commands work like Vundles, but the names of commands are different. Here's how to use the NeoBundle command:

:NeoBundleUpdate: Install or upgrade the plugin. If you manually delete the directory of a plugin, this command will reinstall the plugin. Adding a plugin name after this command will only upgrade one plugin; without any arguments, all plugins that are installed but not documented will be recorded. The :NeoBundleInstall command has the same effect.

:NeoBundle {REPOSITORY URI} [[REVISION}] [,OPTIONS}]]: Lock a plugin to a fixed version to prevent random upgrades.

:NeoBundleList: Lists all uninitialized plugins.

:NeoBundleClean: Enter the interactive interface and delete the plugin.

These commands work slightly differently when used with unite.vim (LCTT: one of the 32 examples mentioned above). You can use the “:help neobundle” command for more information.

Whether to use NeoBundle, decide for yourself

NeoBundle is a powerful tool and is in high-speed development. Any project in this state will be labeled "Promising" and "Unstable", see how you choose. If you want the latest stable version of the plugin, NeoBundle can take Vundle and Pathogen out a few streets.

However, the online help documentation has given a warning that it is not a stable product. Failure to update the version in time may cause some plug-ins to run incorrectly. Finally, you need to specify a stable version of your Neoundle and other plugins in the .vimrc file. Remember this warning, and then you can use these cutting-edge technology products with ease.

The above is a description of the Linux installation using NeoBundle, but NeoBundle is not stable enough at present, there are some problems, so there may be some problems when using NeoBundle.

Copyright © Windows knowledge All Rights Reserved