对神器Vim的简易配置。


1、新建vim的相关文件夹

1
2
3
4
5
mkdir ~/.vim
cd ~/.vim
mkdir .backup
mkdir .swp
mkdir .undo

2、写入配置文件

1
vim ~/.vimrc

3、Vim详细配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
" BASIC
set nocompatible
syntax on
set showmode
set showcmd
set mouse=a
set encoding=utf-8
set t_Co=256
filetype indent on

" INDENT
set autoindent
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4

" APPEARANCE
set number
set cursorline
set textwidth=120
set wrap
set laststatus=2
set ruler

" SEARCH
set showmatch
set hlsearch
set incsearch
set ignorecase

" EDIT
set undofile
set backupdir=~/.vim/.backup//
set directory=~/.vim/.swp//
set undodir=~/.vim/.undo//
set history=1000
set autoread
set listchars=tab:»■,trail:■
set list
set wildmenu
set wildmode=longest:list,full

每一行配置的详细解析请参考:https://github.com/lz-wang/MyConfigs/blob/master/vim/.vimrc_CN