1 Install full version vim
sudo apt-get install vim
2 Configuration of vim
The default folder and file is not exist. So we create them first.
mkdir ~/.vim/
vi ~/.vimrc
copy following codes to .vimrc file
syn on "语法支持
"common conf {{ 通用配置
set ai "自动缩进
set bs=2 "在insert模式下用退格键删除
set showmatch "代码匹配
set laststatus=2 "总是显示状态行
set expandtab "以下三个配置配合使用,设置tab和缩进空格数
set shiftwidth=4
set tabstop=4
set cursorline "为光标所在行加下划线
set number "显示行号
set autoread "文件在Vim之外修改过,自动重新读入
set ignorecase "检索时忽略大小写
set fileencodings=uft-8,gbk "使用utf-8或gbk打开文件
set hls "检索时高亮显示匹配项
set helplang=cn "帮助系统设置为中文
set foldmethod=syntax "代码折叠
"}}
"conf for tabs, 为标签页进行的配置,通过ctrl h/l切换标签等
let mapleader = ','
nnoremap <C-l> gt
nnoremap <C-h> gT
nnoremap <leader>t : tabe<CR>
"conf for plugins {{ 插件相关的配置
"状态栏的配置
"powerline{
set guifont=PowerlineSymbols\ for\ Powerline
set nocompatible
set t_Co=256
let g:Powerline_symbols = 'fancy'
"}
"pathogen是Vim用来管理插件的插件
"pathogen{
call pathogen#infect()
"}
"}}
3 install pathogen plugin
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
if not found curl command, just install it.
sudo apt-get install curl
add the following commands to .vimrc file:
execute pathogen#infect()
syntax on
filetype plugin indent on
4 install NERDTree plugin
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git
5 install powerline plugin
pip install git+git://github.com/Lokaltog/powerline
If pip command not found, please execute:
sudo apt-get install python-pip
add the following codes to .vimrc file
"powerline{
set guifont=PowerlineSymbols\ for\ Powerline
set nocompatible
set t_Co=256
let g:Powerline_symbols = 'fancy'
"}