Skip to content

Instantly share code, notes, and snippets.

@jtyr
Last active January 9, 2023 20:17
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtyr/be0e6007bd22c9d51e8702a70430d116 to your computer and use it in GitHub Desktop.
Save jtyr/be0e6007bd22c9d51e8702a70430d116 to your computer and use it in GitHub Desktop.
ZSH configuration for GBT
###[ ZSH ]
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt append_history
setopt extended_history
setopt hist_expire_dups_first
setopt hist_ignore_dups
setopt hist_ignore_space
setopt hist_verify
setopt inc_append_history
setopt share_history
# Prompt
autoload -U promptinit
promptinit
setopt PROMPT_SUBST
# Other options
setopt rmstarsilent
setopt interactivecomments
# Keybinding
bindkey -e
bindkey '^i' expand-or-complete-prefix
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
bindkey "${terminfo[khome]}" beginning-of-line
bindkey "${terminfo[kend]}" end-of-line
bindkey "${terminfo[kcbt]}" reverse-menu-complete
bindkey "${terminfo[kdch1]}" delete-char
autoload -U select-word-style
select-word-style bash
# Auto-completion
autoload -U compinit
compinit
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select
###[ Other ]
# Default editor
export EDITOR='vim'
# Aliases
alias grep='/usr/bin/grep --color=auto'
alias ll='ls --color -l'
alias ls='ls --color=auto'
# Midnight Commander chdir enhancement
if [ -f /usr/lib/mc/mc.sh ]; then
source /usr/lib/mc/mc.sh
fi
# Syntax highlighting
if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=cyan'
ZSH_HIGHLIGHT_STYLES[comment]='fg=white,bold'
fi
# History substring serach
if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
fi
# GBT prompt forwarding
export GBT__HOME='/usr/share/gbt'
if [ -f $GBT__HOME/sources/gbts/cmd/local.sh ]; then
source $GBT__HOME/sources/gbts/cmd/local.sh
fi
# Basic prompt for non-graphical terminals
if [[ "$TERM" != xterm* ]] && [ -f $GBT__HOME/themes/basic.sh ]; then
source $GBT__HOME/themes/basic.sh
fi
# GBT prompt
PROMPT='$(gbt $?)'
@skmrSharma
Copy link

skmrSharma commented Oct 26, 2019

you need to add the following lines to enable utf encoding:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

@jtyr
Copy link
Author

jtyr commented Feb 20, 2020

That should be set in your system locale. It should be set in one of these files (depends on your Linux distro):

# Ubuntu, Debian
/etc/default/locale
# CentOS, RHEL, Arch Linux
/etc/locale.conf

If you are using KDE Plasma, you should ~/.config/plasma-localerc and if that's set to LANG=C you should disable it in System Settings -> Regional Settings -> Formats -> Region -> No change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment