" 启用语法高亮 syntax on " 显示行号 set number " 高亮当前行 set cursorline " 设置制表符宽度为 4 个空格 set tabstop=4 set shiftwidth=4 set expandtab " 启用智能缩进 set smartindent " 启用自动缩进 set autoindent " 显示匹配的括号 set showmatch " 启用行号相对显示 set relativenumber " 搜索时忽略大小写 set ignorecase " 搜索时根据输入大小写智能匹配 set smartcase " 增量搜索 set incsearch " 搜索高亮 set hlsearch " 在命令行显示正在输入的命令 set showcmd " 显示光标位置 set ruler " 启用鼠标支持 set mouse=a " 设置终端标题 set title " 启用自动换行 set wrap " 禁用兼容模式以启用 Vim 的所有功能 set nocompatible " 设置剪切板使用系统剪切板 set clipboard=unnamedplus
可视化和美化
1 2 3 4 5 6 7 8 9 10 11 12 13 14
" 设置颜色方案 colorscheme desert " 设置背景颜色为暗色 set background=dark " 显示状态栏 set laststatus=2 " 启用命令行补全 set wildmenu " 设置滚动偏移,使光标上下移动时始终保持一定的上下缓冲区 set scrolloff=8 " 设置文件编码 set encoding=utf-8 " 突出显示当前列 set colorcolumn=80