VIM default configuration
== Vim的行号、语法显示等设置(.vimrc文件的配置) ==
2008年01月18日 星期五 23:01
在终端下使用vim进行编辑时,默认情况下,
编辑的界面上是没有显示行号、语法高亮度显示、智能缩进等功能的。
为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc。
在启动vim时,当前用户根目录下的.vimrc文件会被自动读取,该文件可以包含一些设置甚至脚本,所以,一般情况下把.vimrc文件创建在当前用户的根目录下比较方便,即创建的命令为:
$vi ~/.vimrc
设置完后
$:x 或者 $wq
进行保存退出即可。
#去掉讨厌的有关vi一致性模式,避免以前版本的一些bug和局限
set nocompatible
#显示行号
set nummber
#检测文件的类型
filetype on
#记录历史的行数
set history=1000
#背景使用黑色
set background=dark
#语法高亮度显示
syntax on
#下面两行在进行编写代码时,在格式对齐上很有用;
#vim使用自动对起,也就是把当前行的对起格式应用到下一行;
set autoindent
#依据上面的对起格式,智能的选择对起方式,对于类似C语言编写上很有用
set smartindent
#第一行设置tab键为4个空格,第二行设置当行之间交错时使用4个空格
set tabstop=4
set shiftwidth=4
#设置匹配模式,类似当输入一个左括号时会匹配相应的那个右括号
set showmatch
#去除vim的GUI版本中的toolbar
set guioptions-=T
#当vim进行编辑时,如果命令错误,会发出一个响声,该设置去掉响声
set vb t_vb=
#在编辑过程中,在右下角显示光标位置的状态行
set ruler
#默认情况下,寻找匹配是高亮度显示的,该设置关闭高亮显示
#set nohls
#查询时非常方便,如要查找book单词,当输入到/b时,会自动找到第一
#个b开头的单词,当输入到/bo时,会自动找到第一个bo开头的单词,依
#次类推,进行查找时,使用此设置会快速找到答案,当你找要匹配的单词
#时,别忘记回车
set incsearch
#修改一个文件后,自动进行备份,备份的文件名为原文件名加“~“后缀
if has(“vms”)
set nobackup
else
set backup
endif
# vim 中文无法显示
:set fileencodings=ucs-bom,utf-8,cp936
:set fileencoding=utf-8
:set encoding=cp936
:set cul
=======如果去除注释后,一个完整的.vimrc配置信息如下所示:
set nocompatible
set nu
filetype on
set history=1000
set background=dark
syntax on
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
set incsearch
:set fileencodings=ucs-bom,utf-8,cp936
:set fileencoding=utf-8
:set encoding=cp936
:set cul
======================
#如果设置完后,发现功能没有起作用,检查一下系统下是否安装了vim-enhanced包,查询命令为:
$rpm –q vim-enhanced
参考资料:
1.vim的完全翻译版在下面连接处可以找到
http://vimcdoc.sourceforge.net/
可以下载其中的一个PDF版本,里面介绍的很详细,强烈推荐:)
2.更详细的vim信息可以访问:
http://www.vim.org/
3.一个带有英文注释的.vimrc例子
http://www.vi-improved.org/vimrc.php
4. chaoyuan 的.vimrc
VIM default configuration的更多相关文章
- 【解决】Can't find default configuration "arch/x86/configs/xx_defconfig"!
Can't find default configuration "arch/x86/configs/xx_defconfig"! 这个问题常见在没有设置好架构的makefile中 ...
- 【IntellJ IDEA】idea启动测试类报错Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.
idea启动测试类报错 Error running 'Test1.test': Command line is too long. Shorten command line for Test1.tes ...
- log4j报错ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only err ...
- Fixing Poor MySQL Default Configuration Values
I've recently been accumulating some MySQL configuration variables that have defaults which have pro ...
- idea 启动项目提示 Command line is too long. Shorten command line for Application or also for Spring Boot default configuration.
在.idea 文件夹中打开workspace.xml文件找到<component name="PropertiesComponent">,在标签里加一行 <pr ...
- 【springcloud】【idea】启动服务报错Command line is too long. Shorten command line for XXXApplication or also for Spring Boot default configuration.
在workspace.xml 在标签<component name="PropertiesComponent">里 添加<property name=" ...
- Command line is too long. Shorten command line for testMLDome1 or also for Application default configuration
在.idea文件夹中,更改workspace.xml文件 加这段语句: <property name="dynamic.classpath" value="true ...
- Error running 'App': Command line is too long. Shorten command line for App or also for Spring Boot default configuration.
找到标签 <component name="PropertiesComponent">.在标签里加一行 : <property name="dynam ...
- Basic Vim Configuration
原文: https://computers.tutsplus.com/tutorials/basic-vim-configuration--cms-21498 原来,vim的配置文件,.vimrc也是 ...
随机推荐
- 后端接收不到AngularJs中$http.post发送的数据的问题
1.问题: 后端接收不到AngularJs中$http.post发送的数据,总是显示为null 示例代码: $http.post(/admin/KeyValue/GetListByPage, { pa ...
- Navicat Premium 自动备份mysql和sqlserver
mysql篇: 1.点击计划 2.点击新建处理作业 3.选择需要备份的数据库,上级可用任务 4.点击保存按钮,输入保存文件名 5.保存后点击设置计划任务 6.计划里新建保存时间,应用后输入系统密码即可 ...
- Linux试玩指令开机关机
Linux内核最初只是由芬兰人李纳斯·托瓦兹(Linus Torvalds)在赫尔辛基大学上学时出于个人爱好而编写的. Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和U ...
- (转)从内存管 理、内存泄漏、内存回收探讨C++内存管理
http://www.cr173.com/html/18898_all.html 内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟 ...
- VS2015升级Update2之后Cordova程序提示:此应用程序无法在此电脑上运行
VS2015在升级到Update2之后,有可能出现如下异常,在运行Cordova项目时提示: 查看输出面板会有乱码错误信息: 出现此问题的原因是在于npm程序损坏了.vs调用的npm程序并不是在nod ...
- CTE-递归[2]
在此之前写过一个CTE的递归,取出了所有的子节点,基本上可以满足大多数的需求,这里我们来延伸一下:首先我们回顾下原来的场景 图片的上半部分递归查出某个节点的所有子节点,这个我们已经通过CTE实现了,可 ...
- Xcode的控制台调试命令
XCode4.0以后,编译器换成了LLVM 编译器 2.0 与以前相比,更加强大:1.LLVM 编译器是下一带开源的编译技术.完全支持C, Objective-C, 和 C++.2.LLVM 速度比 ...
- ios 键盘弹起
#pragma mark 键盘弹起操作 - (void)keyboardWillShow:(NSNotification *)notification{ NSDictionary *info = ...
- linux搜索命令
1. find find是最常见和最强大的查找命令,你可以用它找到任何你想找的文件. find的使用格式如下: $ find <指定目录> <指定条件> <指定动作> ...
- c 连接数据库 mysql
sudo apt-get install mysql-server mysql-client 再装开发包代码:sudo apt-get install libmysqlclient15-dev 安装完 ...