forked from mudclient/paotin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
74 lines (61 loc) · 1.46 KB
/
init.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
silent! call plug#begin()
Plug 'dzpao/vim-mbs'
Plug 'morhetz/gruvbox'
Plug 'yegappan/mru'
Plug 'jlanzarotta/BufExplorer'
call plug#end()
" 不兼容 vi
set nocompatible
" 用空格代替 TAB
set expandtab
" 整体左移或者右移时,每次 4 个空格
set shiftwidth=4
" TAB 键按 4 空格对齐
set tabstop=4
set softtabstop=4
set smarttab
" 开启智能缩进
set smartindent
" 智能缩进开启时,不让 # 删除自动缩进。
inoremap # X#<LEFT><C-H><RIGHT>
" 开启真彩色
set termguicolors
" 开启真彩色配色方案
colorscheme gruvbox
highlight Normal guibg=#1d2021
" 显示行号
set number
" 显示相对行号
set relativenumber
" 显示光棒
set cursorline
" 80 列高亮,提醒边界线
set colorcolumn=80
" 文件写入成功后,不保留备份文件
set nobackup
" 直接写原文件,不先建立备份
set nowritebackup
" 不要交换文件
set noswapfile
" 开启鼠标支持
set mouse=nvi
" 开启自动缩进
set cindent
" 自动识别文件编码
set fileencodings=utf8,gbk
" 始终用 utf8 显示
set encoding=utf8
" 开启 modeline 支持
set modeline
" F 开启 Buffer Explorer
nmap F :BufExplorer<CR>
nnoremap <silent> ,F F
nnoremap <silent> ,f F
autocmd BufEnter \[BufExplorer\] nmap <buffer><silent> F q
" M 开启/关闭 MRU
nmap <silent> M :MRU<CR>
nnoremap <silent> ,M M
autocmd BufEnter __MRU_Files__ nnoremap <buffer><silent> M :q<CR>
autocmd BufEnter -RecentFiles- nnoremap <buffer><silent> M :q<CR>
nmap <C-N> gt
nmap <C-P> gT