From 6949679bf38262824b402d090dc77c3d0f96fef1 Mon Sep 17 00:00:00 2001 From: don philipe Date: Mon, 19 Feb 2024 20:56:09 +0100 Subject: [PATCH] Add zsh configuration --- .zsh-custom/themes/don.zsh-theme | 8 +++ .zshrc | 118 +++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 .zsh-custom/themes/don.zsh-theme create mode 100644 .zshrc diff --git a/.zsh-custom/themes/don.zsh-theme b/.zsh-custom/themes/don.zsh-theme new file mode 100644 index 0000000..386ab65 --- /dev/null +++ b/.zsh-custom/themes/don.zsh-theme @@ -0,0 +1,8 @@ +# Load version control information +autoload -Uz vcs_info +# Show branch information in brackets +zstyle ':vcs_info:git:*' formats '(%b)' +precmd() { vcs_info } + +PROMPT="%B[%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[cyan]%}%m%{$reset_color%}%~]>> " +RPROMPT="%F{yellow}\$vcs_info_msg_0_%f" diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..67f59db --- /dev/null +++ b/.zshrc @@ -0,0 +1,118 @@ +# Path to your oh-my-zsh installation. +ZSH=/usr/share/oh-my-zsh/ + +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="don" + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) +# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +HIST_STAMPS="yyyy-mm-dd" + +# Would you like to use another custom folder than $ZSH/custom? +ZSH_CUSTOM=$HOME/.zsh-custom + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git) + + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. + +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 + +setopt appendhistory autocd extendedglob +setopt GLOB_COMPLETE +unsetopt beep + +### Enter Vim-Mode ### +bindkey -v + +### enable incr. search with Strg-r ### +bindkey -M viins '^r' history-incremental-pattern-search-backward +bindkey -M vicmd '^r' history-incremental-pattern-search-backward +bindkey "^[[A" history-beginning-search-backward +bindkey "^[[B" history-beginning-search-forward + +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '$HOME/.zshrc' +autoload -Uz compinit +compinit +# colors for the custom prompt: +autoload -U colors && colors +# for predefined prompts: +autoload -U promptinit +promptinit + +export XDG_CONFIG_HOME=$HOME/.config/ +export EDITOR=vim + +alias ls='ls --color=always' +alias grep='grep --color=always' +alias less='less -R' +alias dd='dd status=progress oflag=direct' +alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' +alias hibernate='sudo systemctl hibernate' +alias ssh="TERM=linux ssh" # for not complaining urxvt about terminals without TERM set +alias cpup="cp -T $0 ../$0" +alias pythonweb="python -m SimpleHTTPServer 8090"