Mac OS X中设置VIM语法高亮的方法
前言
Vim 是一款相当给力的源自UNIX平台的命令行文本编辑器,不过不给力的是,Mac OS X下并没有诸多Linux发行版上VIM那些牛逼哄哄的神马代码高亮显示啊,自动缩进之类的。
(译者注:通常Linux发行版可以通过编辑/etc/vimrc文件更改全局VIM设定或者针对某个用户的~/.vimrc进行个性化配置)
为了弥补这个缺憾,请按如下方法操作:
实现方法
主要是修改~/.vimrc文件
文件内容如下:
set ai         " auto indenting
set history=100     " keep 100 lines of history
set ruler        " show the cursor position
syntax on        " syntax highlighting
set hlsearch      " highlight the last searched term
filetype plugin on   " use the file type plugins
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif保存退出即可。
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家学习或者操作vim能有所帮助,如果有疑问大家可以留言交流。谢谢大家对安科网的支持。
相关推荐
  lerdor    2020-10-14  
   linzb    2020-09-22  
   HeronLinuxampARM    2020-09-14  
   CoderMannul    2020-09-07  
   lerdor    2020-08-31  
   ZZBAIFFA    2020-08-31  
   yonggeno    2020-08-18  
   yhuihon    2020-08-17  
   涅磐    2020-08-11  
   yhuihon    2020-08-09  
   zhangxl0    2020-07-28  
   yhuihon    2020-07-26  
   想个标题偏头痛    2020-07-19  
   老甘的可读区    2020-07-18  
   linzb    2020-07-18  
   xlb    2020-07-12  
   老甘的可读区    2020-07-09  
   極愛    2020-07-06