-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.mine
181 lines (153 loc) · 5.32 KB
/
vimrc.mine
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
"============Vundle Setting Start============
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
Plugin 'taglist.vim'
Plugin 'vim-airline'
Plugin 'molokai'
" plugin on GitHub repo
Plugin 'ervandew/supertab'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/nerdcommenter'
Plugin 'scrooloose/syntastic'
Plugin 'Shougo/neocomplcache'
Plugin 'mhinz/vim-startify'
"Plugin 'altercation/vim-colors-solarized' "solarize主题
Plugin 'drmingdrmer/xptemplate'
"Plugin '2072/PHP-Indenting-for-VIm' "PHP缩进
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
call vundle#end() " required
"============Vundle Setting End============
filetype plugin indent on "允许插件
set tabstop=4
set shiftwidth=4
set softtabstop=4
set backspace=2
set backspace=eol,start,indent
"代码相关配置
"======================================
syntax enable
syntax on "语法高亮
set autoindent "自动缩进
set smartindent "根据上面的缩进只能选择对其方式
set number "显示行号
set showmatch "代码匹配
set helplang=cn
set hlsearch "搜索高亮
set incsearch "搜索追踪
set ignorecase "忽略大小写$
set smartcase "当查询串中有至少一个大写字母时对大小写敏感
set selection=inclusive "可视模式下将当前光标所在的字符选中
set foldmethod=marker "按照折叠符号折叠
set so=5 "在光标上下各留5行
set wrap "自动折行
set cursorline cursorcolumn "高亮光标所在行和列
au WinLeave * set nocursorline nocursorcolumn "进入窗口的时候高亮所在的行和列
au WinEnter * set cursorline cursorcolumn "离开窗口的时候取消对光标所在行和列的高亮
set confirm "关闭未保存的文件时提示
set iskeyword+=$,%,#,- "碰到这些字符是时候仍然认为是一个词
set report=0 "显示被替换的次数
set matchpairs+=<:> "添加对html的括号匹配
"set autowrite "切换buffer时自动保存 有点危险
set t_Co=256
set background=dark
colorscheme molokai
"let g:molokai_original = 1
"let g:rehash256 = 1
"编码设置
set encoding=utf8
set fileencoding=utf8
set fileencodings=utf8
"VIM Tab切换设置
map <C-n> :tabnew<CR>
"map <C-w> :tabclose<CR>
map <C-b> :tabp<CR>
map <C-e> :tabn<CR>
"窗口切换
noremap <C-J> <C-W>j
noremap <C-K> <C-W>k
noremap <C-H> <C-W>h
noremap <C-L> <C-W>l
noremap <C-L> <C-W>l
"插件配置
"======================================
"WinManager
"=====================================
"let g:NERDTree_title="[NERDTree]"
"let g:winManagerWindowLayout="NERDTree,miniBufExp|TagList"
"let g:winManagerWidth = 30
"nmap <silent> <F3> :WMToggle<cr>
"function! NERDTree_Start()
" exec 'NERDTree'
"endfunction
"function! NERDTree_IsValid()
" return 1
"endfunction
"MiniBufExp插件
"=====================================
"let g:miniBufExplMapWindowNavVim = 1
"let g:miniBufExplMapWindowNavArrows = 1
"let g:miniBufExplMapCTabSwitchBufs = 1
"let g:miniBufExplModSelTarget = 1
"let g:miniBufExplMoreThanOne=0
"设置NerdTree
"=====================================
"map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>
"当只剩下NERDTree时,自动关闭窗口
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()
autocmd VimLeave * NERDTreeClose
function! s:CloseIfOnlyNerdTreeLeft()
if exists("t:NERDTreeBufName")
if bufwinnr(t:NERDTreeBufName) != -1
if winnr("$") == 1
q
endif
endif
endif
endfunction
"Taglist
"=====================================
" 不同时显示多个文件的 tag ,只显示当前文件的
let Tlist_Show_One_File=1
" 如果 taglist 窗口是最后一个窗口,则退出 vim
let Tlist_Exit_OnlyWindow=1
"让当前不被编辑的文件的方法列表自动折叠起来
let Tlist_File_Fold_Auto_Close=1
"显示taglist菜单
let Tlist_Show_Menu=1
"启动vim自动打开taglist
"let Tlist_Auto_Open=1
map <F2> :Tlist<CR>
"Status Bar
"=====================================
set laststatus=2
let g:airline_theme='molokai'
"XPTemplate
"=====================================
let g:xptemplate_vars = "SParg=" "括号中无空格
"NeoComplcache
"=====================================
" Use neocomplcache.
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_auto_select = 1 "默认选择第一个
"类似autocomplpop, ncc默认自动弹出匹配项目, 不喜欢可以关掉.
"let g:NeoComplCache_DisableAutoComplete = 1
"如果安了supertab, 把匹配模式改成context
"let g:SuperTabDefaultCompletionType="context"
"NERD Commenter
"=====================================
"注释插件快捷键前置键
"let mapleader=","
map <C-C> :call NERDComment(1,"toggle")<CR>
"SuperTab
"=====================================
let g:SuperTabDefaultCompletionType="context"
"vim-Startify Setting
let g:startify_session_persistence = 1