Linux系统vim如何安装vundle组件

Linux系统vim如何安装vundle组件,第1张

Linux系统vim如何安装vundle组件

  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%mingwbin;%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,否则安装不一定成功。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5594459.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存