Cygwin installation and simple configuration

Source: Internet
Author: User
Windows and Linux have their own advantages. They can be installed on the same computer, but they need to be restarted. At the same time, we have two computers, one with win and one with Linux, which is naturally very good, but there are not many of them. This article introduces cygwin, which allows you to have a Linux development environment under win without switching.

Briefly describe cygwin installation and configuration, as well as the entry-level tutorials.

First download setup.exe to the http://www.cygwin.com, and then create the installation directory, such as X: \ cygwin, put setup.exe to this directory,

 

Begin->
Click setup.exe, next-> install from Internet, next-> enter Root
Directory, such as X: \ cygwin, next-> Fill in the local package
Directory, such as X: \ cygwin \ FTP, next->

Select direct connection, next->

Select a fast FTP, next->

To install the basic system, click Next.
The rotate icon next to all switches default to install. If you only want to write programs under the command line, you only need
Choose GCC, make, and other development tools, as well as OpenSSH. After the selection, next->

Start to download and take a coffee break. After coming back, next->

Select whether or not to create a shortcut. -> End

 

Click shortcut or X: \ cygwin. BAT to open the console. If you are a domain user, follow the prompts makepasswd and makegroup. The following describes some simple adjustments and configurations.

1. Ssh Installation

The built-in console of cygwin has few adjustable parameters, and the comfort is low. Is there a way to use the familiar putty or securecrt to manipulate cygwin? There are two solutions:

1. Use puttycyg. The address is http://gecko.gc.maricopa.edu /~ Medgar/puttycyg /. The usage is simple. In the configuration dialog box, enter "host name. What cygwin bash shell can do is basically implement puttycyg. If you operate locally, we strongly recommend this good software.

2. Install sshd and log on to the local machine. If you forget to install openssh, click setup.exe, select OpenSSH, and install it again. If it has been installed, follow the steps below to continue:

A. Right-click "my computer"-> properties-> advanced-> environment variable, and add the variable cygwin to the system environment variable. The value is netsec.
Tty, append X: \ cygwin \ binb to path, open cygwin console, enter ssh-host-config, all the way to yes, the prompt is
When the cygwin value is set, enter netsec ttyc and Use Net start sshd or cygrunsrv-start to start the sshd service.
Sshd; stop sshd service with: net stop sshd or cygrunsrv-Stop sshdd, with SSH
Yourname@127.0.0.1 or SSH localhost Login

E. You can continue to install and configure SFTP and SCP. For details, refer to: how to install OpenSSH sshd server and sftp server.

F. It is too difficult to enter the password each time to log on. You can use the key for verification: Use puttygen.exe to survive the key pair. In ~ /, Create the. Ssh directory, create the authorized_keys2 file, copy the public key to the file, and then specify the private key in Putty to log on.

Ii. Simple Vim Configuration

Copy vimrc_example.vim in the \ USR \ share \ Vim \ vim64 directory ~ /, Rename it to _ vimrc, and modify the configuration according to your preferences. For example, enable highlight and select your favorite colorscheme.

Iii. Chinese display and input of cygwin

Allow bash command lines to support Chinese Input, VI ~ /. Inputrc, remove the comments of the following lines:

Set meta-flag on
Set convert-meta off
Set input-meta on
Set output-meta on

Let the LS command support Chinese display, VI ~ \. Bashrc, modify:

Alias ls = 'LS-Hf-show-control-chars-color = tty'

Vim64 supports Chinese input.

Iv. install and configure sdcv

Sitting in front of the computer for a long time, the screen is too bright, the radiation is large, it is not good for the body. Can I work and learn in the all-black naming line mode? Putty can be displayed on the full screen. sdcv allows you to search for words in command line mode.

Install: Go to the stardict homepage to download sdcv and the desired dictionary. After compilation and installation, decompress the dictionary and place it in the/usr/share/startdict/DIC directory.

Use: sdcv word. TIPS: you can ~ /. In bashrc, alias sdld = 'sdcv-u langdao 'and so on. In this way, too many dictionaries can be avoided, and the sdld word can be directly queried using the Lang Dao dictionary.

V. Conclusion

With GCC, Vim, and sdcv, the screen can basically work. The boss is here. I thought you were in Linux.

There are many interesting programs in cygwin. Let's explore them ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.