Skip to content

Instantly share code, notes, and snippets.

@huytd
Last active February 15, 2023 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huytd/0d1f8d9e3bea6f2fe19e399f071fa55d to your computer and use it in GitHub Desktop.
Save huytd/0d1f8d9e3bea6f2fe19e399f071fa55d to your computer and use it in GitHub Desktop.
Make Zsh act like a Fish shell
alias ls="ls -G"
alias ll="ls -lAh"
alias st="git status"
alias vim="nvim"
alias dff="git diff"
alias lg "git log --pretty=format:'%Cblue%>(12)%ad %C(yellow)%h %Cgreen%<(7)%aN%Cred%d %Creset%s' --date=short"
alias ad="git add -A"
alias cm="git commit -m"
alias gc="git checkout"
alias rgf="rg --files --hidden | rg"
autoload -U promptinit && promptinit
# Color settings
autoload -U colors && colors
export LSCOLORS="Exfxcxdxbxegedabagacad"
PROMPT="%{$fg[green]%}$ %{$reset_color%}" # Left: $_
RPROMPT="%~" # Right: Current directory from $HOME
setopt auto_cd
setopt multios
setopt prompt_subst
setopt complete_in_word
zstyle ':completion:*' completer _extensions _complete _approximate
zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+l:|=* r:|=*'
zstyle ':completion:*' menu select
autoload -U compinit && compinit
# Laod plugins
[ -f ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh ] && source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
[ -f ~/.zsh/zsh-z/zsh-z.plugin.zsh ] && source ~/.zsh/zsh-z/zsh-z.plugin.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Key bindings
bindkey -e # emacs style, like fish
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(buffer-empty bracketed-paste accept-line push-line-or-edit)
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_USE_ASYNC=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment