mac终端的配置

要习惯用vim编写代码和用gcc编译.那么就要熟悉mac的终端了,网上也有很多教程.把我自己修改的记录一下先:

首先在 .bash_profile添加如下:

alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'

if brew list | grep coreutils > /dev/null ; then
  PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
  alias ls='ls -F --show-control-chars --color=auto'
  eval `gdircolors -b $HOME/.dir_colors`
fi

然后要安装homebrew : 传送门

或者终端命令: 

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

brew install xz coreutils

gdircolors --print-database > ~/.dir_colors

这样在终端里面都可以看到不同的颜色额

然后是vim上的;

在用户目录下 vim .vimrc

syntax on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)
if &term=="xterm"
    set t_Co=8
    set t_Sb=^[[4%dm
    set t_Sf=^[[3%dm
endif

   
要显示行数还可以加上 set nu

这样vim就能满足很多需求了,


加上vim的使用技巧..以及参考连接:

http://blog.csdn.net/jsufcz/article/details/3875956

http://www.cnblogs.com/witcxc/archive/2011/12/28/2304704.html

http://www.cnblogs.com/hlz789456123/archive/2009/03/19/1417193.html

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值