跳至主要內容

Vim 使用入门

Someone小于 1 分钟Toolsvim

reference

NAMEURLDES
VundleVimhttps://github.com/VundleVim/Vundle.vimopen in new windowVim plugin manager
alehttps://github.com/w0rp/aleopen in new window
vim-airlinehttps://github.com/vim-airline/vim-airlineopen in new window

Plugin Manager

Vundleopen in new window is short for Vim bundle and is a Vimopen in new window plugin manager.

mkdir ~/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim ~/.vimrc

In .vimrc, this is my config:

set nocompatible
filetype off

set ts=4
set expandtab

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'https://github.com/Valloric/YouCompleteMe.git'
Bundle 'luochen1990/rainbow'
let g:rainbow_active = 1
Plugin 'w0rp/ale'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
filetype plugin indent on

Then build:

vim +PluginInstall +qall

# options: PluginClean, PluginUpdate, PluginList

Other useful settings:

set nu!
set autoindent #自动对齐
syntax on