From e8014526dfd2febad148ce392ee3e4439811966c Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Tue, 5 Mar 2024 19:04:38 +0200 Subject: [PATCH] Add zsh plugins and aliases --- Makefile | 8 +++++++- macos/Brewfile | 1 - macos/Caskfile | 3 +++ shell/.aliases | 19 ++++++++++++++++++- shell/.bashrc | 2 ++ shell/.zprompt | 7 ++++++- shell/.zshrc | 32 ++++++++++++++++++++++++++------ 7 files changed, 62 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 6b331f8..7bd663a 100644 --- a/Makefile +++ b/Makefile @@ -53,4 +53,10 @@ vim: git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim zsh: - git clone git@github.com:softmoth/zsh-vim-mode.git ~/.zsh/zsh-vim-modes + mkdir -p ~/.zsh/plugins + -git clone git@github.com:arzzen/calc.plugin.zsh.git ~/.zsh/plugins/calc.plugin.zsh + -git clone git@github.com:softmoth/zsh-vim-mode.git ~/.zsh/plugins/zsh-vim-mode + -git clone https://github.com/lukechilds/zsh-better-npm-completion.git ~/.zsh/plugins/.zsh-better-npm-completion + -git clone https://github.com/sunlei/zsh-ssh ~/.zsh/plugins/zsh-ssh + mkdir -p ~/.zsh/plugins/bd + curl https://raw.githubusercontent.com/Tarrasch/zsh-bd/master/bd.zsh > ~/.zsh/plugins/bd/bd.zsh diff --git a/macos/Brewfile b/macos/Brewfile index 884892d..ffb65bc 100644 --- a/macos/Brewfile +++ b/macos/Brewfile @@ -13,7 +13,6 @@ brew 'htop' brew 'iperf3' brew 'jq' brew 'nvm' -brew 'thefuck' brew 'tmux' brew 'tree' brew 'wget' diff --git a/macos/Caskfile b/macos/Caskfile index 3ccfee7..1510063 100644 --- a/macos/Caskfile +++ b/macos/Caskfile @@ -2,6 +2,8 @@ cask_args appdir: '/Applications' +tap 'homebrew/cask-fonts' + cask 'alt-tab' cask 'apparency' cask 'arc' @@ -9,6 +11,7 @@ cask 'bartender' cask 'datweatherdoe' cask 'figma' cask 'firefox' +cask 'font-caskaydia-cove-nerd-font' cask 'forklift' cask 'gifox' cask 'google-chrome' diff --git a/shell/.aliases b/shell/.aliases index 12b77dc..ad99bf6 100644 --- a/shell/.aliases +++ b/shell/.aliases @@ -6,11 +6,28 @@ alias ....="cd ../../../" alias df1="du -h -d 1" -alias ls='ls -hG' +# alias ls='ls -hG' alias ll='ls -alhFG' alias la='ls -AG' alias l='ls -CFG' +# eza aliases, if available +if test $(which eza); then + eza_params=( + '--git' '--icons' '--group' '--group-directories-first' + '--time-style=long-iso' + ) + + alias ls='eza $eza_params' + alias l='eza --git-ignore $eza_params' + alias ll='eza --all --header --long $eza_params' + alias llm='eza --all --header --long --sort=modified $eza_params' + alias la='eza -lbhHigUmuSa' + alias lx='eza -lbhHigUmuSa@' + alias lt='eza --tree $eza_params' + alias tree='eza --tree $eza_params' +fi + alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' diff --git a/shell/.bashrc b/shell/.bashrc index 1257002..4399a01 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -1 +1,3 @@ [ -n "$PS1" ] && source ~/.bash_profile; + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash diff --git a/shell/.zprompt b/shell/.zprompt index 879a31e..7b8d3c5 100644 --- a/shell/.zprompt +++ b/shell/.zprompt @@ -1,7 +1,12 @@ source $HOME/Git/zsh-git-prompt/zshrc.sh +function git_email_prompt() { + GIT_USER=$(git config user.email) + echo $GIT_USER +} + PROMPT='%B%U%F{cyan}% %m%u%F{green} %~ $(git_super_status)%f %{%G%}%b ' -RPROMPT='%F{cyan}%*' +RPROMPT='%B%F{42}% $(git_email_prompt)%f %F{cyan}%*%b' # No right padding on RPROMPT ZLE_RPROMPT_INDENT=0 diff --git a/shell/.zshrc b/shell/.zshrc index e5ed1df..f1a3c84 100644 --- a/shell/.zshrc +++ b/shell/.zshrc @@ -1,4 +1,4 @@ -ZDOTDIR=$HOME/.zsh +ZDOTDIR=~/.zsh source $ZDOTDIR/.zprompt @@ -10,6 +10,8 @@ setopt GLOB_COMPLETE setopt correct setopt correct_all +setopt completeinword # not just at the end + autoload -Uz compinit && compinit @@ -17,7 +19,7 @@ autoload -Uz compinit && compinit # History # -------- -HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history +HISTFILE=${ZDOTDIR:-~}/.zsh_history SAVEHIST=50000 HISTSIZE=10000 HISTORY_IGNORE="(ls|cd|pwd|zsh|exit|cd ..)" @@ -38,16 +40,34 @@ setopt no_beep # Don't beep on command input error # -------- # Include functions -fpath+=$HOME/Git/dotfiles/functions +fpath+=~/Git/dotfiles/functions autoload extract # Load bashcompinit for some old bash completions autoload bashcompinit && bashcompinit source $ZDOTDIR/.zshrc.local -source $HOME/.aliases -source $HOME/.aliases.local +source ~/.aliases +source ~/.aliases.local +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +# -------- # Plugins +# -------- source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -source "$ZDOTDIR/zsh-vim-mode/zsh-vim-mode.plugin.zsh" + +source "$ZDOTDIR/plugins/zsh-vim-mode/zsh-vim-mode.plugin.zsh" + +# https://github.com/arzzen/calc.plugin.zsh +source "$ZDOTDIR/plugins/calc.plugin.zsh/calc.plugin.zsh" + +# https://github.com/lukechilds/zsh-better-npm-completion +source "$ZDOTDIR/plugins/.zsh-better-npm-completion/zsh-better-npm-completion.plugin.zsh" + +# https://github.com/sunlei/zsh-ssh +source "$ZDOTDIR/plugins/zsh-ssh/zsh-ssh.zsh" + + +# https://github.com/Tarrasch/zsh-bd +source "$ZDOTDIR/plugins/bd/bd.zsh"