一些Vim配置策略


#! /bin/bash

mv /etc/vim/vimrc /etc/vim/vimrc.bak
sudo echo '
set showcmd  " Show (partial) command in status line.
set showmatch   " Show matching brackets.
set ignorecase  " Do case insensitive matching
set smartcase   " Do smart case matching
set incsearch   " Incremental search
set autowrite   " Automatically save before commands like :next and :make
"set hidden  " Hide buffers when they are abandoned
set mouse=a  " Enable mouse usage (all modes)
set nu
set nobackup
set ai
set tabstop=4
set shiftwidth=4
set hlsearch
set ruler    " 显示当前的行号列号
set background=dark " 尝试使用在暗色背景中合适的颜色

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif

#colorscheme evening	" 设置Vim的配色方案(可根据自己喜好进行调整)

filetype on  "检测文件类型
filetype indent on  " 针对不同的文件类型采用不同的缩进格式
filetype plugin on  "允许插件
filetype plugin indent on   "启动自动补全
set nocompatible    " 非兼容vi模式。去掉讨厌的有关vi一致性模式
set autoread     " 文件修改之后自动载入
set shortmess=atI   " 启动的时候不显示那个援助索马里儿童的提示
set nobackup     " 取消备份
set nowb
set noswapfile
set ruler    "显示当前的行号列号
' >> /etc/vim/vimrc

写成Shell的方式,方便一键修改~~{使用前注意:1.chmod +x ;2.权限问题–sudo}

,

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注