Zsh

until now, my opinion has been to keep bash as shell mostly since it's the default and you won't have zsh on a remote server.

then I did enjoy using fzf to dig in the history. as a result, I already feel in degraded mode on remote servers.

also I gess zsh provides confort for mind and finger over bash.

today my opinion, is to embrase zsh and benefit from community aliases and lazy features on my work stations, and install it on server I am using a lot. On others, that's just fine.

killer feature (not included in bash) includes:

  1. share history among all terminals
  2. support multiline command history
  3. path completion, eg: /u/l/b -> cd /usr/local/bin
  4. open file w/ default app, based on file extension alias -s

install

apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s $(which zsh)
# then reboot

fzf

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
# append to ~/.zshrc
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

oh-my-zsh

ZSH_THEME="amuse"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
plugins=(git debian pass direnv pyenv)
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index f34c072..7e0715c 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -159,7 +159,8 @@ alias gcor='git checkout --recurse-submodules'
 alias gcb='git checkout -b'
 alias gcB='git checkout -B'
 alias gcd='git checkout $(git_develop_branch)'
-alias gcm='git checkout $(git_main_branch)'
+#alias gcm='git checkout $(git_main_branch)'
+alias gcm='git commit --message'
 alias gcp='git cherry-pick'
 alias gcpa='git cherry-pick --abort'
 alias gcpc='git cherry-pick --continue'
diff --git a/themes/amuse.zsh-theme b/themes/amuse.zsh-theme
index cddbcd4..9078f48 100644
--- a/themes/amuse.zsh-theme
+++ b/themes/amuse.zsh-theme
@@ -10,9 +10,8 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
 ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹"
 ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}"

-PROMPT='
-%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)$(virtualenv_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
-$ '
+PROMPT='%{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)$(virtualenv_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%}
+'

 RPROMPT='$(ruby_prompt_info)'

Auto suggestion / completion /highlight

make zle compliant with readline

zle -A emacs-forward-word forward-word
bindkey \^U backward-kill-line

React ?

This page was last modified: