歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux管理 >> Linux維護 >> Linux系統vim如何安裝vundle組件

Linux系統vim如何安裝vundle組件

日期:2017/3/2 10:27:49   编辑:Linux維護

Linux系統下使用vim文本編輯器的時候,需要用到vundle組件,那麼vundle組件要如何安裝呢?想必不少用戶遇到這樣的難題,下面小編就給大家介紹下Linux系統vim安裝vundle組件的方法。

一、在Linux上安裝git。

二、設置 curl命令工具。

Curl已經在安裝git時就帶上了,接下來需要的是稍稍配置下使得它能在命令提示符中使用。

找到git的安裝目錄,然後進入cmd目錄,新建一個名為curl.cmd的文件,內容如下:

@rem Do not use “echo off” to not affect any child calls.

@setlocal

@rem Get the abolute path to the parent directory, which is assumed to be the

@rem Git installation root.

@for /F “delims=” %%I in (“%~dp0.。”) do @set git_install_root=%%~fI

@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%

@if not exist “%HOME%” @set HOME=%HOMEDRIVE%%HOMEPATH%

@if not exist “%HOME%” @set HOME=%USERPROFILE%

@curl.exe %*

在命令提示符中輸入 curl –version來驗證下curl是否可用了。

三、切換到用戶主目錄,運行:

git clone https://github.com/gmarik/vundle.git .vim/bundle/vundle

四、在用戶主目錄下新建一個名為 .vimrc的文件,我的文件內容如下:

set nu

set fileencoding=utf-8

set fileencodings=utf-8,gb18030,gb2312,gbk,big5

set ts=4

set expandtab

set autoindent

set nocompatible

set syntax=on

filetype off “ required!

set rtp+=~/.vim/bundle/vundle/

call vundle#rc()

” let Vundle manage Vundle

“ required!

Bundle ‘gmarik/vundle’

Bundle ‘mattn/emmet-vim’

Bundle ‘Auto-Pairs’

Bundle ‘php-doc’

Bundle ‘PHPDoc-Script-PDocS’

let g:user_emmet_expandabbr_key = ‘《Tab》’

let g:user_emmet_settings = {‘indentation’: ‘ ’}

filetype plugin indent on ” required!

五、Vundle的安裝完畢。

要使用Vundle,可以在上面創建的 _vimrc中添加 Bundle ‘bundle_name’。然後打開vim,運行Vundle相關的命令來執行:

安裝插件: :BundleInstall

更新插件: :BundleInstall!

卸載插件: :BundleClean

至於有什麼樣的插件可以添加,可以到vim-scripts.org查找。除此之外,還可以添加git管理的repo(包括GitHub上的,不在GitHub上的,以及本地repo)。

上面就是Linux安裝vundle組件的方法介紹了,在安裝vundle組件前,需要先在Linux上安裝git,否則安裝不一定成功。

Copyright © Linux教程網 All Rights Reserved