OSX下终端和Vim的两个小问题解决

终端不能显示中文
  在OSX的默认Terminal下用”ls”是显示不出中文的,看到的中文会是一串转义字符。
解决方法:
$ls -w

一劳永逸,编辑”etc/profile”(需要用sudo),增加一行
alias ls="ls -w"

Vim 7.0
安装
  OSX自带的是vim 6.2,所以需要到http://macvim.org下载一个7.0的版本安装。

配置
  中文环境的话打开vim会报菜单错误,需要编辑”/Applications/Vim.app/Contents/Resources/vim/gvimrc”中的第9行,去掉开头的双引号。
" finish

  编辑~/.vimrc,加入一行”set enc=utf-8″以解决菜单乱码。

Terminal下使用vim
  虽然这样通过Finder可以正常使用vim,但大部分vim用户都是习惯在Terminal中使用vim的(最起码我是这样)。编辑”/etc/profile”(需要用sudo),增加一行:
alias vim="/Applications/Vim.app/Contents/MacOS/Vim"

Technorati Tags: , ,

4 Responses to “OSX下终端和Vim的两个小问题解决”

Leave a Reply

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).