-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
90 lines (76 loc) · 3.04 KB
/
.vimrc
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
" 设置通用缩进策略
set shiftwidth=4
set tabstop=4
"配色显示
colorscheme molokai
set guifont=Hack:h14
set backspace=2 " 设置退格键可用
set autoindent " 自动对齐
set ai! " 设置自动缩进
set smartindent " 智能自动缩进
" set relativenumber " 开启相对行号
set nu! " 显示行号
set ruler " 右下角显示光标位置的状态行
set incsearch " 开启实时搜索功能
set hlsearch " 开启高亮显示结果
set nowrapscan " 搜索到文件两端时不重新搜索
set nocompatible " 关闭兼容模式
set hidden " 允许在有未保存的修改时切换缓冲区
set autochdir " 设定文件浏览器目录为当前目录
set foldmethod=indent " 选择代码折叠类型
set foldlevel=100 " 禁止自动折叠
set laststatus=2 " 开启状态栏信息
syntax enable " 打开语法高亮
syntax on " 开启文件类型侦测
" 设定文件编码格式
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set fileencoding=utf-8
set encoding=utf-8
" vundle
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'pangloss/vim-javascript'
Plugin 'plasticboy/vim-markdown'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 'elzr/vim-json'
Plugin 'markcornick/vim-vagrant'
Plugin 'fatih/vim-go'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'raimondi/delimitmate'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'maksimr/vim-jsbeautify'
Plugin 'vim-airline/vim-airline'
Plugin 'simon-xia/vim-qlang'
Plugin 'cespare/vim-toml'
Plugin 'kien/ctrlp.vim'
call vundle#end()
filetype plugin indent on
" for tools
map <c-n><c-t> :NERDTreeToggle<cr>
map <c-t><c-t> :TagbarToggle<cr>
" for golang
autocmd FileType go noremap <buffer> <c-g><c-b> :GoBuild<cr>
autocmd FileType go noremap <buffer> <c-g><c-h> :GoDoc<cr>
autocmd FileType go noremap <buffer> <c-g><c-p> :GoDefPop<cr>
autocmd FileType go noremap <buffer> <c-g><c-d> :GoDef<cr>
autocmd FileType go noremap <buffer> <c-g><c-i> :GoImports<cr>
autocmd FileType go noremap <buffer> <c-g><c-r> :GoReferrers<cr>
autocmd FileType go noremap <buffer> <c-g><c-m> :GoMetaLinter<cr>
autocmd FileType go noremap <buffer> <c-g><c-v> :GoVet<cr>
autocmd FileType go noremap <buffer> <c-g><c-l> :GoLint<cr>
" for javascript
autocmd FileType javascript noremap <buffer> <c-j><c-f> :call JsBeautify()<cr>
" for json
autocmd FileType json noremap <buffer> <c-j><c-f> :call JsonBeautify()<cr>
" for jsx
autocmd FileType jsx noremap <buffer> <c-j><c-f> :call JsxBeautify()<cr>
" for html
autocmd FileType html noremap <buffer> <c-j><c-f> :call HtmlBeautify()<cr>
" for css or scss
autocmd FileType css noremap <buffer> <c-j><c-f> :call CSSBeautify()<cr>