Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Cygwin Oh My ZSH Recipe

$
0
0

This post documents my Cygwin + Oh My ZSH configuration which gives me a consistent cross platform terminal experience on windows, OS X and linux.

Web development workflow with git, node, npm, docker, vagrant, etc. is more comfortable when using the same familiar bash shell interface across different operating systems.


Cygwin Oh My ZSH Recipe
Install Cygwin

I used these settings with the Cygwin for 64-bit versions of Windows.

Cygwin Setup Choose A Download Source: Install from Internet Select Root Install Directory: C:\Cygwin
Install For All Users Select Local Package Dire class=”pt1″ctory: C:\Users\{UserName}\AppData\Local\Cygwin Select Your Internet Conn class=”pt1″ection: Direct Connection Choose A Download Site: http://mirrors.xmission.com
This mirror was reliab class=”pt1″le for me. They should generally all be up to date. It is recommended that you select a mirror site that is closest to you. Visit the Cygwin Mirror Sites page for more information. Select Packages: curl: Muti-protocol file transfer tool fzf-zsh: fzf key bindings for Z shell fzf-zsh-completion: fzf completion for Z shell git: Distributed version control system gitk: Git repository browser zsh: The Z-Shell Configure Cygwin Home Directory

Make your Cygwin home directory the same as your Windows User profile.

Edit the Cygwin /etc/nsswitch.conf file.

Add or edit the following line: db_home: /%H

more info: Stack Overflow How can I change my Cygwin home folder after installation?

Install Oh My ZSH

Launch Cygwin and install Oh My ZSH using curl

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

I received this output while Oh My ZSH install completed:

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc
Copying your current PATH and adding it to the end of ~/.zshrc for you.
I can't change your shell automatically because this system does not have chsh.
Please manually change your default shell to zsh!

Edit the Cygwin /etc/nsswitch.conf file.

Add or edit the following line: db_shell: /bin/zsh

More info: Stack Overflow Set Default Shell in Cygwin

Mintty Configuration

This section documents some additional personalization preferences. Access the options by selecting the Cygwin application icon in the Title bar. For Looks, I have medium transparency selected.


Cygwin Oh My ZSH Recipe
Options Looks

For text, I have the Fira Code fonts installed on my system so have elected to use them and since my display is UHD, I am using the retina version. I have also set the font smoothing to partial which is equivalent to greyscale anti-aliasing.


Cygwin Oh My ZSH Recipe
Options Text

Lastly, I wanted to add some spacing between the window borders and command text. I discovered that this could be done by editing the mintty configuration file in my home directory. I added the following line to the file, Padding=16 . The entire configuration file is shown below.

~/.minttyrc BoldAsFont=-1
Columns=96
Rows=48
Transparency=medium
Padding=16
Font=Fira Code Retina
FontWeight=450
FontSmoothing=partial

Viewing all articles
Browse latest Browse all 11063

Trending Articles