~/.vimrc

本文详细介绍Vim编辑器的配置选项,包括语法高亮、搜索、界面美化等方面的内容,旨在帮助用户提升编辑效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Remember to convert EOL(end of line) to Unix format when you copy the following content !

 

--------------------------------------------------------------------------------

" Switch syntax highlighting on when the terminal has colors
" Also switch on highlighting  the last used search pattern
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

if has("cursorline")

  set cursorline
endif

colo elflord


set incsearch " incremental search when typing

set ignorecase " ignore case when searching

set nocompatible " no compatible with previous versions

set number " show line number
set background=dark " background color
"syntax on " syntax enabled
filetype on " filetype checking enabled

set ai " autoindent

set si " smartindent
set ci " cindent: indent for C

set cino+=:2

set cino+==0

set tabstop=2 " 2 spaces for tab

set shiftwidth=2 "
set expandtab " use space to replace tab

set ruler " show position of cursor all the time


set matchpairs=(:),{:},[:],<:>

set showmatch " highlight bracket matching
"set history=1000 "

set backspace=indent,eol,start


set mouse=a " enable mouse all the time


"Basically you press * or # to search for the current selection !! Really useful

vnoremap <silent> * :call VisualSearch('f')<CR>
vnoremap <silent> # :call VisualSearch('b')<CR>

--------------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值