配置vim
set completeopt=preview,menu # 自动补全代码 filetype plugin on
set clipboard=unnamed # 共享剪贴板
set nobackup # 不自动备份
set ruler # 显示标尺
set cursorline # 显示光标
set magic # 魔法
set syntax=on # 语法高亮
set cindent # 设置C语言风格缩进
set smartindent # 设置智能缩进
set tabstop=4 # 设置tab占用4个空格
set shiftwidth=4
set noexpandtab # 不自动将tab展开为对应空格
set number # 显示行号
set history=1000 # 设置缓存条数为1000
set noswapfile # 无交换文件
set ignorecase # 忽略大小写
set hlsearch # 搜索逐字符高亮
set incsearch
set gdefault # 行内替换
set enc=utf-8 # 设置编码格式为utf-8
set showmatch # 匹配括号
filetype on # 检测文件类型
filetype plugin on # 启用插件
filetype indent on # 为特定文件类型载入相关缩进文件
常见问题
Vim出现Press ENTER or type command to continue
- 问题描述
每次使用vim
进行编辑时,都会出现提示信息Press ENTER or type command to continue
。
- 原因
配置vimrc
时,存在语法错误,这里是set tabstop
有问题。
- 解决方法
修改/etc/vim/vimrc
中的配置参数,将
set tabstop
修改为
set tabstop=4
关于我
我是一位喜欢创新、乐观向上的少年
爱好是看书、踢足球、玩LOL等
喜欢我的文章的朋友,可以添加个人微信:CS-huo
有问题可以相互探讨,共同学习!