Skip to content

Instantly share code, notes, and snippets.

@doct0rX
Created August 14, 2019 16:01
Show Gist options
  • Save doct0rX/4a21344aabef33a46e045cff7f7b91e9 to your computer and use it in GitHub Desktop.
Save doct0rX/4a21344aabef33a46e045cff7f7b91e9 to your computer and use it in GitHub Desktop.
my .zshrc (oh-my-zsh) configuration file on Arch Linux
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=99999
SAVEHIST=99999
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/mustafaj4m/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/
export DEFAULT_USER="fernando"
export TERM="xterm-256color"
export ZSH=/usr/share/oh-my-zsh
# ZSH_THEME="powerlevel9k/powerlevel9k"
ZSH_THEME="powerleve/powerlevel9k"
POWERLEVEL9K_MODE="nerdfont-complete"
# source $ZSH/themes/powerlevel9k/powerlevel9k.zsh-theme
POWERLEVEL9K_FOLDER_ICON=""
# POWERLEVEL9K_HOME_SUB_ICON="$(print_icon "HOME_ICON")"
# POWERLEVEL9K_DIR_PATH_SEPARATOR=" $(print_icon "LEFT_SUBSEGMENT_SEPARATOR") "
POWERLEVEL9K_HOME_SUB_ICON=' '
POWERLEVEL9K_DIR_PATH_SEPARATOR='  '
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='black'
POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='178'
POWERLEVEL9K_NVM_BACKGROUND="238"
POWERLEVEL9K_NVM_FOREGROUND="green"
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="blue"
POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="015"
POWERLEVEL9K_TIME_BACKGROUND='255'
POWERLEVEL9K_COMMAND_TIME_FOREGROUND='gray'
POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='245'
POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='black'
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator context dir dir_writable vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status background_jobs command_execution_time time)
POWERLEVEL9K_SHOW_CHANGESET=true
HYPHEN_INSENSITIVE="true"
COMPLETION_WAITING_DOTS="true"
# /!\ do not use with zsh-autosuggestions
plugins=(archlinux
asdf
bundler
docker
jsontools
vscode
web-search
k
tig
gitfast
colored-man-pages
colorize
command-not-found
cp
dirhistory
autojump
sudo
zsh-syntax-highlighting
git ssh-agent
)
# /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end
source $ZSH/oh-my-zsh.sh
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
typeset -gA ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[cursor]='bold'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[command]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green,bold'
rule () {
print -Pn '%F{blue}'
local columns=$(tput cols)
for ((i=1; i<=columns; i++)); do
printf "\u2588"
done
print -P '%f'
}
function _my_clear() {
echo
rule
zle clear-screen
}
zle -N _my_clear
bindkey '^l' _my_clear
# Ctrl-O opens zsh at the current location, and on exit, cd into ranger's last location.
ranger-cd() {
tempfile=$(mktemp)
ranger --choosedir="$tempfile" "${@:-$(pwd)}" < $TTY
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
# hacky way of transferring over previous command and updating the screen
VISUAL=true zle edit-command-line
}
zle -N ranger-cd
bindkey '^o' ranger-cd
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
ZSH_CACHE_DIR=$HOME/.cache/oh-my-zsh
if [[ ! -d $ZSH_CACHE_DIR ]]; then
mkdir $ZSH_CACHE_DIR
fi
source $ZSH/oh-my-zsh.sh
alias open="xdg-open"
source /usr/share/zsh-theme-powerlevel9k/powerlevel9k.zsh-theme
# for github ssh
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
source /home/mustafaj4m/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# to start the agent automatically and make sure that only one ssh-agent process runs at a time
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
eval "$(<~/.ssh-agent-thing)"
fi
@doct0rX
Copy link
Author

doct0rX commented Aug 14, 2019

Using:

  • LXTerminal
  • Hack Nerd Font Regular
  • Nemo for files

@doct0rX
Copy link
Author

doct0rX commented Apr 17, 2021

this file for zsh on linux machine

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