1. 程式人生 > >編輯vimrc文件需要安裝bundle插件問題

編輯vimrc文件需要安裝bundle插件問題

yum源 vimrc Vundle

版本信息:
uname -a
Linux localhost.localdomain 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/issue
Red Hat Enterprise Linux Server release 6.1 (Santiago)
Kernel \r on an \m

  1. 在網上找了一些~/.vimrc文件,寫入~/.vimrc文件,用source ~./.vimrc生效。
    再通過vim編輯時會提示錯誤
    Error detected while processing /root/.vimrc:

    line 9:
    E492: Not an editor command: Plugin ‘VundleVim/Vundle.vim‘
    line 13:
    E492: Not an editor command: Plugin ‘tpope/vim-fugitive‘
    line 17:
    E492: Not an editor command: Plugin ‘git://git.wincent.com/command-t.git‘
    line 20:
    E492: Not an editor command: Plugin ‘file:///home/gmarik/path/to/plugin‘
    line 26:
    E492: Not an editor command: Plugin ‘rstacruz/sparkup‘, {‘rtp‘: ‘vim/‘}

  2. 查到是需要安裝Vundle的插件:
    安裝Vundle命令:
    #git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    報錯沒裝git,繼續安裝git

  3. 用yum提示搜索不到軟件git,安裝其他軟件也一樣。在網上查知需要配置yum源,於是找了RHEL6 配置yum源的方法:
    a. 刪除本地已安裝的yum
    #rpm -aq|grep yum|xargs rpm -e --nodeps
    b. 下載了相應rpm包
    python-iniparse-0.3.1-2.1.el6.noarch.rpm
    python-urlgrabber-3.9.1-11.el6.noarch.rpm
    yum-3.2.29-81.el6.centos.noarch.rpm
    yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
    yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
    rpm包是在163鏡像上下載:
    http://mirrors.163.com/centos/6/os/x86_64/Packages/
    命令:#wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
    其他類似
    c.安裝下載的rpm包
    #rpm -Uvh python-urlgrabber-3.9.1-11.el6.noarch.rpm #更新
    #rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
    d. 配置yum源
    cp /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.bak
    [base]

name=CentOS-$releasever - Base

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#packages used/produced in the build but not released

#[addons]

#name=CentOS-$releasever - Addons

#baseurl=http://mirrors.163.com/centos/6/addons/$basearch/

#gpgcheck=1

#gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=http://mirrors.163.com/centos/6./centosplus/$basearch/

gpgcheck=1

enabled=0

source /etc/yum.repos.d/rhel-source.repo 不知道有沒有用
yum及源就已經安裝並配置好了

  1. 用yum安裝git,
    #yum install git
    #git --version
    後面報錯又發現還需要安裝curl和curl-devel
    安裝curl和curl-devel後,用yum成功安裝上了git,對一個新手來說不容易呀

  2. 安裝vim的bundle插件
    #git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

  3. vim沒有報錯,能夠正常識別,完成!

感謝網上的資料~

編輯vimrc文件需要安裝bundle插件問題