Tuesday, March 24, 2009

setup cygwin

Not fun, but have to make cygwin work.
1. Here is the batch file to start cygwin.

@echo off

SET PATH=D:\disk\cygwin\bin;%PAtH%
SET HOME=D:\disk\markc
SET CYGWIN=tty binmode
chdir %HOME%

2. A no special .bash_profile in $(HOME).

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
source /etc/bash.bashrc

# source the users bashrc if it exists
if [ -e "${HOME}/.bashrc" ] ; then
source "${HOME}/.bashrc"

3. Now, my .bashrc file.

export PATH=/usr/bin:/sbin:/usr/local/bin
export PATH=/usr/local/psp/gcc-2.8.2/bin:$PATH
export PATH=/usr/local/psp/devkit/bin:$PATH:.
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

The problem I have is '\r' cause the problem to start cygwin. To make cygwin happy with unix file format, we need set the unix file format in vimrc. The following code is my vimrc.

set autoindent
set softtabstop=4
set tabstop=4
set shiftwidth=4
set showmatch
set ignorecase
set background=dark
set hlsearch
set incsearch
set number
syntax on
set fileformats=unix,dos
set fileformat=unix