vim配置

1、输入  vim ~/.vimrc
2、添加如下内容:

" 粘贴时保持格式[取消粘贴时自动注释功能]
set paste
" 显示行号
set number
" 开启光标位置提示
set ruler
" 高亮显示匹配的括号
set showmatch
" 开启搜索高亮
set hlsearch
" 输入搜索字符串的同时进行搜索
set incsearch
" 搜索忽略大小写
set ignorecase

" 不要使用vi的键盘模式,而是vim自己的
set nocompatible
" 与windows共享剪贴板
set clipboard+=unnamed
" 允许使用鼠标点击定位
set mouse=a
" 去掉输入错误的提示声音
set noeb
" 历史记录数
set history=1000
" 输入的命令显示出来
set showcmd
" 自动缩进
set autoindent
set cindent
" Tab键的宽度  
set tabstop=4
" 统一缩进为4
set softtabstop=4
set shiftwidth=4
" 不要用空格代替制表符
set noexpandtab
" 在行和段开始处使用制表符
set smarttab
" 禁止生成临时文件
set nobackup
set noswapfile
" 设置无备份文件
set writebackup
" 语法高亮
syntax on

整理后:

set paste
set number
set ruler
set showmatch
set hlsearch
set incsearch
set ignorecase
set nocompatible
set clipboard+=unnamed
set mouse=a
set noeb
set history=1000
set showcmd
set autoindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set smarttab
set nobackup
set noswapfile
set writebackup
syntax on

参考:

http://zuoqiang.iteye.com/blog/1155102
http://blog.csdn.net/g_brightboy/article/details/14229139

posted on 2017-10-29 00:26  雪悦紫颜  阅读(139)  评论(0编辑  收藏  举报

导航