From aa44efa7c7b4289dd8e07f2f9d4a7adeb2638d51 Mon Sep 17 00:00:00 2001 From: zymon Date: Mon, 10 Jun 2024 23:06:02 +0200 Subject: [PATCH] aktu zsh konf --- .gitignore | 5 +++++ .zshenv | 25 +++++++++++++++---------- config/zsh/.zshrc | 27 +++++++++++++++++++++++++++ config/zsh/zsh_plugins.txt | 7 +++++++ install.sh | 12 ++++++++++++ 5 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 config/zsh/.zshrc create mode 100644 config/zsh/zsh_plugins.txt create mode 100755 install.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5fe353 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.antidote +.p10k.zsh +.zcompdump +.zsh_history +zsh_plugins.zsh diff --git a/.zshenv b/.zshenv index 9721355..c80b658 100644 --- a/.zshenv +++ b/.zshenv @@ -2,24 +2,29 @@ # # .zshenv - Zsh environment file, loaded always. # -# NOTE: .zshenv needs to live at ~/.zshenv, not in $ZDOTDIR! +# NOTE: .zshenv needs to live at ~/.zshenv, not in $ZDOTDIR, +# unless /etz/zsh/zshenv is not updated. -export PATH="$HOME/.local/bin:$PATH" -export PATH="$HOME/.local/share/cargo/bin:$PATH" -export PATH="$HOME/.local/share/juliaup/bin:$PATH" +export XDG_STATE_HOME="$HOME/.local/state" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_BIN_HOME="$HOME/.local/bin" +export XDG_CACHE_HOME="$HOME/.cache" + +export PATH="${XDG_BIN_HOME}:$PATH" +export PATH="${XDG_DATA_HOME}/cargo/bin:$PATH" +export PATH="${XDG_DATA_HOME}/juliaup/bin:$PATH" export EDITOR="nvim" export TERMINAL="st" export BROWSER="librewolf" -export XDG_STATE_HOME="$HOME/.local/state" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CACHE_HOME="$HOME/.cache" - export ZDOTDIR="${XDG_CONFIG_HOME}/zsh" -export HISTFILE="$XDG_DATA_HOME/history" +export HISTFILE="${ZDOTDIR}/.zsh_history" +export HISTSIZE=50000 +export SAVEHIST=$HISTSIZE + export MANPAGER="nvim +Man! -" export LESSHISTFILE="/dev/null" diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc new file mode 100644 index 0000000..3289ea7 --- /dev/null +++ b/config/zsh/.zshrc @@ -0,0 +1,27 @@ +## Plugin manager + +[ ! -d ${ZDOTDIR:-$HOME}/.antidote ] && git clone --depth=1 https://github.com/mattmc3/antidote.git ${ZDOTDIR:-$HOME}/.antidote + +source ${ZDOTDIR:-$HOME}/.antidote/antidote.zsh +antidote load ${ZDOTDIR:-$HOME}/zsh_plugins.txt + +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. +[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh + +## + +autoload -U compinit +compinit -C +zstyle ':completion:*' menu select + + +setopt appendhistory +setopt hist_ignore_all_dups + +bindkey '^[[A' history-substring-search-up # or '\eOA' +bindkey '^[[B' history-substring-search-down # or '\eOB' +HISTORY_SUBSTRING_SEARCH_ENSURE_UNIQUE=1 + + +alias lf='lfrun' +alias ls='ls --color' diff --git a/config/zsh/zsh_plugins.txt b/config/zsh/zsh_plugins.txt new file mode 100644 index 0000000..8f3c553 --- /dev/null +++ b/config/zsh/zsh_plugins.txt @@ -0,0 +1,7 @@ +romkatv/powerlevel10k + +zsh-users/zsh-autosuggestions +zsh-users/zsh-syntax-highlighting +zsh-users/zsh-history-substring-search + +joshskidmore/zsh-fzf-history-search diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..45a6b92 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +#!/bin/zsh + +BASEDIR=$(pwd) + +source .zshenv + +ln --force --symbolic $BASEDIR/.zshenv $HOME/.zshenv + +mkdir -p "${XDG_CONFIG_HOME}" +mkdir -p "${XDG_DATA_HOME}" + +ln --force --symbolic --no-dereference $BASEDIR/config/zsh/ "${XDG_CONFIG_HOME}/zsh"