unijun 发表于 2016-1-1 12:03:29

<转>如何在Mac OS X中开启VIM语法高亮

  打开Terminal,输入如下命令:
cd /usr/share/vimsudo vim vimrc  两行命令之后,会出现VIM,在set backspace=2这行下插入(VIM的操作不赘述,想做这个修改的肯定都会使VIM)如下配置
  
  set ai                  &quot; auto indenting
  set history=100         &quot; keep 100 lines of history
  set ruler               &quot; show the cursor position
  syntax on               &quot; syntax highlighting
  set hlsearch            &quot; highlight the last searched term
  filetype plugin on      &quot; use the file type plugins
  
  &quot; When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if ! exists(&quot;g:leave_my_cursor_position_alone&quot;) |
  \ if line(&quot;'\&quot;&quot;) > 0 && line (&quot;'\&quot;&quot;) <= line(&quot;$&quot;) |
  \ exe &quot;normal g'\&quot;&quot; |
  \ endif |
  \ endif
  然后保存退出VIM。
  随便再用VIM开一个文件,比如刚才的vimrc:
  sudo vim vimrc
  你发现了神马……代码高亮显示了,也有自动缩进了。Yey!
  
  然后保存退出VIM。
  随便再用VIM开一个文件,比如刚才的vimrc:
sudo vim vimrc  你发现了神马……代码高亮显示了,也有自动缩进了。Yey!
  然后保存退出VIM。
  随便再用VIM开一个文件,比如刚才的vimrc:
sudo vim vimrc  你发现了神马……代码高亮显示了,也有自动缩进了。Yey!
页: [1]
查看完整版本: <转>如何在Mac OS X中开启VIM语法高亮