-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
174 lines (141 loc) · 4.23 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
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
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
" 中文乱码
set encoding=utf-8
set fileencodings=utf-8,chinese,gbk,latin-1,gb2312,ucs-bom,cp936
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
""""""""""""""""""""""VUNDLE PLUGIN""""""""""""""""""""
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'L9'
Plugin 'danro/rename.vim'
Plugin 'pbrisbin/vim-mkdir'
Plugin 'kien/ctrlp.vim'
Plugin 'bling/vim-airline'
Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'tComment'
Plugin 'scrooloose/syntastic'
Plugin 'snipMate'
Plugin 'elzr/vim-json'
Plugin 'mattn/emmet-vim'
Plugin 'davidhalter/jedi-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
filetype plugin on
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
""""""""""""""""""""""VIM CONFIG""""""""""""""""""""
" 自动语法高亮
syntax on
syntax enable
" 设置tab键为4个空格
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
set expandtab
" 缩进
set autoindent
set smartindent
" 设置匹配模式,如括号等
set showmatch
" 自动切换当前目录为当前文件所在的目录
set autochdir
" 设置为nocompatible模式
set nocompatible
" 搜索
set ignorecase
set incsearch " 输入搜索内容时就显示搜索结果
set hlsearch "搜索时高亮显示被找到的文本
" 代码折叠方式
set foldmethod=marker
" 文件修改后自动重新读入
set autoread
" 取消备份
set nobackup
set noswapfile
" 允许使用鼠标
set mouse=a
" 主题配置
colorscheme desert
" 行号和标尺
set nu
set ruler
set tw=100
" 状态栏配置
set laststatus=2
set showcmd " 状态栏显示目前所执行的指令
" 光标设置
set cursorline
" set cursorcolumn
""""""""""""""""""""""KEY BINDING""""""""""""""""""""
" 映射切换buffer的键位
nnoremap [b :bp<CR>
nnoremap ]b :bn<CR>
" 映射切换tab的键位
nnoremap [t :tabp<CR>
nnoremap ]t :tabn<CR>
""""""""""""""""""""""PLUGIN CONFIG""""""""""""""""""""
" airline
let g:airline_powerline_fonts = 1
" let g:airline_left_sep=''
" let g:airline_right_sep=''
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
" tagbar
nmap <F8> :TagbarToggle<CR>
let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
" CtrlP
let g:ctrlp_show_hidden = 1
let g:ctrlp_map = '<C-p>'
let g:ctrlp_cmd = 'CtrlPMixed'
" syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Emmet
let g:user_emmet_expandabbr_key = '<C-e>'
" Enable just for html/css
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall