Recently began to learn Linux, do not want to toss a dual system or virtual machine, followed by a Cygwin in the Windows simulation Linux environment.
First, install some common plug-in packages: Make, gcc, g++, awk, sed, vim, and so on.
First of all, the next Cygwin under the Vim key and the back key can not be used:
Go to the Vim74 folder (specifically vim73,74 or future later versions will be the case):
$ cd/usr/share/vim/vim74
To set VIM:
$ cp Vimrc_example.vim ~/.VIMRC
The key words of the programming language in Vim have also been added color, great.
Create a CPP file with vim
First create the file:
$ vim helloworld.cpp</span>
after entering vim, enter I into the edit mode, the relevant code is as follows:
#include <iostream>int main () { std::cout<< "helloworld!\n"; return 0;}
tap ESC to exit Edit mode
Enter ":" To accept the command
Save and launch Vim
Wq
to compile the CPP file (the default compilation output file is named A.exe, where I rename the output file to Mycpp via-o mycpp)
$ g++-O mycpp HelloWorld.cpp
run the compiled file
$./mycpp.exe
successfully print out:
helloworld!
As the film for reference:
Learn one of the Linux learning notes based on Cygwin: introductory article