forked from happypeter/peter-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
179 lines (142 loc) · 3.75 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
175
176
177
178
179
if has('vim_starting')
" Be iMproved
set nocompatible
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#rc(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" My Bundles here:
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'Shougo/vimshell'
NeoBundle 'ack.vim'
NeoBundle 'tomtom/tcomment_vim'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'jistr/vim-nerdtree-tabs'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'tpope/vim-rails'
NeoBundle 'slim-template/vim-slim'
NeoBundle 'bling/vim-airline'
NeoBundle 'Yggdroot/indentLine'
NeoBundle "MarcWeber/vim-addon-mw-utils"
NeoBundle "tomtom/tlib_vim"
NeoBundle "garbas/vim-snipmate"
NeoBundle "honza/vim-snippets"
NeoBundle 'ervandew/supertab'
NeoBundle 'honza/vim-snippets'
NeoBundle 'kchmck/vim-coffee-script'
NeoBundleLazy 'jelera/vim-javascript-syntax', {'autoload':{'filetypes':['javascript']}}
NeoBundle 'plasticboy/vim-markdown'
NeoBundle 'vim-scripts/Conque-Shell'
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
" enable syntax
syntax on
" 打开语法高亮
syntax enable
" set color theme
colorscheme molokai
" mapleader
let mapleader = ","
" CtrlP
let g:ctrlp_map = ',,'
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_by_filename = 1
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git)$',
\ 'file': '\v\.(log|jpg|png|jpeg)$',
\ }
" tComment
map <c-c> gcc
" tab
set expandtab
" 设置tab键的宽度
set tabstop =2
" 换行时行间交错使用2个空格
set shiftwidth =2
" 自动对齐
set autoindent
" 自动缩进2空格
set cindent shiftwidth =2
" 智能自动缩进
set smartindent
" 设置自动缩进
set ai!
" 显示行号
set number
" 针对不同的文件类型采用不同的缩进式
filetype indent on
" 针对不同的文件类型加载对应的插件
filetype plugin on
" 启用自动补全
filetype plugin indent on
" 设定文件浏览器目录为当前目录
set bsdir=buffer
" 设置编码
set enc=utf-8
" 设置文件编码
set fenc=utf-8
" 设置文件编码检测类型及支持格式
set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
"scss,sass
au BufRead,BufNewFile *.scss set filetype=scss
au BufRead,BufNewFile *.sass set filetype=scss
"coffee script
au BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable
au BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
hi link coffeeSpaceError NONE
hi link coffeeSemicolonError NONE
hi link coffeeReservedError NONE
map <leader>cf :CoffeeCompile watch vert<cr>
"let skim use slim syntax
au BufRead,BufNewFile *.skim set filetype=slim
"ctags
set tags+=~/tags
" buffer
" 允许在有未保存的修改时切换缓冲区
set hidden
map <s-tab> :bp<cr>
map <tab> :bn<cr>
map ,bd :bd<cr>
" vimrc edit
map ,e :e ~/.vimrc<CR>
autocmd! bufwritepost .vimrc source ~/.vimrc
" quick esc
imap jj <esc>
" quick quite
map ,q :q!<CR>
" search
set ic
set incsearch
" 搜索到文件两端时不重新搜索
set nowrapscan
" ack
map ,k :Ack <cword><ENTER>
" let g:ackprg = 'ag --nogroup --nocolor --column'
" NERDTreeTabsToggle
map <Leader>n <plug>NERDTreeTabsToggle<CR>
" tagbar
let g:tagbar_ctags_bin='/usr/local/Cellar/ctags/5.8/bin/ctags'
let g:tagbar_width=30
map ,t :TagbarToggle<cr>
" indentLine
let g:indentLine_char = '¦'
" vim-markdown
" Disable Folding
let g:vim_markdown_folding_disabled=1
" Set Initial Foldlevel
let g:vim_markdown_initial_foldlevel=1
" Conque-Shell
map ,h :ConqueTermSplit
map ,v :ConqueTermVSplit