-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
53 lines (48 loc) · 1.66 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
syn on "语法支持
"common conf {{ 通用配置
set ai "自动缩进
set bs=2 "在insert模式下用退格键删除
set showmatch "代码匹配
set laststatus=2 "总是显示状态行
set expandtab "以下三个配置配合使用,设置tab和缩进空格数
set shiftwidth=4
set tabstop=4
set cursorline "为光标所在行加下划线
set cursorcolumn "设置竖线
set number "显示行号
set autoread "文件在Vim之外修改过,自动重新读入
set ignorecase "检索时忽略大小写
set fileencodings=uft-8,gbk "使用utf-8或gbk打开文件
set hls "检索时高亮显示匹配项
set helplang=cn "帮助系统设置为中文
set foldmethod=syntax "代码折叠
"}}
"conf for tabs, 为标签页进行的配置,通过ctrl h/l切换标签等
let mapleader = ','
nnoremap <C-l> gt
nnoremap <C-h> gT
nnoremap <leader>t : tabe<CR>
nnoremap <C-t> :NERDTree<CR>
"conf for plugins {{ 插件相关的配置
"状态栏的配置
"powerline{
set guifont=PowerlineSymbols\ for\ Powerline
set nocompatible
set t_Co=256
let g:Powerline_symbols = 'fancy'
"}
"pathogen是Vim用来管理插件的插件
"pathogen{
call pathogen#infect()
"}
"}}
map <leader>cl :call SetColorColumn()<CR>
function! SetColorColumn()
let col_num = virtcol(".")
let cc_list = split(&cc, ',')
if count(cc_list, string(col_num)) <= 0
execute "set cc+=".col_num
else
execute "set cc-=".col_num
endif
endfunction