"行显示
set nu
"启用鼠标
set mouse=a
"set magic
"set autoindent "自动缩进和上一行一样"
"开启光亮光标行
set cursorline
hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
"开启高亮光标列
set cursorcolumn
hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
Syntax enable " 语法高亮
set formatoptions=tcrqn " 自动格式化
" 为C程序提供自动缩进
set smartindent
" 使用C样式的缩进
set cindent
"自动补全
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {<CR>}<ESC>O
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endfunction
set tabstop=4 "设置tab健的长度为4
set ruler "设置标尺
set linebreak "关闭自动折行
" 设置vim打开文件时光标在上次退出位置
au BufReadPost * if line("'\"") > 0 | if line("'\"") <= line("$") | exe("norm '\"") | else |exe "norm $"| endif | endif
set tags=tags
set tags+=./tags " 表示在当前工作目录下搜索tags文件
set helplang=cn " 显示中文帮助
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。