这是我在博客园的第二篇文章,今晚是在线的特殊日子,应小编的要求不想多讲,喝了点酒,感觉到压力和挑战性,抽了几根烟,现在有点飘飘欲仙的感觉。在长江大学11教的6楼,是长大在线的办公室,这个晚上总是不关灯的办公室前面是荆州古城墙,后面是浪花淘尽多少风流人物的长江,还有大堤和南方。
之前提到过git for windows可以解决gvim插件安装繁琐的问题。
1、装git
在D:\Git\cmd下运行cmd输入git --version回车显示git版本号则表示安装成功。
2、写curl脚本
windows下需要这个脚本和Vundle插件管理器进行连接。
在D:\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;%git_install_root%\mingw64\bin;%PATH%
@rem !!!!!!! For 64bit msysgit, replace 'mingw' above with 'mingw64' !!!!!!!
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@curl.exe %*
保存后运行cmd,输入curl --version回车显示版本信息则表示安装成功。(网上的脚本代码有一些是不完整的,最后到这个插件的github仓库才发现问题所在)
3、安装Vundle插件管理器(我这个是新版的,还有个旧版别搞混了)
git clone https://github.com/VundleVim/Vundle.vim.git D:Vim/vimfiles/bundle/Vundle.vim
4、配置Vundle
在_vimrc中写入:
" vundle 环境设置
set nocompatible " be iMproved, required
filetype off
set rtp+=$VIM/vimfiles/bundle/Vundle.vim
" vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间
call vundle#begin('$VIM/vimfiles/bundle')
E484: Can't open file C:\Users\<userid>\AppData\Local\Temp\... Error
我的解决办法是修改系统的temp和tmp环境变量,具体可以参考:https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows
6、打开gvim进入normal状态执行:PluginInstall,我们的buffer美化插件vim-airline就安装上了
7、给系统添加vim-airline的字体https://github.com/eugeii/consolas-powerline-vim
8、vim-airline配置,在_vimrc中写入:
"显示光标的坐标
set ruler
"高亮整行
set cursorline
"自动缩进
set noautoindent
set cindent
set smartindent
"Tab键的宽度
set shiftwidth=4
set tabstop=4
"设置buffer的主题
let g:airline_theme='solarized'
set laststatus=2 "永远显示状态栏
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
"设置为双字宽显示,否则无法完整显示如:☆
set ambiwidth=double
set encoding=utf-8
set laststatus=2
set bs=2
set guifont=Courier_New:h12:cANSI
set rop=type:directx
let symbols={'maxlinenr': "\u33d1", 'linenr':"\u2630" }
let &stl='%f %{g:symbols.linenr}%2l/%L%{g:symbols.maxlinenr}'