From b5d0e67580f96b2fe90973bb156f1a62a874eb55 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 13 Oct 2023 16:17:26 -0400 Subject: Move .zshrc to new ZDOTDIR --- .config/zsh/.zshrc | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++ .profile | 5 +-- .zshrc | 102 ----------------------------------------------------- 3 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 .config/zsh/.zshrc delete mode 100644 .zshrc diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc new file mode 100644 index 0000000..60790f1 --- /dev/null +++ b/.config/zsh/.zshrc @@ -0,0 +1,102 @@ +# ______ _____ _ _ +# |___ // ____| | | | +# / /| (___ | |__| | +# / / \___ \| __ | +# / /__ ____) | | | | +# /_____|_____/|_| |_| +# + +# The following lines were added by compinstall +zstyle ':completion:*' completer _complete _ignored _correct _approximate +zstyle ':completion:*' file-sort name +zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-,]=** r:|=**' +zstyle ':completion:*' preserve-prefix '//[^/]##/' +zstyle ':completion:*' squeeze-slashes true +zstyle :compinstall filename '/home/master/.zshrc' + +autoload -Uz compinit +zstyle ':completion:*' menu select +zmodload zsh/complist + +compinit +# End of lines added by compinstall + +# Vim keys in tab complete menu: +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history + +export KEYTIMEOUT=1 + +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[4 q' + fi +} +zle -N zle-keymap-select + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[4 q" +} +zle -N zle-line-init + +# Use beam shape cursor on startup. +echo -ne '\e[4 q' +# Use beam shape cursor for each new prompt. +preexec() { echo -ne '\e[4 q' ;} + + +# Lines configured by zsh-newuser-install +HISTFILE=~/.cache/zsh-history +HISTSIZE=1000 +SAVEHIST=10000 +setopt appendhistory autocd extendedglob nomatch +unsetopt beep notify +bindkey -v +# End of lines configured by zsh-newuser-install + +# Git current branch setup +autoload -Uz vcs_info +precmd_vcs_info() { vcs_info } +precmd_functions+=( precmd_vcs_info ) +setopt prompt_subst + +# Prompt theme +PROMPT=" %B%F{blue}𝄞 %b%F{yellow}" +# PROMPT=" %B%F{blue}𝜑 %b%F{yellow}" +# PROMPT=" %B%F{blue}π %b%F{yellow}" +# RPROMPT="\$vcs_info_msg_1_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" +RPROMPT="\$vcs_info_msg_0_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" + +zstyle ':vcs_info:git:*' formats '%b' + +# Loading shortcuts made by aliasgen and shortcutgen +source $HOME/.cache/zsh-aliases* +source $HOME/.cache/zsh-shortcuts +source $HOME/.cache/shell-vars + +lfcd () { + tmp="$(mktemp -uq)" + trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT + lfub -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +alias f='lfcd' + + +# Load zsh-syntax-highlighting; should be last. +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null + diff --git a/.profile b/.profile index d55f3fe..6a40b58 100644 --- a/.profile +++ b/.profile @@ -18,8 +18,9 @@ export REFERBIB=$HOME/Dropbox/A/Scholar/All/References/bibliography.refer export DISTRIB_ID=arch export DISTRIB_RELEASE=$(uname -r) export XDG_CONFIG_HOME=$HOME/.config +export XDG_DATA_HOME=$HOME/.local/share export R_PROFILE_USER=$HOME/.config/R/Rprofile -export TODOIST_API_KEY="$(pass Todoist/API)" +export ZDOTDIR=$HOME/.config/zsh # export GOROOT=/usr/bin/go # fix "xdg-open fork-bomb" export your preferred browser from here @@ -47,4 +48,4 @@ eval "$(gh completion -s zsh)" shortcutgen aliasgen . "$HOME/.cargo/env" -export PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linuxexport PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linuxexport PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linux \ No newline at end of file +export PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linuxexport PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linuxexport PATH=$PATH:/home/master/.local/src/Geekbench-6.2.0-Linux diff --git a/.zshrc b/.zshrc deleted file mode 100644 index 60790f1..0000000 --- a/.zshrc +++ /dev/null @@ -1,102 +0,0 @@ -# ______ _____ _ _ -# |___ // ____| | | | -# / /| (___ | |__| | -# / / \___ \| __ | -# / /__ ____) | | | | -# /_____|_____/|_| |_| -# - -# The following lines were added by compinstall -zstyle ':completion:*' completer _complete _ignored _correct _approximate -zstyle ':completion:*' file-sort name -zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-,]=** r:|=**' -zstyle ':completion:*' preserve-prefix '//[^/]##/' -zstyle ':completion:*' squeeze-slashes true -zstyle :compinstall filename '/home/master/.zshrc' - -autoload -Uz compinit -zstyle ':completion:*' menu select -zmodload zsh/complist - -compinit -# End of lines added by compinstall - -# Vim keys in tab complete menu: -bindkey -M menuselect 'h' vi-backward-char -bindkey -M menuselect 'k' vi-up-line-or-history -bindkey -M menuselect 'l' vi-forward-char -bindkey -M menuselect 'j' vi-down-line-or-history - -export KEYTIMEOUT=1 - -# Change cursor shape for different vi modes. -function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[1 q' - - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[4 q' - fi -} -zle -N zle-keymap-select - -zle-line-init() { - zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) - echo -ne "\e[4 q" -} -zle -N zle-line-init - -# Use beam shape cursor on startup. -echo -ne '\e[4 q' -# Use beam shape cursor for each new prompt. -preexec() { echo -ne '\e[4 q' ;} - - -# Lines configured by zsh-newuser-install -HISTFILE=~/.cache/zsh-history -HISTSIZE=1000 -SAVEHIST=10000 -setopt appendhistory autocd extendedglob nomatch -unsetopt beep notify -bindkey -v -# End of lines configured by zsh-newuser-install - -# Git current branch setup -autoload -Uz vcs_info -precmd_vcs_info() { vcs_info } -precmd_functions+=( precmd_vcs_info ) -setopt prompt_subst - -# Prompt theme -PROMPT=" %B%F{blue}𝄞 %b%F{yellow}" -# PROMPT=" %B%F{blue}𝜑 %b%F{yellow}" -# PROMPT=" %B%F{blue}π %b%F{yellow}" -# RPROMPT="\$vcs_info_msg_1_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" -RPROMPT="\$vcs_info_msg_0_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})" - -zstyle ':vcs_info:git:*' formats '%b' - -# Loading shortcuts made by aliasgen and shortcutgen -source $HOME/.cache/zsh-aliases* -source $HOME/.cache/zsh-shortcuts -source $HOME/.cache/shell-vars - -lfcd () { - tmp="$(mktemp -uq)" - trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT - lfub -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi -} -alias f='lfcd' - - -# Load zsh-syntax-highlighting; should be last. -source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null - -- cgit v1.2.3