Commit committed ..

This commit is contained in:
Joty
2018-04-27 17:26:33 +09:30
parent 330a8f9180
commit ce8e97a277
3 changed files with 26 additions and 4 deletions

2
.zshrc
View File

@@ -119,5 +119,7 @@ export MARKER_KEY_NEXT_PLACEHOLDER="\C-b" #change maker key binding from Ctr+t
[[ -s "$HOME/.local/share/marker/marker.sh" ]] && source "$HOME/.local/share/marker/marker.sh" [[ -s "$HOME/.local/share/marker/marker.sh" ]] && source "$HOME/.local/share/marker/marker.sh"
SAVEHIST=50000 #save upto 50,000 lines in history. oh-my-zsh default is 10,000
#setopt hist_ignore_all_dups # dont record duplicated entries in history during a single session
alias wip="wget -qO- https://wtfismyip.com/text" # quickly show external ip address alias wip="wget -qO- https://wtfismyip.com/text" # quickly show external ip address
alias l="ls -lah" alias l="ls -lah"

View File

@@ -3,8 +3,13 @@
Quickly install and setup oh-my-zsh with powerlevel9k theme, Powerline fonts, zsh-completions, zsh-autosuggestions, zsh-syntax-highlighting, history-substring-search, fzf etc. Quickly install and setup oh-my-zsh with powerlevel9k theme, Powerline fonts, zsh-completions, zsh-autosuggestions, zsh-syntax-highlighting, history-substring-search, fzf etc.
## Installation ## Installation
Requirements:
`wget git zsh` will be Automatically installed if not present. `python` is required to run '--cp-hist'
``` 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
``` ```
Optionally run it with '--cp-hist' to copy command history from .bash_history to .zsh_history.
`./quickz.sh --cp-hist # don't run multiple times`

View File

@@ -1,9 +1,9 @@
#!/bin/bash #!/bin/bash
if command -v zsh &> /dev/null && command -v git &> /dev/null ; then if command -v zsh &> /dev/null && command -v git &> /dev/null && command -v wget &> /dev/null; then
echo -e "ZSH and Git are already installed\n" echo -e "ZSH and Git are already installed\n"
else else
if sudo apt install -y zsh git || sudo dnf install -y zsh git || sudo yum install -y zsh git || sudo brew install git zsh ; then if sudo apt install -y zsh git wget || sudo dnf install -y zsh git wget || sudo yum install -y zsh git wget || sudo brew install git zsh wget ; then
echo -e "ZSH and Git Installed\n" echo -e "ZSH and Git Installed\n"
else else
echo -e "Can't install ZSH or Git\n" && exit echo -e "Can't install ZSH or Git\n" && exit
@@ -78,10 +78,25 @@ else
fi fi
if ~/marker/install.py; then if ~/marker/install.py; then
echo -e "Installed Marker" echo -e "Installed Marker\n"
else else
echo -e "Marker Installation Had Issues" echo -e "Marker Installation Had Issues\n"
fi fi
if [[ $1 == "--cp-hist" ]]; then
echo -e "Copying bash_history to zsh_history\n"
if command -v python &>/dev/null; then
wget https://gist.githubusercontent.com/muendelezaji/c14722ab66b505a49861b8a74e52b274/raw/49f0fb7f661bdf794742257f58950d209dd6cb62/bash-to-zsh-hist.py
cat ~/.bash_history | python3 bash-to-zsh-hist.py
else
echo "Python is not installed, can't copy bash_history to zsh_history\n"
fi
else
echo -e "Not copying history\n"
fi
# source ~/.zshrc # source ~/.zshrc
echo -e "\nSudo access is needed to change default shell\n" echo -e "\nSudo access is needed to change default shell\n"