VIM 环境快速配置(Windows)

vim基础环境安装

  1. 安装gvim
    默认VIM目录结构:
\vim
        \vim\vim74
        \vim\vimfiles (预留给用户的文件存放目录,建议后删除自定义)
        _vimrc(vim第一加载的用户配置文件)

为实现绿化,建议所有配置都在\vim\_vimrc设置。几个好处:1 重装系统不影响使用。2 对应$MYVIMRC变量,可以通过该变量访问配置文件。

  1. 安装git(内置msysGit),安装过程选择“Use Git from the Windows Command Prompt”
  2. 在git安装目录下创建curl.cmd,路径C:\Program Files\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 %*

4.运行curl --version检验curl配置情况

> curl --versioncurl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 
OpenSSL/0.9.8k zlib/1.2.3Protocols: dict file ftp ftps http https
imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL SSPI libz

插件安装

  1. 安装vim-plug 插件管理器 Github vim-plug
    下载vim-plug.vim到vim安装目录\vim\vim74\autoload下,autoload目录下的文件将会在被调用时自动加载。

  2. 增加如下内容到_vimrc

    call plug#begin('$VIM/ray/plugin')
    Plug 'bling/vim-airline'
    call plug#end()

_vimrc中的call plug#begin会自动调用vim-plug.vim功能,其中'$VIM/ray/plugin'用于指定安装plugin到哪个目录。参考: Github vim-plug FAQ

  1. 使用:PlugInstall命令安装插件

在用的Plugin:
1. vim-airline


参考信息

1. Win7下安装配置gVim

你可能感兴趣的:(VIM 环境快速配置(Windows))