4
.zshrc
4
.zshrc
@@ -160,10 +160,10 @@ https() { # make httpie use https
|
|||||||
# cheat sheets (github.com/chubin/cheat.sh), find out how to use commands
|
# cheat sheets (github.com/chubin/cheat.sh), find out how to use commands
|
||||||
# example 'cheat tar'
|
# example 'cheat tar'
|
||||||
# for language specific question supply 2 args first for language, second as the question
|
# for language specific question supply 2 args first for language, second as the question
|
||||||
# eample cheat python execute+external+program
|
# eample: cheat python3 execute external program
|
||||||
cheat() {
|
cheat() {
|
||||||
if [ "$2" ]; then
|
if [ "$2" ]; then
|
||||||
curl "https://cheat.sh/$1/$2"
|
curl "https://cheat.sh/$1/$2+$3+$4+$5+$6+$7+$8+$9+$10"
|
||||||
else
|
else
|
||||||
curl "https://cheat.sh/$1"
|
curl "https://cheat.sh/$1"
|
||||||
fi
|
fi
|
||||||
|
|||||||
25
README.md
25
README.md
@@ -2,7 +2,6 @@
|
|||||||
A simple script to setup an awesome shell environment.
|
A simple script to setup an awesome shell environment.
|
||||||
Quickly install and setup zsh and oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) with
|
Quickly install and setup zsh and oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh) with
|
||||||
* powerlevel10k theme (https://github.com/romkatv/powerlevel10k)
|
* powerlevel10k theme (https://github.com/romkatv/powerlevel10k)
|
||||||
* Powerline fonts(https://github.com/powerline/fonts)
|
|
||||||
* Nerd-Fonts (even better!) (https://github.com/ryanoasis/nerd-fonts)
|
* Nerd-Fonts (even better!) (https://github.com/ryanoasis/nerd-fonts)
|
||||||
* zsh-completions (https://github.com/zsh-users/zsh-completions)
|
* zsh-completions (https://github.com/zsh-users/zsh-completions)
|
||||||
* zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions)
|
* zsh-autosuggestions (https://github.com/zsh-users/zsh-autosuggestions)
|
||||||
@@ -18,11 +17,11 @@ Sets following useful aliases:
|
|||||||
* alias k="k -h" - show human readable filesizes, in kb, mb etc
|
* alias k="k -h" - show human readable filesizes, in kb, mb etc
|
||||||
* x="exit"
|
* x="exit"
|
||||||
* https - make httpie use https
|
* https - make httpie use https
|
||||||
* wip - (wget -qO- https://wtfismyip.com/text) what's my ip: quickly find out external IP
|
* wip - (wget -qO- https://wtfismyip.com/text) - what's my ip: quickly find out external IP
|
||||||
* cheat - (https://github.com/chubin/cheat.sh) cheatsheets in the terminal!
|
* cheat - (https://github.com/chubin/cheat.sh) - cheatsheets in the terminal!
|
||||||
* speedtest - (curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -) run speedtest on the fly
|
* speedtest - (curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -) run speedtest on the fly
|
||||||
* dadjoke - (curl https://icanhazdadjoke.com) terminally sick jokes
|
* dadjoke - (curl https://icanhazdadjoke.com) - terminally sick jokes
|
||||||
* dict - (curl "dict://dict.org/d:$1 $2 $3") dictionary definitions
|
* dict - (curl "dict://dict.org/d:$1 $2 $3") - dictionary definitions
|
||||||
|
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
@@ -39,25 +38,21 @@ Watch this to get an idea of what your Shell (well, life!) could be like!!
|
|||||||
## Installation
|
## Installation
|
||||||
Requirements:
|
Requirements:
|
||||||
* `git` to clone it.
|
* `git` to clone it.
|
||||||
* `python3` or `python` is required to run option '--cp-hist'
|
* `python3` or `python` is required to run option '-c' which copies history from .bash_history
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
git clone https://github.com/jotyGill/quickz-sh.git
|
git clone https://github.com/jotyGill/quickz-sh.git
|
||||||
cd quickz-sh
|
cd quickz-sh
|
||||||
./quickz.sh
|
./quickz.sh -c # only run with '-c' the first time, running multiple times will duplicate history entries
|
||||||
```
|
|
||||||
First time run it with '--cp-hist' instead, to copy command history from .bash_history to .zsh_history.
|
|
||||||
``` bash
|
|
||||||
./quickz.sh --cp-hist # running multiple times will duplicate history entries
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Change your terminals fonts to either "RobotoMono Nerd Font" or "Hack Nerd Font" or at least on of the "Powerline Fonts".
|
Change your terminals fonts to either "RobotoMono Nerd Font" or "Hack Nerd Font" or "DejaVu Sans Mono Nerd Fonts".
|
||||||
You can also manually install Nerd Font of your choice.
|
You can also manually install Nerd Fonts of your choice.
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
* If you are already using zsh, your zsh config will be backed up to .zshrc-backup
|
* If you are already using zsh, your zsh config will be backed up to .zshrc-backup-date
|
||||||
|
|
||||||
* If the text/icons look broken, make sure your terminal is using one of the Nerd fonts or at least powerline fonts. [discussion](https://github.com/powerline/fonts/issues/185). I recommend "RobotoMono Nerd Font"
|
* If the text/icons look broken, make sure your terminal is using one of the Nerd fonts. [discussion](https://github.com/powerline/fonts/issues/185). I recommend "RobotoMono Nerd Font"
|
||||||
|
|
||||||
* marker's shortcut "Ctr+t" clashed with fzf so I rebound it to "Ctr +b"
|
* marker's shortcut "Ctr+t" clashed with fzf so I rebound it to "Ctr +b"
|
||||||
|
|
||||||
|
|||||||
71
quickz.sh
71
quickz.sh
@@ -17,8 +17,10 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
echo -e "Installing oh-my-zsh\n"
|
echo -e "Installing oh-my-zsh\n"
|
||||||
if git clone --depth=1 git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh; then
|
if [ -d ~/.oh-my-zsh ]; then
|
||||||
echo -e "Installed OH-MY-ZSH\n"
|
echo -e "oh-my-zsh is already installed"
|
||||||
|
else
|
||||||
|
git clone --depth=1 git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -f .zshrc ~/
|
cp -f .zshrc ~/
|
||||||
@@ -26,66 +28,65 @@ cp -f .zshrc ~/
|
|||||||
|
|
||||||
mkdir ~/.quickzsh # external plugins, things, will be instlled in here
|
mkdir ~/.quickzsh # external plugins, things, will be instlled in here
|
||||||
|
|
||||||
|
if [ -d ~/.oh-my-zsh/plugins/zsh-autosuggestions ]; then
|
||||||
if git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions; then :
|
|
||||||
else
|
|
||||||
cd ~/.oh-my-zsh/plugins/zsh-autosuggestions && git pull
|
cd ~/.oh-my-zsh/plugins/zsh-autosuggestions && git pull
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting; then :
|
if [ -d ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ]; then
|
||||||
else
|
|
||||||
cd ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && git pull
|
cd ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting && git pull
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git clone --depth=1 https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions; then :
|
if [ -d ~/.oh-my-zsh/custom/plugins/zsh-completions]; then
|
||||||
else
|
|
||||||
cd ~/.oh-my-zsh/custom/plugins/zsh-completions && git pull
|
cd ~/.oh-my-zsh/custom/plugins/zsh-completions && git pull
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search; then :
|
if [ -d ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search ]; then
|
||||||
else
|
|
||||||
cd ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search && git pull
|
cd ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search && git pull
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/zsh-users/zsh-history-substring-search ~/.oh-my-zsh/custom/plugins/zsh-history-substring-search
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# INSTALL FONTS
|
# INSTALL FONTS
|
||||||
|
|
||||||
if git clone --depth=1 https://github.com/powerline/fonts.git --depth=1 ~/.quickzsh/powerline_fonts; then :
|
echo -e "Installing Nerd Fonts version of Hack, Roboto Mono, DejaVu Sans Mono\n"
|
||||||
else
|
|
||||||
cd ~/.quickzsh/powerline_fonts && git pull
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ~/.quickzsh/powerline_fonts/install.sh && rm -rf ~/.quickzsh/powerline_fonts; then
|
|
||||||
echo -e "\npowerline_fonts Installed\n"
|
|
||||||
else
|
|
||||||
echo -e "\npowerline_fonts Installation Failed\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
wget -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf -P ~/.fonts/
|
wget -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Hack/Regular/complete/Hack%20Regular%20Nerd%20Font%20Complete.ttf -P ~/.fonts/
|
||||||
wget -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/RobotoMono/Regular/complete/Roboto%20Mono%20Nerd%20Font%20Complete.ttf -P ~/.fonts/
|
wget -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/RobotoMono/Regular/complete/Roboto%20Mono%20Nerd%20Font%20Complete.ttf -P ~/.fonts/
|
||||||
|
wget -N https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete.ttf -P ~/.fonts/
|
||||||
|
|
||||||
fc-cache -fv ~/.fonts
|
fc-cache -fv ~/.fonts
|
||||||
|
|
||||||
|
if [ -d ~/.oh-my-zsh/custom/themes/powerlevel10k ]; then
|
||||||
if git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k; then :
|
|
||||||
else
|
|
||||||
cd ~/.oh-my-zsh/custom/themes/powerlevel10k && git pull
|
cd ~/.oh-my-zsh/custom/themes/powerlevel10k && git pull
|
||||||
|
else
|
||||||
|
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git clone --depth 1 https://github.com/junegunn/fzf.git ~/.quickzsh/fzf; then :
|
if [ -d ~/.quickzsh/fzf ]; then
|
||||||
else
|
|
||||||
cd ~/.quickzsh/fzf && git pull
|
cd ~/.quickzsh/fzf && git pull
|
||||||
fi
|
~/.quickzsh/fzf/install --all --key-bindings --completion --no-update-rc --64
|
||||||
~/.quickzsh/fzf/install --all --key-bindings --completion --no-update-rc --64
|
|
||||||
|
|
||||||
if git clone --depth 1 https://github.com/supercrabtree/k $HOME/.oh-my-zsh/custom/plugins/k; then :
|
|
||||||
else
|
else
|
||||||
|
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.quickzsh/fzf
|
||||||
|
~/.quickzsh/fzf/install --all --key-bindings --completion --no-update-rc --64
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d ~/.oh-my-zsh/custom/plugins/k ]; then
|
||||||
cd ~/.oh-my-zsh/custom/plugins/k && git pull
|
cd ~/.oh-my-zsh/custom/plugins/k && git pull
|
||||||
|
else
|
||||||
|
git clone --depth 1 https://github.com/supercrabtree/k ~/.oh-my-zsh/custom/plugins/k; then :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if git clone --depth 1 https://github.com/pindexis/marker ~/.quickzsh/marker; then :
|
if [ -d ~/.quickzsh/marker ]; then
|
||||||
else
|
|
||||||
cd ~/.quickzsh/marker && git pull
|
cd ~/.quickzsh/marker && git pull
|
||||||
|
else
|
||||||
|
git clone --depth 1 https://github.com/pindexis/marker ~/.quickzsh/marker; then :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ~/.quickzsh/marker/install.py; then
|
if ~/.quickzsh/marker/install.py; then
|
||||||
@@ -112,7 +113,7 @@ else
|
|||||||
echo -e "todo.sh is already instlled in ~/.quickzsh/todo/bin/\n"
|
echo -e "todo.sh is already instlled in ~/.quickzsh/todo/bin/\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 == "--cp-hist" ]]; then
|
if [[ $1 == "--cp-hist" ]] || [ $1 == "-c" ]; then
|
||||||
echo -e "\nCopying bash_history to zsh_history\n"
|
echo -e "\nCopying bash_history to zsh_history\n"
|
||||||
if command -v python &>/dev/null; then
|
if command -v python &>/dev/null; then
|
||||||
wget https://gist.githubusercontent.com/muendelezaji/c14722ab66b505a49861b8a74e52b274/raw/49f0fb7f661bdf794742257f58950d209dd6cb62/bash-to-zsh-hist.py
|
wget https://gist.githubusercontent.com/muendelezaji/c14722ab66b505a49861b8a74e52b274/raw/49f0fb7f661bdf794742257f58950d209dd6cb62/bash-to-zsh-hist.py
|
||||||
@@ -126,7 +127,7 @@ if [[ $1 == "--cp-hist" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\nNot copying bash_history to zsh_history, as --cp-hist is not supplied\n"
|
echo -e "\nNot copying bash_history to zsh_history, as --cp-hist or -c is not supplied\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user