syntax on #进行语法检验,颜色显示
set nu #设置行号
set tabstop=4 #设置tab键宽度
set shiftwidth=4 #gg=G默认是个空格的缩进,设置为
set autoindent #自动缩进
set smartindent #智能缩进
set cindent #C缩进
set ruler #显示标尺,编辑过程中右下角显示光标位置的状态行
set showmatch #自动匹配括号
set showmatch #自动匹配括号
set matchtime=2 #匹配括号高亮显示的时间
set showcmd #输入的命令显示出来,看的清楚些
set cursorline #突出显示当前行
set hlsearch #搜索高亮末行模式下输入noh,可取消当前高亮显示状态
set nohls #关闭搜索时高亮显示
set incsearch #搜索时逐字高亮
set ignorecase #搜索时忽略大小写
set vb t_vb #去掉命令错误时的响声
set wrap #自动换行
set list #显示制表符
set backspace #设置退格键可用
myvimrc.txt
syntax on
set nu
set norelativenumber
set tabstop=2
set shiftwidth=2
set matchtime=2
set smartindent
set cindent
set autoindent
set ruler
set cursorline
set showmatch
set showcmd
set hlsearch
set incsearch
exec "nohlsearch"
set ignorecase
set smartcase
set wildmenu
let mapleader=" "
noremap <LEADER><CR> :noh<CR>
noremap n h
map s <nop>
map S :w<CR>
map Q :q<CR>
inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap { {}<Esc>i<Enter><Esc>O
inoremap " ""<Esc>i
inoremap ' ''<Esc>i
inoremap <C-b> <Backspace>
inoremap <C-g> <Down><Right>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-h> <Left>
inoremap <C-l> <Right>
func SkipPair()
if getline('.')[col('.') - 1] == ')' || getline('.')[col('.') - 1] == ']' || getline('.')[col('.') - 1] == '"' || getline('.')[col('.') - 1] == "'" || getline('.')[col('.') - 1] == '}'
return "\<ESC>la"
else
return "\t"
endif
endfunc
inoremap <TAB> <c-r>=SkipPair()<CR>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!