How to enable syntax highlighting and other options in VIM
来源:互联网 发布:java ant zip 编辑:程序博客网 时间:2024/06/04 17:45
http://geekology.co.za/article/2009/03/how-to-enable-syntax-highlighting-and-other-options-in-vim
How to enable syntax highlighting and other options in vim
Vim is a popular command line text editor with an interface that is based not on menus or icons but on commands given in a text user interface.
Unfortunately the vim that ships with Mac OS X 10.5.* (Leopard) doesn't have an optimized configuration file to allow forsyntax highlighting, auto indentation, etc.
To fix this, open a new Terminal window and enter these commands to openvim's configuration file:
cd /usr/share/vimsudo vim vimrc
Press the "i" key to switch vim to Insertion Mode, then enter these lines below the "set backspace=2" line:
set ai " auto indentingset history=100 " keep 100 lines of historyset ruler " show the cursor positionsyntax on " syntax highlightingset hlsearch " highlight the last searched termfiletype plugin on " use the file type plugins" When editing a file, always jump to the last cursor positionautocmd BufReadPost *\ if ! exists("g:leave_my_cursor_position_alone") |\ if line("'\"") > 0 && line ("'\"") <= line("$") |\ exe "normal g'\"" |\ endif |\ endif
Press the Escape key to take vim out of Insertion Mode, then press ":" (colon) followed by "x" to save the file and exit. Enter this command again:
sudo vim vimrc
... and you'll see that vim now automatically indents code, displays thecursor position, has syntax highlighting, etc.
- How to enable syntax highlighting and other options in VIM
- vim syntax highlighting
- Quick Tip: How to Add Syntax Highlighting to Any Project
- How to get a syntax-highlighting code text
- How To Enable Android's Developer Options
- How-to: Enable User Authentication and Authorization in Apache HBase
- How to Enable and Disable Root Login in Ubuntu
- How to Check and Enable/Disable Oracle Binary Options (Doc ID 948061.1)
- syntax highlighting in LESS command on Ubuntu
- how to enable debug in eclipse + weblogic
- How To Enable Apache Modules in Ubuntu
- How to enable directory listing in tomcat
- How to enable IP Forwarding in Linux
- how to enable debug in configure?
- How to Enable IP Forwarding in Linux
- How to enable cURL in PHP / XAMPP
- How-to: enable fair scheduler in hadoop
- How to enable guest posting in phpBB3
- set操作
- multiset操作
- python unicode
- 奇迹是否会发生?乙肝从大三阳到小三阳到自愈!
- 软件工程师的职业之路
- How to enable syntax highlighting and other options in VIM
- 通过浏览器浏览本机文件夹
- 一个放了很久的网站程序
- streamin
- 外国的搜索引擎 可搜索被封信息
- newfile & write file
- LeetCode(88) Merge Sorted Array
- JSON
- Climbing stairs