"--------------------------------------------------------------------------------
" 一般设定
"--------------------------------------------------------------------------------
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set encoding=utf-8
set termencoding=cp936
language messages zh_CN.UTF-8 "解决输出乱码
source $VIMRUNTIME/delmenu.vim "解决菜单乱码
source $VIMRUNTIME/menu.vim "解决consle输出乱码
set nocompatible " 不要使用vi的键盘模式,而是vim自己的
set history=100 " history文件中需要记录的行数
set clipboard+=unnamed " 与windows共享剪贴板
set viminfo+=! " 保存全局变量
set iskeyword+=_,$,@,%,#,- " 带有如下符号的单词不要被换行分割
syntax on " 语法高亮
set cursorline " 突出显示当前行
nnoremap c:set cursorline! cursorcolumn!
"set cursorline
"au! Cursorhold *exe 'match CurrentLine ^%'. line('.').'l.*/'
"set ut=100
set nu! " 显示行号
set scrolloff=5 " 在光标接近底端或顶端时,自动下滚或上滚
"hi Comment ctermfg=DarkCyan "修改默认注释颜色
":highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
":match OverLength '\1v.*' " 高亮字符,让其不受100列限制
highlight StatusLine guifg=SlateBlue guibg=Yellow " 状态行颜色
highlight StatusLineNC guifg=Gray guibg=White " 状态行颜色
set laststatus=2 " 进入插入模式时改变状态栏颜色(仅限于Vim 7)
if version >= 700
au InsertEnter * hi StatusLine guibg=#818D29 guifg=#FCFCFC gui=none
au InsertLeave * hi StatusLine guibg=Yellow guifg=SlateBlue gui=none
endif
if has("gui_running")
"au GUIEnter * simalt ~x " 窗口启动时自动最大化
"set guioptions-=m " 隐藏菜单栏
"set guioptions-=T " 隐藏工具栏
"set guioptions-=L " 隐藏左侧滚动条
"set guioptions-=r " 隐藏右侧滚动条
"set guioptions-=b " 隐藏底部滚动条
"set showtabline=0 " 隐藏Tab栏
endif
"--------------------------------------------------------------------------------
" 配色方案(按照当前时间的秒数的个位数决定使用哪个方案)
"--------------------------------------------------------------------------------
if (strftime("%S")-floor(strftime("%S")/10)*10) <= 5
colorscheme navajo
elseif (strftime("%S")-floor(strftime("%S")/10)*10) > 5
colorscheme darker-robin
endif
2022-11-06 23:22:52
16KB
gvim配置
1