|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Vim 是一款相当给力的源自 UNIX 平台的命令行文本编辑器,不过不给力的是,Mac OS X 下并没有诸多 Linux 发行版上 VIM 那些牛逼哄哄的神马代码高亮显示啊,自动缩进啊神马的。(注:通常 Linux 发行版可以通过编辑 /etc/vimrc 文件更改全局 VIM 设定或者针对某个用户的 ~/.vimrc 进行个性化配置)
为了弥补这个缺憾,请按如下方法操作: 打开 Terminal,输入如下命令:
- cd /usr/share/vim
- sudo vim vimrc
- # 然后输入你的管理员密码
复制代码
两行命令之后,会出现 VIM,在 set backspace=2 这行下插入(VIM 的操作不赘述,想做这个修改的肯定都会使 VIM)如下配置:
- 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("[ DISCUZ_CODE_1 ]quot;) |
- \ exe "normal g'"" |
- \ endif |
- \ endif
复制代码
然后你就可以看到华丽丽的语法高亮和享受到自动缩进等福利啦:
|
|