Skip to content

Instantly share code, notes, and snippets.

@AdelDima
Last active August 8, 2022 00:20
Show Gist options
  • Save AdelDima/f5fb435aa4e7ae31669f7bcc63447928 to your computer and use it in GitHub Desktop.
Save AdelDima/f5fb435aa4e7ae31669f7bcc63447928 to your computer and use it in GitHub Desktop.
Cygwin & oh-my-zsh
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# aliases
alias noor="cd /cygdrive/d/dimacode/xampp/htdocs/wp/noor/wp-content/themes/noor"
alias okab="cd /cygdrive/d/dimacode/xampp/htdocs/wp/okab/wp-content/themes/okab"
alias st='/cygdrive/d/Program\ Files/Sublime\ Text\ 3/sublime_text.exe'\
#DEFAULT_USER=$USER
export DEFAULT_USER='cool'
# Dir: current working directory
prompt_dir() {
prompt_segment blue black '%(2~| \u229E /%1~|%~)'
#prompt_segment blue black "%$(( $COLUMNS - 61 ))<...<%3 ~%<<"
}
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment green black "%(!.%{%F{yellow}%}.) \u26a1"
fi
}

1. Install Cygwin

a. download & install : https://cygwin.com/install.html (setup-x86_64.exe) b. add wget, git and ncurses.

2. Install apt-cyg

(apt-cyg is a package manager for Cygwin, similar to apt-get in the Debian-based Linux distributions.) - Run the commaned

lynx -source rawgit.com/transcode-open/apt-cyg/master/apt-cyg > apt-cyg install apt-cyg /bin

- Example use of apt-cyg:

apt-cyg install nano (https://github.com/transcode-open/apt-cyg)

3. Install zsh

apt-cyg install zsh

For making Cygwin use automatically the zsh shell open "cygwin\etc\nsswitch.conf", look for "db_shell" and change it to "db_shell: /bin/zsh".

4. Install oh-my-zsh

curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

5. Install font https://github.com/tonsky/FiraCode Or https://github.com/powerline/fonts

6. configure .minttyrc

BoldAsFont=-1
Transparency=medium
Padding=18
FontSmoothing=full
#Font=Inconsolata-dz for Powerline
#Font=Fira Code Retina
Font=DejaVu Sans Mono for Powerline
FontHeight=11
FontWeight=500
BackgroundColour=9,41,51
#ForegroundColour=#A0A0A0
#BackgroundColour=#1B1D1E
CursorColour=9,41,51
Black=9,41,51
Red=#F92672
Green=#82B414
Yellow=#FD971F
Blue=#268BD2
Magenta=#8C54FE
Cyan=#56C2D6
White=#CCCCC6
BoldRed=#FF5995
BoldBlack=#505354
BoldGreen=#B7EB46
BoldYellow=#FEED6C
BoldBlue=#62ADE3
BoldMagenta=#BFA0FE
BoldCyan=#94D8E5
BoldWhite=#F8F8F2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment