aboutsummaryrefslogtreecommitdiff
path: root/.config/zsh
diff options
context:
space:
mode:
authorNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
committerNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
commit896c311feb10e947c727a888308dbc7eb71d1ec2 (patch)
treeb6713478d14eb8ea531107c3f399c437db7fd2fb /.config/zsh
init commit
Diffstat (limited to '.config/zsh')
-rw-r--r--.config/zsh/.zshrc45
-rw-r--r--.config/zsh/knight17
2 files changed, 62 insertions, 0 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
new file mode 100644
index 0000000..7eb08bb
--- /dev/null
+++ b/.config/zsh/.zshrc
@@ -0,0 +1,45 @@
+# Created by newuser for 5.8
+
+autoload -Uz compinit promptinit
+
+# Completion
+compinit
+zstyle ':completion::complete:*' gain-privileges 1
+zstyle ':completion:*' menu select
+
+# Prompt
+if [ "$TERM" != "linux" ]; then
+ fpath=(~/.config/zsh/ $fpath)
+ autoload -Uz knight
+ knight
+else
+ PROMPT='%n @ %m %~ %# '
+fi;
+
+STATUS="Hallo"
+
+# Keybindings
+bindkey -v
+
+# Aliases
+alias ls='ls --color=auto'
+alias la='ls -a --color=auto'
+alias ll='ls -l --color=auto -h'
+setopt COMPLETE_ALIASES
+
+# History
+export HISTSIZE=1000
+export SAVEHIST=1000
+export HISTFILE=~/.zsh_history
+setopt INC_APPEND_HISTORY
+setopt HIST_IGNORE_DUPS
+
+# Syntax Highlight
+source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
+
+source ~/.profile
+
+# Auto CD
+setopt AUTO_CD
+
+export HISTFILE="$XDG_CACHE_HOME"/zsh/history
diff --git a/.config/zsh/knight b/.config/zsh/knight
new file mode 100644
index 0000000..507212f
--- /dev/null
+++ b/.config/zsh/knight
@@ -0,0 +1,17 @@
+
+prompt_git_status() {
+ if [ -d ".git" ]; then
+ sign="\ue725";
+ [[ -n $(git status -s) ]] && sign="\ufc1a";
+ git_branch=$(git branch);
+ echo "%F{#547f62}%f%B%F{#191919}%K{#547f62} ${sign} ${git_branch##*\* } %f%k%b";
+ fi;
+}
+
+update_prompt() {
+ RPROMPT="$(prompt_git_status)"
+}
+
+PROMPT="%B%F{#191919}%K{#547f62} %n %k%b%f%F{#547f62}%K{#191919}%f%k%F{#191919}%K{#547f62}%f%k%B%K{#547f62}%F{#191919} %m %b%k%f%F{#547f62}%K{#191919}%f%k%F{#191919}%K{#7698C4}%B %~ %b%f%k%F{#7698C4}%k%f "
+
+[[ -z $precmd_functions ]] && precmd_functions=() precmd_functions=($precmd_functions update_prompt)