1. Install mingw
Install it to: C:/mingw. You 'd better download the automatic installation version to mingw.
2. Install msys to the mingw home page to download the latest version of msys: URL: http://www.mingw.org/download.shtml
In the download list, current-msys is the msys Installer. Download its binary version (BIN) and install it under C:/msys/1.0. Specify the mingw position in the middle.
3. Modify the msys configuration file
Modify/etc/profile (the Windows path is C:/msys/1.0/etc/profile) and add the following lines at the end:
Export PS1 = '[/u @ msys/W] $'
Export PS2 = '>'
Export PS4 = '+'
Export lang = en
Alias L = '/bin/ls -- show-control-chars -- color = tty'
Alias LA = '/bin/LS-af -- show-control-chars -- color = tty'
Alias LL = '/bin/LS-alf -- show-control-chars -- color = tty'
Alias ls = '/bin/ls -- show-control-chars-f -- color = tty'
Modify C:/msys/1.0/msys. bat, find the startrxvt section, and modify it to the following:
If "X % mingw32bgcolor %" = "X" set mingw32bgcolor = black
If "X % mingw32fgcolor %" = "X" set mingw32fgcolor = white
Last modification:
Start rxvt-Sl 2500-FG % fgcolor %-BG % bgcolor %-Sr-FN "Ms Gothic"-24-Tn msys-geometry 90x30-E/bin/sh -- login-I
Exit
Note: do not include-backspacekey ^ h, so that the shell cannot return...
4. Configure environment variables:
Path C:/mingw/bin;
LIBRARY_PATH C:/mingw/lib
C_included_path C:/mingw/include
Cplus_include_path C:/mingw/include/C ++/3.4.5
5.shself-carried vimis not easy to use, use gvim, download gvim71.exe after installation
: E $ myvimrc
Add:
Set number
Set filetype = C
Colorscheme torte
Set guifont = lucida_console: H16, etc.
See http://edyfox.codecarver.org/html/_vimrc.html for details
A little trick is to write CD in _ vimrc so that you can enter the program directory as soon as you open gvim,
For example, the gvim installation directory is D:/gvim/Vim/vim71,
The program directory is D:/Ubuntu/Program (to facilitate programming and sharing in Ubuntu)
Add:
CD ..
CD ..
CD ..
CD/Ubuntu/program.
Similarly, you can add the corresponding statement in vimrc in Ubuntu to/Ubuntu/program, which will save a lot of time to switch directories.