This repository has been archived by the owner on Nov 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
185 lines (144 loc) · 3.87 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
"**********************
"" Vim-PLug
"**********************
if has('vim_starting')
set nocompatible " 关闭兼容模式
set wildmenu
set backspace=2 " mac上的删除键位
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
if !filereadable(vimplug_exists)
if !executable("curl")
echoerr "You have to install curl or first install vim-plug yourself!"
execute "q!"
endif
echo "Installing Vim-Plug..."
echo ""
silent !\curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let g:not_finish_vimplug = "yes"
autocmd VimEnter * PlugInstall
endif
" Required:
call plug#begin(expand('~/.vim/plugged'))
"***********************
"" Plug install packages
"***********************
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter' " git历史
Plug 'jiangmiao/auto-pairs' " 自动补全括号
Plug 'majutsushi/tagbar' " 代码组成
Plug 'w0rp/ale' " 语法检测
Plug 'Yggdroot/indentLine' " 对齐线
Plug 'sheerun/vim-polyglot' " 语言集合
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
Plug 'Shougo/vimproc.vim', {'do': 'make'}
Plug 'haya14busa/incsearch.vim' " 高亮搜索内容
Plug 'Valloric/YouCompleteMe', { 'do': 'python3 ./install.py --clang-completer --system-libclang --go-completer --js-completer --rust-completer' }
Plug 'junegunn/vim-easy-align' " 等号对齐
Plug 'luochen1990/rainbow' " 高亮括号
Plug 'ntpeters/vim-better-whitespace' " 去除多余括号
Plug 'scrooloose/nerdcommenter' " 代码注释
Plug 'ryanoasis/vim-devicons' " Vim Dev Icons
" themes
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'morhetz/gruvbox'
" fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
"" Snippets
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
"" Color
Plug 'flazz/vim-colorschemes'
"" editconfig
Plug 'editorconfig/editorconfig-vim'
"" python
Plug 'raimon49/requirements.txt.vim'
Plug 'google/yapf', { 'rtp': 'plugins/vim', 'for': 'python' }
Plug 'fisadev/vim-isort'
"" html
Plug 'mattn/emmet-vim'
Plug 'hail2u/vim-css3-syntax'
Plug 'jelera/vim-javascript-syntax'
" vue
" Plug 'posva/vim-vue'
"" fcitx
Plug 'lilydjwg/fcitx.vim'
"" markdown
Plug 'plasticboy/vim-markdown', {'on_ft' : 'markdown'}
call plug#end()
" *****************************
" vim basic config
" *****************************
" 显示行号
set number
" GUI环境下设置
if has("gui_running")
set guifont=Source\ Code\ Pro\ 15
endif
" 高亮设置
set background=dark
set t_Co=256
set cursorline
" set cursorcolumn
" 文件编码
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set bomb
set binary
" 搜索设置
set hlsearch
set incsearch
set ignorecase
set smartcase
" 目录和缓存
set nobackup
set noswapfile
" 语法设置
syntax on
set ruler
set number
" 使用鼠标
set mouse=a
" 文件类型
set fileformats=unix,dos,mac
" Required:
filetype plugin indent on
" 重新绘制
nnoremap <leader>l :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
" 禁用警报
set noerrorbells
set novisualbell
set t_vb=
" *****************************
" vim config
" *****************************
" <Leader>的设置
let mapleader = "\<Space>"
" YouCompleteMe配置
source $HOME/.vim/config/YouCompleteMe.vim
" ale配置
source $HOME/.vim/config/ale.vim
" 背景颜色配置
set background=dark
colorscheme gruvbox
let g:airline_theme='gruvbox'
" nerdtree配置
source $HOME/.vim/config/nerdtree.vim
" tagbar配置
source $HOME/.vim/config/tagbar.vim
" vim-airline 配置
source $HOME/.vim/config/vim-airline.vim
" 键位映射设置
source $HOME/.vim/config/mapping.vim
" Python配置
source $HOME/.vim/config/python.vim
" html和js的配置
source $HOME/.vim/config/html.vim
" Markdown的配置
source ~/.vim/config/Markdown.vim
" 其他配置
source $HOME/.vim/config/customer.vim