posts - 145,comments - 23,views - 73万

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
let g:snip_set_textmate_cp=1
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

set cursorline " 当前光标所在行会有阴影

"打开语法高亮
syntax on

"tab转空格的一坨设置
set shiftwidth=4
set sts=4
set tabstop=4
set expandtab

"自动缩进设置
set cindent
set smartindent
set incsearch
set autoindent

"显示行号
set nu

" 不要备份
set nobackup

"设置colormode
colorscheme desert

" Monaco字体
set guifont=Courier_New:h12


" 更新时间200毫秒,针对taglist插件
set ut=200

"Show matching bracets
set showmatch

"Get out of VI's compatible mode
set nocompatible

"Set to auto read when a file is changed from the outside
set autoread

"Enable filetype plugin
filetype on
filetype plugin on
filetype indent on

"设置搜索结果高亮显示
set hlsearch

"设置记录的历史操作列表
set history=50

"设置折叠
set foldcolumn=2
set foldmethod=indent
set foldlevel=3


"Set mapleader
let mapleader = '\' " leader用反斜杠\
map <leader><leader> \be " 双反斜杠\\即可打开bufexplorer
map C-Enter C-Tab " Ctrl+Enter也可以切换buffer

"Taglist插件的一坨设置
let g:Tlist_Use_Right_Window=1
"let g:Tlist_Auto_Open=1
let g:Tlist_Show_One_File=1
let g:Tlist_Compact_Format=1
let g:Tlist_Enable_Fold_Column=0
let Tlist_Ctags_Cmd="'d:\Program Files\vim\vim71\plugin\ctags\ctags.exe'"
nnoremap <F12> :TlistToggle<CR>

"Calendar map
nnoremap <F11> :Calendar<CR>

"load project plugin
nnoremap <F10> :Project<CR>

"gvim打开以后最大化
au GUIEnter * simalt ~x

set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8

posted on   梦中彩虹  阅读(558)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
< 2025年3月 >
23 24 25 26 27 28 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 1 2 3 4 5

点击右上角即可分享
微信分享提示