From 622b9327d2ee35c154f7e60145334c5daeafa438 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Fri, 10 Jan 2020 15:12:24 +0100 Subject: [PATCH] Migration to slimline. --- install.sh | 33 ++------------------------------- {zsh => legacy}/abbr_pwd | 0 legacy/agnoster.zsh | 15 +++++++++++++++ legacy/fish.conf | 17 +++++++++++++++++ zsh/zshrc | 13 +++++++++++++ 5 files changed, 47 insertions(+), 31 deletions(-) rename {zsh => legacy}/abbr_pwd (100%) create mode 100644 legacy/agnoster.zsh create mode 100644 legacy/fish.conf create mode 100644 zsh/zshrc diff --git a/install.sh b/install.sh index ed76c5c..e22d99b 100644 --- a/install.sh +++ b/install.sh @@ -33,40 +33,11 @@ ln -sf ~/.dotfiles/tmux.conf ~/.tmux.conf # cleaning rm -rf ~/.zsh* ~/.oh-my-zsh # installing -mkdir ~/.zsh git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting git clone https://github.com/popstas/zsh-command-time.git ~/.oh-my-zsh/custom/plugins/command-time -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc -sed -i -e 's/ZSH_THEME="robbyrussell"/ZSH_THEME="agnoster"/' ~/.zshrc -sed -i -e 's/plugins=(git)/plugins=(git kube-ps1 command-time zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc -sed -i -e 's/# CASE_SENSITIVE/CASE_SENSITIVE/' ~/.zshrc -if [ ! `whoami` = "root" ]; then - echo 'export DEFAULT_USER=$LOGNAME' >> ~/.zshrc -fi -echo "PROMPT=\$PROMPT'\$(kube_ps1) '" >> ~/.zshrc -echo "ZSH_COMMAND_TIME_MIN_SECONDS=2" >> ~/.zshrc -echo 'ZSH_COMMAND_TIME_MSG="(took $fg[yellow]%s$fg[default])"' >> ~/.zshrc -echo "[ -e ~/.zshrc.local ] && source ~/.zshrc.local" >> ~/.zshrc +git clone --recursive https://github.com/mengelbrecht/slimline.git ~/.oh-my-zsh/custom/themes/slimline +cp ~/.dotfiles/zsh/zshrc ~/.zshrc touch ~/.zshrc.local source ~/.zshrc - -### fish -## cleaning -#rm -rf ~/.config/fish ~/.local/share/fish ~/.config/omf ~/.local/share/omf -## installing omf -#curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install > ~/install.omf -#fish ~/install.omf --noninteractive -#fish -c 'omf install bobthefish' -#rm -rf ~/install.omf -## installing misc settings -#mkdir -p ~/.config/fish/functions -#echo 'function fish_greeting; end' > ~/.config/fish/functions/fish_greeting.fish -#echo 'function fish_right_prompt; end' > ~/.config/fish/functions/fish_right_prompt.fish -#touch ~/.fish.local -#echo 'set -x VIRTUAL_ENV_DISABLE_PROMPT 1' > ~/.config/fish/config.fish -#echo 'set -g theme_title_use_abbreviated_path no' >> ~/.config/fish/config.fish -#echo 'set -g fish_prompt_pwd_dir_length 0' >> ~/.config/fish/config.fish -#echo 'set -g theme_display_user yes' >> ~/.config/fish/config.fish -#echo 'source ~/.fish.local' >> ~/.config/fish/config.fish diff --git a/zsh/abbr_pwd b/legacy/abbr_pwd similarity index 100% rename from zsh/abbr_pwd rename to legacy/abbr_pwd diff --git a/legacy/agnoster.zsh b/legacy/agnoster.zsh new file mode 100644 index 0000000..1f8ae99 --- /dev/null +++ b/legacy/agnoster.zsh @@ -0,0 +1,15 @@ +export ZSH=$HOME/.oh-my-zsh +ZSH_THEME="agnoster" +CASE_SENSITIVE="true" + ENABLE_CORRECTION="true" +plugins=(git kube-ps1 command-time zsh-autosuggestions zsh-syntax-highlighting) +source $ZSH/oh-my-zsh.sh +export DEFAULT_USER=$LOGNAME +source ~/.dotfiles/zsh/abbr_pwd +prompt_dir() { + prompt_segment blue $CURRENT_FG $(felix_pwd_abbr) +} +PROMPT=$PROMPT'$(kube_ps1) ' +ZSH_COMMAND_TIME_MIN_SECONDS=2 +ZSH_COMMAND_TIME_MSG="(took $fg[yellow]%s$fg[default])" +[ -e ~/.zshrc.local ] && source ~/.zshrc.local diff --git a/legacy/fish.conf b/legacy/fish.conf new file mode 100644 index 0000000..4164b7c --- /dev/null +++ b/legacy/fish.conf @@ -0,0 +1,17 @@ +# cleaning +rm -rf ~/.config/fish ~/.local/share/fish ~/.config/omf ~/.local/share/omf +# installing omf +curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install > ~/install.omf +fish ~/install.omf --noninteractive +fish -c 'omf install bobthefish' +rm -rf ~/install.omf +# installing misc settings +mkdir -p ~/.config/fish/functions +echo 'function fish_greeting; end' > ~/.config/fish/functions/fish_greeting.fish +echo 'function fish_right_prompt; end' > ~/.config/fish/functions/fish_right_prompt.fish +touch ~/.fish.local +echo 'set -x VIRTUAL_ENV_DISABLE_PROMPT 1' > ~/.config/fish/config.fish +echo 'set -g theme_title_use_abbreviated_path no' >> ~/.config/fish/config.fish +echo 'set -g fish_prompt_pwd_dir_length 0' >> ~/.config/fish/config.fish +echo 'set -g theme_display_user yes' >> ~/.config/fish/config.fish +echo 'source ~/.fish.local' >> ~/.config/fish/config.fish diff --git a/zsh/zshrc b/zsh/zshrc new file mode 100644 index 0000000..09d3378 --- /dev/null +++ b/zsh/zshrc @@ -0,0 +1,13 @@ +export ZSH=$HOME/.oh-my-zsh +ZSH_THEME="agnoster" +CASE_SENSITIVE="true" +ENABLE_CORRECTION="true" +plugins=(git zsh-autosuggestions zsh-syntax-highlighting) +source $ZSH/oh-my-zsh.sh + +source ~/slimline/slimline.zsh +SLIMLINE_USER_HOST_INFO_FORMAT="%F{green}|user|%F{white}@%F{cyan}|host|%f" +SLIMLINE_SYMBOL_WORKING_FORMAT="%F{red}➜%f" +SLIMLINE_SYMBOL_READY_FORMAT="%F{white}➜%f" +SLIMLINE_MAX_EXEC_TIME=2 +[ -e ~/.zshrc.local ] && source ~/.zshrc.local