我的vim的配置

Linux和MacOS修改家目录下的.vimrc,Windows对应地修改用户文件夹下的_vimrc

极简版:

set nu
set numberwidth=1

"color murphy
syntax on
set nowrap

set guifont=Menlo\ Regular:h24
"set guifont=Consolas:h24
"set guifont=Courier:h24
"set guifont=Courier\ New\ Bold:h24
"1. set guifont=*
"2. set guifont?
"3. write to .vimrc

set nobackup
set noswapfile

set cindent
set autoindent
set smartindent

set tabstop=4
set softtabstop=4
set shiftwidth=4

set encoding=utf-8
set fileencodings=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936,utf-16,big5,euc-jp,latin1  
 "编码设置

set hlsearch "高亮显示所查询"
set ignorecase
set incsearch "动态跟踪符合条件的查询结果

现在(2019)版:

set nu
set numberwidth=1

"语法高亮
syntax on

"设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
set showmatch

"自动缩进
"set smartindent
"set autoindent
set cindent

" 主题
"color morning
"set gcr=a:block-blinkon0
color murphy

" 图形界面时字体设置
set guifont=Courier_new:h16:b:cANSI
set guifont=Menlo\ Regular:h20
"set guifont=Consolas:h16:i:cANSI
"set guifont=Consolas:h15:b:cANSI


"set cursorline
"设置状态栏右下角显示
set ruler

"不换行显示
set nowrap


"键宽
set tabstop=4
set softtabstop=4
set shiftwidth=4
set backspace=2

"将tab键自动转换为空格
set expandtab

" 修改行号的颜色
hi LineNr term=underline ctermfg=darkgray guifg=darkgray

"搜索时忽略大小写敏感
set ignorecase
"搜索时高亮显示
set hlsearch


"设置在vim中可以使用鼠标
"set mouse=a


"检测文件类型
filetype on
"针对不同的文件采取不同的缩进方式
filetype indent on
"启动智能补全
filetype plugin indent on

"括号自动补全
inoremap ( ()i
inoremap [ []i
inoremap { {}i
inoremap < <>i

"直接使用y p进行系统级复制粘贴
set clipboard=unnamedplus

"不自动备份
set nobackup 
"禁止临时性文件
set noswapfile


"编码
"set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
"set termencoding=utf-8
"set encoding=utf-8

if has("linux") || has("unix") || has("mac")
    set encoding=utf-8
endif
"自动判断编码时 依次尝试以下编码
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1

" 不要工具栏和菜单栏
if has("win32") || has("win64")
    set guioptions-=T
    set guioptions-=m
endif


你可能感兴趣的:(我的vim的配置)