Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

Linux Vim 外掛管理器 NeoBundle 安裝與配置完整指南

編輯:關於 Linux

NeoBundle 是基於 Vundle 改良的 Vim 外掛管理器,支援 Git、Subversion、Mercurial 多種版控來源,可鎖定外掛版本避免自動更新破壞環境,但官方標示尚不穩定,生產環境建議優先考慮 Vundle 或 vim-plug。

安裝 NeoBundle

# 需求:Vim 7.2.051+、git、curl
curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
# 自動下載至 ~/.vim/bundle/neobundle.vim/

最小 .vimrc 配置

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()
endif

filetype plugin indent on

安裝第三方外掛 (以 vim-abolish 為例)

# 手動下載
curl -k https://github.com/tpope/vim-abolish > ~/.vim/bundle/abolish

# 註冊自動更新 (加在 NeoBundleFetch 之後)
NeoBundle 'tpope/vim-abolish'

# 鎖定特定版本 (避免破壞性更新)
NeoBundle 'Shougo/vimshell', { 'rev': '3787e5' }

常用管理指令 (在 Vim 命令模式下)

指令功能
:NeoBundleInstall安裝/更新所有已註冊外掛
:NeoBundleUpdate同 Install,並重新安裝被手動刪除的外掛
:NeoBundleList列出未初始化的外掛
:NeoBundleClean互動式刪除未註冊的外掛目錄
:NeoBundleCheck檢查缺漏外掛並提示安裝

NeoBundle 介面

遷移建議: 若追求穩定,請改用 vim-plug (並行安裝、極簡配置、支援鎖版) 或 Vundle (成熟穩定、純 Git)。NeoBundle 適合願意嘗試新功能、需 SVN/Hg 支援的進階使用者。
Copyright © Windows教程網 All Rights Reserved