Skip to content

Instantly share code, notes, and snippets.

@thistac
Last active March 8, 2021 19:35
Show Gist options
  • Save thistac/114c851d3297b429d3b02db665ea2fd3 to your computer and use it in GitHub Desktop.
Save thistac/114c851d3297b429d3b02db665ea2fd3 to your computer and use it in GitHub Desktop.
ZSH Basic Config Ubuntu
#sudo passwd $USER
#sudo apt-get install git zsh chroma zsh-autosuggestions zsh-syntax-highlighting command_not_found locales
#sudo locale-gen pt_BR.UTF-8
#sudo dpkg-reconfigure locales
#sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Path to your oh-my-zsh installation.
export ZSH="/home/ubuntu/.oh-my-zsh"
# Set name of the theme to load
ZSH_THEME="powerlevel10k/powerlevel10k"
# Change the command execution time stamp shown in the history command output.
HIST_STAMPS="mm/dd/yyyy"
# Which plugins would you like to load?
plugins=(bgnotify git colorize history kate sudo docker docker-compose)
source $ZSH/oh-my-zsh.sh
# User configuration
#Bind keys Home and End on xterm
#echo $TERM
#cat hit enter, hit keys, after ctrl+c to exit
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
#Colorize tool
[[ ! -x /usr/bin/chroma ]] || ZSH_COLORIZE_TOOL=chroma
#Command not found handler Ubuntu
if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
function command_not_found_handler {
# check because c-n-f could've been removed in the meantime
if [ -x /usr/lib/command-not-found ]; then
/usr/lib/command-not-found -- "$1"
return $?
elif [ -x /usr/share/command-not-found/command-not-found ]; then
/usr/share/command-not-found/command-not-found -- "$1"
return $?
else
printf "zsh: command not found: %s\n" "$1" >&2
return 127
fi
return 0
}
fi
export LANG=pt_BR.UTF-8
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
ZSH_SYNTAX_HIGHLIGHTING=/usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
ZSH_AUTOSUGGETSTIONS=/usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
[[ ! -f $ZSH_SYNTAX_HIGHLIGHTING ]] || source $ZSH_SYNTAX_HIGHLIGHTING
[[ ! -f $ZSH_AUTOSUGGETSTIONS ]] || source $ZSH_AUTOSUGGETSTIONS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment