diff options
author | Guangxiong Lin <[email protected]> | 2022-02-06 17:17:53 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-02-06 17:17:53 +0800 |
commit | aaa9a733586e459341ea5b3123c2b241e6656c03 (patch) | |
tree | 9869231c94ae47063d36b32a2da596a374027161 | |
parent | c1c4586895bc8fc1ebc1e3fab6587902ef81cc6d (diff) | |
download | dotfiles-aaa9a733586e459341ea5b3123c2b241e6656c03.tar.gz dotfiles-aaa9a733586e459341ea5b3123c2b241e6656c03.tar.bz2 dotfiles-aaa9a733586e459341ea5b3123c2b241e6656c03.zip |
Restructure zshrc config
-rw-r--r-- | .aliases | 1 | ||||
-rwxr-xr-x | .zplugrc | 23 | ||||
-rw-r--r-- | .zshrc | 46 | ||||
-rwxr-xr-x | scripts/bootstrap.sh | 2 |
4 files changed, 32 insertions, 40 deletions
@@ -1,6 +1,7 @@ #!/usr/bin/env bash alias ls='ls --color=auto' +alias ll='ls --color=auto -lh' alias diff='diff --color=auto' alias grep='grep --color=auto' diff --git a/.zplugrc b/.zplugrc new file mode 100755 index 0000000..ca5358a --- /dev/null +++ b/.zplugrc @@ -0,0 +1,23 @@ +#!/usr/bin/env zsh + +export ZPLUG_HOME=$HOME/.zplug + +if [ ! -d $ZPLUG_HOME ]; then + echo 'Installing zplug ... ' + git clone https://github.com/zplug/zplug.git $ZPLUG_HOME +fi +source $ZPLUG_HOME/init.zsh + +zplug "plugins/git", from:oh-my-zsh +zplug "zsh-users/zsh-completions" +zplug "zsh-users/zsh-syntax-highlighting" +zplug "dracula/zsh", as:theme + +if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi +fi + +zplug load @@ -20,47 +20,15 @@ HISTFILE=~/.zsh_history source $HOME/.path source $HOME/.env +source $HOME/.aliases +source $HOME/.functions [[ -r /usr/share/z/z.sh ]] && source /usr/share/z/z.sh [[ -r /usr/local/etc/profile.d/z.sh ]] && source /usr/local/etc/profile.d/z.sh -# System Specific -case `uname` in -Darwin) - # Alias - alias ll='ls -lhG' - - source ~/.macos -;; -Linux) - # commands for Linux -;; -FreeBSD) - # commands for FreeBSD -;; -esac - -# zplug -if [ ! -d ~/.zplug ]; then - echo 'Installing zplug ... ' - git clone https://github.com/zplug/zplug.git ~/.zplug -fi -source ~/.zplug/init.zsh -zplug "plugins/git", from:oh-my-zsh -zplug "zsh-users/zsh-completions" -zplug "zsh-users/zsh-syntax-highlighting" -zplug "dracula/zsh", as:theme -if ! zplug check --verbose; then - printf "Install? [y/N]: " - if read -q; then - echo; zplug install - fi -fi -zplug load - -source $HOME/.aliases -source $HOME/.functions -[ -f $HOME/.zsh_local ] && source $HOME/.zsh_local +[ -r $HOME/.zplugrc ] && source $HOME/.zplugrc +[ -r $HOME/.nnnrc ] && source $HOME/.nnnrc +[ -r $HOME/.fzfrc ] && source $HOME/.fzfrc -[ -f $HOME/.nnnrc ] && source $HOME/.nnnrc -[ -f $HOME/.fzfrc ] && source $HOME/.fzfrc +[[ $(uname) == Darwin ]] && [ -r $HOME/.macos ] && source $HOME/.macos +[ -r $HOME/.zsh_local ] && source $HOME/.zsh_local diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index dc5d3cc..842680f 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -21,7 +21,7 @@ link_all () { .mbsyncrc .msmtprc .tmux.conf .urlview .zshrc \ .vimrc .vim .path .functions .emacs.d .gitconfig \ .config/i3 .config/polybar .xinitrc .pam_environment \ - .zprofile .newsboat .ledgerrc .nnnrc .alacritty.yml .fzfrc + .zprofile .newsboat .ledgerrc .nnnrc .alacritty.yml .fzfrc .zplugrc } main () { |