rework zsh config
This commit is contained in:
parent
02ddd5d737
commit
308d17d564
|
@ -1,19 +0,0 @@
|
||||||
$include /etc/inputrc
|
|
||||||
set editing-mode vi
|
|
||||||
$if mode=vi
|
|
||||||
|
|
||||||
set show-mode-in-prompt on
|
|
||||||
set vi-ins-mode-string \1\e[6 q\2
|
|
||||||
set vi-cmd-mode-string \1\e[2 q\2
|
|
||||||
|
|
||||||
set keymap vi-command
|
|
||||||
# these are for vi-command mode
|
|
||||||
Control-l: clear-screen
|
|
||||||
Control-a: beginning-of-line
|
|
||||||
|
|
||||||
set keymap vi-insert
|
|
||||||
# these are for vi-insert mode
|
|
||||||
Control-l: clear-screen
|
|
||||||
Control-a: beginning-of-line
|
|
||||||
|
|
||||||
$endif
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# profile file. Runs on login. Environmental variables are set here.
|
||||||
|
|
||||||
|
localpath="$(find -L ~/.local/bin -type d -printf %p: | sed 's/.$//')"
|
||||||
|
export PATH="$PATH:$HOME/.local/share/npm-global/bin:$localpath"
|
||||||
|
|
||||||
|
export EDITOR="nvim"
|
||||||
|
export TERMINAL="kitty"
|
||||||
|
export BROWSER="librewolf"
|
||||||
|
|
||||||
|
export XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||||
|
export XDG_DOCUMENTS_DIR="$HOME/Documents"
|
||||||
|
export XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||||
|
export XDG_MUSIC_DIR="$HOME/Music"
|
||||||
|
export XDG_PICTURES_DIR="$HOME/Pictures"
|
||||||
|
export XDG_PUBLICSHARE_DIR="$HOME/Public"
|
||||||
|
export XDG_TEMPLATES_DIR="$HOME/Templates"
|
||||||
|
export XDG_VIDEOS_DIR="$HOME/Videos"
|
||||||
|
|
||||||
|
export XDG_CONFIG_HOME="$HOME/.config"
|
||||||
|
export XDG_DATA_HOME="$HOME/.local/share"
|
||||||
|
export XDG_CACHE_HOME="$HOME/.cache"
|
||||||
|
export PYENVS_DIR="$XDG_DATA_HOME/virtualenv"
|
||||||
|
export KEYMAPS_DIR="$HOME/.local/bin/keymaps"
|
||||||
|
export ZSH_COMPDUMP="$XDG_CACHE_HOME/zcompdump"
|
||||||
|
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME/notmuch-config"
|
||||||
|
export GTK2_RC_FILES="$XDG_CONFIG_HOME/.config}/gtk-2.0/gtkrc-2.0"
|
||||||
|
export LESSHISTFILE="-"
|
||||||
|
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
|
||||||
|
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
|
||||||
|
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
|
||||||
|
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||||
|
export WINEPREFIX="$XDG_DATA_HOME/wineprefixes/default"
|
||||||
|
export TMUX_TMPDIR="$XDG_RUNTIME_DIR"
|
||||||
|
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||||
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
|
export GOPATH="$XDG_DATA_HOME/go"
|
||||||
|
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg"
|
||||||
|
export ANSIBLE_HOME="$XDG_DATA_HOME/ansible"
|
||||||
|
export UNISON="$XDG_DATA_HOME/unison"
|
||||||
|
export HISTFILE="$XDG_DATA_HOME/history"
|
||||||
|
export GRADLE_USER_HOME="$XDG_DATA_HOME/gradle"
|
||||||
|
export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # WARN: This line can break some display managers
|
||||||
|
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
|
||||||
|
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
|
||||||
|
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
|
||||||
|
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
|
||||||
|
|
||||||
|
export FZF_DEFAULT_OPTS="--layout=reverse --height 40%"
|
||||||
|
export LESS=-R
|
||||||
|
export LESS_TERMCAP_mb="$(printf '%b' '[1;31m')"
|
||||||
|
export LESS_TERMCAP_md="$(printf '%b' '[1;36m')"
|
||||||
|
export LESS_TERMCAP_me="$(printf '%b' '[0m')"
|
||||||
|
export LESS_TERMCAP_so="$(printf '%b' '[01;44;33m')"
|
||||||
|
export LESS_TERMCAP_se="$(printf '%b' '[0m')"
|
||||||
|
export LESS_TERMCAP_us="$(printf '%b' '[1;32m')"
|
||||||
|
export LESS_TERMCAP_ue="$(printf '%b' '[0m')"
|
||||||
|
export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"
|
||||||
|
export ANSIBLE_NOCOWS=1 # Stop those fucking cows in Ansible
|
||||||
|
|
||||||
|
# Start X Server if logging in on TTY1 and no other server is running
|
||||||
|
[ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startgraphical
|
|
@ -1,121 +1,14 @@
|
||||||
autoload -U colors && colors
|
source $ZDOTDIR/configs/vars
|
||||||
autoload edit-command-line && zle -N edit-command-line
|
source $ZDOTDIR/configs/setup
|
||||||
autoload -U add-zsh-hook
|
source $ZDOTDIR/configs/widgets
|
||||||
autoload -U compinit
|
source $ZDOTDIR/configs/bindings
|
||||||
autoload -Uz edit-command-line
|
source $ZDOTDIR/configs/aliases
|
||||||
|
|
||||||
source ${ZDOTDIR:-$HOME}/.kubernetesrc_ansible
|
source $ZDOTDIR/configs/autogenerated/shortcuts
|
||||||
|
source $ZDOTDIR/configs/autogenerated/hashes
|
||||||
|
|
||||||
PS1="%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%f%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b "
|
source $ZDOTDIR/functions/kubernetesrc_ansible
|
||||||
RPS1="%(?..%F{red}%?)"
|
|
||||||
stty stop undef # Disable ctrl-s to freeze terminal.
|
|
||||||
setopt HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS HIST_VERIFY BANG_HIST interactive_comments autocd noflowcontrol longlistjobs nonomatch notify hash_list_all share_history histignorespace
|
|
||||||
|
|
||||||
# History in cache directory:
|
source $ZDOTDIR/plugins/fzf/bindings.zsh
|
||||||
HISTSIZE=10000000
|
source $ZDOTDIR/plugins/autopyenv/autopyenv.zsh
|
||||||
SAVEHIST=10000000
|
source $ZDOTDIR/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
|
||||||
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
|
|
||||||
|
|
||||||
# Load aliases and shortcuts if existent.
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
|
||||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
|
||||||
|
|
||||||
# Basic auto/tab complete:
|
|
||||||
zstyle ':completion:*' menu select
|
|
||||||
zmodload zsh/complist
|
|
||||||
compinit
|
|
||||||
_comp_options+=(globdots) # Include hidden files.
|
|
||||||
|
|
||||||
# vi mode
|
|
||||||
zle -N edit-command-line
|
|
||||||
bindkey -M vicmd v edit-command-line
|
|
||||||
bindkey -v
|
|
||||||
export KEYTIMEOUT=1
|
|
||||||
|
|
||||||
# Use 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
|
|
||||||
|
|
||||||
|
|
||||||
# Change cursor shape for different vi modes.
|
|
||||||
function zle-keymap-select () {
|
|
||||||
case $KEYMAP in
|
|
||||||
vicmd) echo -ne '\e[1 q';; # block
|
|
||||||
viins|main) echo -ne '\e[5 q';; # beam
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
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[5 q"
|
|
||||||
}
|
|
||||||
zle -N zle-line-init
|
|
||||||
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
|
||||||
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|
||||||
|
|
||||||
# Use lf to switch directories and bind it to ctrl-o
|
|
||||||
function lfcd () {
|
|
||||||
tmp="$(mktemp)"
|
|
||||||
fid="$(mktemp)"
|
|
||||||
lf -command '$printf $id > '"$fid"'' -last-dir-path="$tmp" "$@"
|
|
||||||
id="$(cat "$fid")"
|
|
||||||
archivemount_dir="/tmp/__lf_archivemount_$id"
|
|
||||||
if [ -f "$archivemount_dir" ]; then
|
|
||||||
cat "$archivemount_dir" | \
|
|
||||||
while read -r line; do
|
|
||||||
sudo umount "$line"
|
|
||||||
rmdir "$line"
|
|
||||||
done
|
|
||||||
command rm -f "$archivemount_dir"
|
|
||||||
fi
|
|
||||||
if [ -f "$tmp" ]; then
|
|
||||||
dir="$(cat "$tmp")"
|
|
||||||
command rm -f "$tmp"
|
|
||||||
if [ -d "$dir" ]; then
|
|
||||||
if [ "$dir" != "$(pwd)" ]; then
|
|
||||||
cd "$dir"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
tput cuu1;tput el
|
|
||||||
}
|
|
||||||
|
|
||||||
function _lfcd () {
|
|
||||||
BUFFER="lfcd"
|
|
||||||
zle accept-line
|
|
||||||
}
|
|
||||||
zle -N _lfcd
|
|
||||||
bindkey '^e' _lfcd
|
|
||||||
|
|
||||||
# bind lazygit to ctrl-g
|
|
||||||
function lg () {
|
|
||||||
[ ! -d "$(pwd)/.git" ] && [[ $(read -ek "?Not in a git repository. Create a new git repository? (y/n): ") =~ ^[Yy]$ ]] && git init
|
|
||||||
[ -d "$(pwd)/.git" ] && lazygit -p $(pwd)
|
|
||||||
zle reset-prompt
|
|
||||||
}
|
|
||||||
zle -N lg{,}
|
|
||||||
bindkey '^g' lg
|
|
||||||
|
|
||||||
function write_info(){
|
|
||||||
echo -n "${VIRTUAL_ENV}" > "/tmp/current_venv-$$"
|
|
||||||
}
|
|
||||||
add-zsh-hook precmd write_info
|
|
||||||
|
|
||||||
# other keybinds
|
|
||||||
bindkey -v '^?' backward-delete-char
|
|
||||||
bindkey '^[[P' delete-char
|
|
||||||
bindkey "^[[H" beginning-of-line
|
|
||||||
bindkey '^[[F' end-of-line
|
|
||||||
bindkey '^[[1;5C' forward-word
|
|
||||||
bindkey '^[[1;5D' backward-word
|
|
||||||
|
|
||||||
# other options
|
|
||||||
zle_highlight+=(paste:none)
|
|
||||||
|
|
||||||
PLUGINS_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins"
|
|
||||||
[ -f "$PLUGINS_HOME/fzf/key-bindings.zsh" ] && source "$PLUGINS_HOME/fzf/key-bindings.zsh"
|
|
||||||
[ -f "$PLUGINS_HOME/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh" ] && source "$PLUGINS_HOME/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh"
|
|
||||||
[ -f "$PLUGINS_HOME/autopyenv/autopyenv.zsh" ] && source "$PLUGINS_HOME/autopyenv/autopyenv.zsh"
|
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
# sudo not required for some system commands
|
||||||
|
for command in mount umount sv pacman apt aptitude updatedb su shutdown poweroff reboot; do
|
||||||
|
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
|
||||||
|
done
|
||||||
|
unset command
|
||||||
|
|
||||||
|
# Verbosity and settings that you pretty much just always are going to want.
|
||||||
|
alias \
|
||||||
|
cp="cp -iv" \
|
||||||
|
mv="mv -iv" \
|
||||||
|
rm="rm -vI" \
|
||||||
|
bc="bc -ql" \
|
||||||
|
mkd="mkdir -pv" \
|
||||||
|
ffmpeg="ffmpeg -hide_banner" \
|
||||||
|
ls="ls -alhNF --color=auto --group-directories-first" \
|
||||||
|
grep="grep --color=auto" \
|
||||||
|
diff="diff --color=auto" \
|
||||||
|
nvidia-settings="nvidia-settings --config=$XDG_CONFIG_HOME/nvidia/settings"
|
||||||
|
|
||||||
|
# Colorize commands when possible.
|
||||||
|
alias \
|
||||||
|
ls="ls -hN --color=auto --group-directories-first" \
|
||||||
|
grep="grep --color=auto" \
|
||||||
|
diff="diff --color=auto" \
|
||||||
|
ccat="highlight --out-format=ansi" \
|
||||||
|
ip="ip -color=auto"
|
||||||
|
|
||||||
|
# These common commands are just too long! Abbreviate them.
|
||||||
|
alias \
|
||||||
|
ka="killall" \
|
||||||
|
e="$EDITOR" \
|
||||||
|
z="zathura" \
|
||||||
|
p="pacman" \
|
||||||
|
ar="apt remove" \
|
||||||
|
are="apt reinstall" \
|
||||||
|
ai="apt install" \
|
||||||
|
aur="apt autoremove" \
|
||||||
|
au="apt upgrade" \
|
||||||
|
kssh="kitty +kitten ssh"
|
||||||
|
|
||||||
|
# Misc.
|
||||||
|
alias \
|
||||||
|
subpush="git push --recurse-submodules=on-demand" \
|
||||||
|
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
|
||||||
|
weath="less -S ${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport" \
|
||||||
|
remvirt="virt-manager -c 'qemu+ssh://luca@192.168.178.200/system'" \
|
||||||
|
vim="nvim" \
|
||||||
|
wikidown='rclone sync cloud:files/luca/Notes ~/Documents/vimwiki' \
|
||||||
|
wikiup='rclone sync ~/Documents/vimwiki cloud:files/luca/Notes' \
|
||||||
|
ahv="export ANSIBLE_VAULT_PASSWORD_FILE=~/.ansible/secrets/ansible-homelab && ansible-vault" \
|
||||||
|
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
|
||||||
|
xpick=" xprop | awk '
|
||||||
|
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
|
||||||
|
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# vim: filetype=zsh
|
||||||
|
hash -d h=/home/luca
|
||||||
|
hash -d ch=/home/luca/.cache
|
||||||
|
hash -d cf=/home/luca/.config
|
||||||
|
hash -d dt=/home/luca/.local/share
|
||||||
|
hash -d sr=/home/luca/.local/src
|
||||||
|
hash -d it=/home/luca/.local/src/git
|
||||||
|
hash -d sc=/home/luca/.local/bin
|
||||||
|
hash -d mn=/mnt
|
||||||
|
hash -d dl=/home/luca/Downloads
|
||||||
|
hash -d dm=/home/luca/Documents
|
||||||
|
hash -d ms=/home/luca/Music
|
||||||
|
hash -d pc=/home/luca/Pictures
|
||||||
|
hash -d vd=/home/luca/Videos
|
||||||
|
hash -d dot=/home/luca/.dotfiles
|
||||||
|
hash -d bf=/home/luca/.config/shell/bm-files
|
||||||
|
hash -d bd=/home/luca/.config/shell/bm-dirs
|
||||||
|
hash -d cfx=/home/luca/.config/x11/xresources
|
||||||
|
hash -d cfX=/home/luca/.config/x11/xprofile
|
||||||
|
hash -d cfb=/home/luca/.local/src/dwmblocks/config.h
|
||||||
|
hash -d cfk=/home/luca/.config/kitty/kitty.conf
|
||||||
|
hash -d cfK=/home/luca/.config/kitty/kittyfullscreen.conf
|
||||||
|
hash -d cfv=/home/luca/.config/lvim/config.lua
|
||||||
|
hash -d cfz=/home/luca/.config/zsh/.zshrc
|
||||||
|
hash -d cfa=/home/luca/.config/shell/aliasrc
|
||||||
|
hash -d cfp=/home/luca/.config/shell/profile
|
||||||
|
hash -d cfl=/home/luca/.config/lf/lfrc
|
||||||
|
hash -d cfL=/home/luca/.config/lf/preview
|
|
@ -0,0 +1,28 @@
|
||||||
|
# vim: filetype=zsh
|
||||||
|
alias h="cd /home/luca && tput cuu1;tput el" \
|
||||||
|
ch="cd /home/luca/.cache && tput cuu1;tput el" \
|
||||||
|
cf="cd /home/luca/.config && tput cuu1;tput el" \
|
||||||
|
dt="cd /home/luca/.local/share && tput cuu1;tput el" \
|
||||||
|
sr="cd /home/luca/.local/src && tput cuu1;tput el" \
|
||||||
|
it="cd /home/luca/.local/src/git && tput cuu1;tput el" \
|
||||||
|
sc="cd /home/luca/.local/bin && tput cuu1;tput el" \
|
||||||
|
mn="cd /mnt && tput cuu1;tput el" \
|
||||||
|
dl="cd /home/luca/Downloads && tput cuu1;tput el" \
|
||||||
|
dm="cd /home/luca/Documents && tput cuu1;tput el" \
|
||||||
|
ms="cd /home/luca/Music && tput cuu1;tput el" \
|
||||||
|
pc="cd /home/luca/Pictures && tput cuu1;tput el" \
|
||||||
|
vd="cd /home/luca/Videos && tput cuu1;tput el" \
|
||||||
|
dot="cd /home/luca/.dotfiles && tput cuu1;tput el" \
|
||||||
|
bf="$EDITOR /home/luca/.config/shell/bm-files" \
|
||||||
|
bd="$EDITOR /home/luca/.config/shell/bm-dirs" \
|
||||||
|
cfx="$EDITOR /home/luca/.config/x11/xresources" \
|
||||||
|
cfX="$EDITOR /home/luca/.config/x11/xprofile" \
|
||||||
|
cfb="$EDITOR /home/luca/.local/src/dwmblocks/config.h" \
|
||||||
|
cfk="$EDITOR /home/luca/.config/kitty/kitty.conf" \
|
||||||
|
cfK="$EDITOR /home/luca/.config/kitty/kittyfullscreen.conf" \
|
||||||
|
cfv="$EDITOR /home/luca/.config/lvim/config.lua" \
|
||||||
|
cfz="$EDITOR /home/luca/.config/zsh/.zshrc" \
|
||||||
|
cfa="$EDITOR /home/luca/.config/shell/aliasrc" \
|
||||||
|
cfp="$EDITOR /home/luca/.config/shell/profile" \
|
||||||
|
cfl="$EDITOR /home/luca/.config/lf/lfrc" \
|
||||||
|
cfL="$EDITOR /home/luca/.config/lf/preview" \
|
|
@ -0,0 +1,20 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
# vi mode
|
||||||
|
bindkey -M vicmd v edit-command-line
|
||||||
|
bindkey -v
|
||||||
|
|
||||||
|
# Use 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
|
||||||
|
|
||||||
|
bindkey '^e' _lfcd
|
||||||
|
bindkey '^g' lg
|
||||||
|
|
||||||
|
bindkey -v '^?' backward-delete-char
|
||||||
|
bindkey '^[[P' delete-char
|
||||||
|
bindkey "^[[H" beginning-of-line
|
||||||
|
bindkey '^[[F' end-of-line
|
||||||
|
bindkey '^[[1;5C' forward-word
|
||||||
|
bindkey '^[[1;5D' backward-word
|
|
@ -0,0 +1,23 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
setopt HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS HIST_VERIFY BANG_HIST interactive_comments autocd noflowcontrol longlistjobs nonomatch notify hash_list_all share_history histignorespace
|
||||||
|
|
||||||
|
autoload -U colors && colors
|
||||||
|
autoload edit-command-line && zle -N edit-command-line
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
autoload -U compinit
|
||||||
|
autoload -Uz edit-command-line
|
||||||
|
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
zmodload zsh/complist
|
||||||
|
compinit
|
||||||
|
_comp_options+=(globdots)
|
||||||
|
|
||||||
|
zle_highlight+=(paste:none)
|
||||||
|
|
||||||
|
function write_info(){
|
||||||
|
echo -n "${VIRTUAL_ENV}" > "/tmp/current_venv-$$"
|
||||||
|
}
|
||||||
|
add-zsh-hook precmd write_info
|
||||||
|
|
||||||
|
echo -ne '\e[5 q' # Use beam shape cursor on startup.
|
||||||
|
preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|
@ -0,0 +1,7 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
HISTSIZE=10000000
|
||||||
|
SAVEHIST=10000000
|
||||||
|
HISTFILE="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/history"
|
||||||
|
PS1="%B%F{blue}%n%F{cyan}@%F{blue}%m %F{magenta}[%f%3~%F{magenta}] %(?.%F{green}.%F{red})»%f%b "
|
||||||
|
RPS1="%(?..%F{red}%?)"
|
||||||
|
KEYTIMEOUT=1
|
|
@ -0,0 +1,59 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
|
||||||
|
# LF Change Dir
|
||||||
|
function lfcd () {
|
||||||
|
tmp="$(mktemp)"
|
||||||
|
fid="$(mktemp)"
|
||||||
|
lf -command '$printf $id > '"$fid"'' -last-dir-path="$tmp" "$@"
|
||||||
|
id="$(cat "$fid")"
|
||||||
|
archivemount_dir="/tmp/__lf_archivemount_$id"
|
||||||
|
if [ -f "$archivemount_dir" ]; then
|
||||||
|
cat "$archivemount_dir" | \
|
||||||
|
while read -r line; do
|
||||||
|
sudo umount "$line"
|
||||||
|
rmdir "$line"
|
||||||
|
done
|
||||||
|
command rm -f "$archivemount_dir"
|
||||||
|
fi
|
||||||
|
if [ -f "$tmp" ]; then
|
||||||
|
dir="$(cat "$tmp")"
|
||||||
|
command rm -f "$tmp"
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
if [ "$dir" != "$(pwd)" ]; then
|
||||||
|
cd "$dir"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
tput cuu1;tput el
|
||||||
|
}
|
||||||
|
function _lfcd () {
|
||||||
|
BUFFER="lfcd"
|
||||||
|
zle accept-line
|
||||||
|
}
|
||||||
|
zle -N _lfcd
|
||||||
|
|
||||||
|
# Cursor Shape
|
||||||
|
function zle-keymap-select () {
|
||||||
|
case $KEYMAP in
|
||||||
|
vicmd) echo -ne '\e[1 q';; # block
|
||||||
|
viins|main) echo -ne '\e[5 q';; # beam
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
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[5 q"
|
||||||
|
}
|
||||||
|
zle -N zle-line-init
|
||||||
|
|
||||||
|
# CMDLine Edit
|
||||||
|
zle -N edit-command-line
|
||||||
|
|
||||||
|
# Lazygit
|
||||||
|
function lg () {
|
||||||
|
[ ! -d "$(pwd)/.git" ] && [[ $(read -ek "?Not in a git repository. Create a new git repository? (y/n): ") =~ ^[Yy]$ ]] && git init
|
||||||
|
[ -d "$(pwd)/.git" ] && lazygit -p $(pwd)
|
||||||
|
zle reset-prompt
|
||||||
|
}
|
||||||
|
zle -N lg{,}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
function kctl () {
|
function kctl () {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(netsyno) shift
|
(netsyno) shift
|
|
@ -0,0 +1,4 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
|
whed() {
|
||||||
|
$EDITOR "$(which "$1")"
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
# vim:set ft=zsh
|
||||||
PYENV_DIR="${PYENVS_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/virtualenv}"
|
PYENV_DIR="${PYENVS_HOME:-${XDG_DATA_HOME:-$HOME/.local/share}/virtualenv}"
|
||||||
function chpwd_activate(){
|
function chpwd_activate(){
|
||||||
[[ "$(pwd)" == "/" ]] && return 0
|
[[ "$(pwd)" == "/" ]] && return 0
|
|
@ -321,3 +321,5 @@ bindkey '^I' fzf-completion
|
||||||
eval $__fzf_completion_options
|
eval $__fzf_completion_options
|
||||||
'unset' '__fzf_completion_options'
|
'unset' '__fzf_completion_options'
|
||||||
}
|
}
|
||||||
|
Powered by Gitea Version: 1.18.3 Page: 167ms Template: 15ms
|
||||||
|
Licenses API
|
|
@ -1,9 +1,6 @@
|
||||||
[submodule ".config/nvim"]
|
[submodule ".config/nvim"]
|
||||||
path = .config/nvim
|
path = .config/nvim
|
||||||
url = https://git.snaile.de/luca/snailvim
|
url = https://git.snaile.de/luca/snailvim
|
||||||
[submodule ".local/share/zsh/plugins/fast-syntax-highlighting"]
|
|
||||||
path = .local/share/zsh/plugins/fast-syntax-highlighting
|
|
||||||
url = https://github.com/zdharma-continuum/fast-syntax-highlighting
|
|
||||||
[submodule ".local/src/dwm"]
|
[submodule ".local/src/dwm"]
|
||||||
path = .local/src/dwm
|
path = .local/src/dwm
|
||||||
url = https://git.snaile.de/luca/dwm
|
url = https://git.snaile.de/luca/dwm
|
||||||
|
@ -19,3 +16,6 @@
|
||||||
[submodule ".local/share/themes/tokyonight"]
|
[submodule ".local/share/themes/tokyonight"]
|
||||||
path = .local/share/themes/tokyonight
|
path = .local/share/themes/tokyonight
|
||||||
url = https://git.snaile.de/luca/tokyonight-theme
|
url = https://git.snaile.de/luca/tokyonight-theme
|
||||||
|
[submodule ".config/zsh/plugins/fast-syntax-highlighting"]
|
||||||
|
path = .config/zsh/plugins/fast-syntax-highlighting
|
||||||
|
url = https://github.com/zdharma-continuum/fast-syntax-highlighting
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs"
|
# Inputs
|
||||||
bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
|
bmdirs="$XDG_DATA_HOME/bookmarks/dirs"
|
||||||
|
bmfiles="$XDG_DATA_HOME/bookmarks/files"
|
||||||
|
|
||||||
# Output locations
|
# Outputs
|
||||||
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
shell_shortcuts="$ZDOTDIR/configs/autogenerated/shortcuts"
|
||||||
zsh_named_dirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
|
zsh_named_dirs="$ZDOTDIR/configs/autogenerated/hashes"
|
||||||
lf_files="${XDG_DATA_HOME:-$HOME/.local/share}/lf/shortcut-files"
|
lf_files="$XDG_DATA_HOME/lf/shortcut-files"
|
||||||
lf_dirs="${XDG_DATA_HOME:-$HOME/.local/share}/lf/shortcut-dirs"
|
lf_dirs="$XDG_DATA_HOME/lf/shortcut-dirs"
|
||||||
lf_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/lf/shortcutrc"
|
lf_shortcuts="$XDG_CONFIG_HOME/lf/shortcutrc"
|
||||||
|
|
||||||
# Remove, prepare files
|
# Remove, prepare files
|
||||||
rm -f "$shell_shortcuts" "$lf_files" "$lf_dirs" "$lf_shortcuts" "$zsh_named_dirs" 2>/dev/null
|
rm -f "$shell_shortcuts" "$lf_files" "$lf_dirs" "$lf_shortcuts" "$zsh_named_dirs" 2>/dev/null
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
h $HOME
|
||||||
|
ch $XDG_CACHE_HOME
|
||||||
|
cf $XDG_CONFIG_HOME
|
||||||
|
dt $XDG_DATA_HOME
|
||||||
|
sr $HOME/.local/src
|
||||||
|
it $HOME/.local/src/git
|
||||||
|
sc $HOME/.local/bin
|
||||||
|
mn /mnt
|
||||||
|
dl $XDG_DOWNLOAD_DIR
|
||||||
|
dm $XDG_DOCUMENTS_DIR
|
||||||
|
ms $XDG_MUSIC_DIR
|
||||||
|
pc $XDG_PICTURES_DIR
|
||||||
|
vd $XDG_VIDEOS_DIR
|
||||||
|
dot $HOME/.dotfiles
|
|
@ -0,0 +1,13 @@
|
||||||
|
bf $XDG_CONFIG_HOME/shell/bm-files
|
||||||
|
bd $XDG_CONFIG_HOME/shell/bm-dirs
|
||||||
|
cfx $XDG_CONFIG_HOME/x11/xresources
|
||||||
|
cfX $XDG_CONFIG_HOME/x11/xprofile
|
||||||
|
cfb $HOME/.local/src/dwmblocks/config.h
|
||||||
|
cfk $XDG_CONFIG_HOME/kitty/kitty.conf
|
||||||
|
cfK $XDG_CONFIG_HOME/kitty/kittyfullscreen.conf
|
||||||
|
cfv $XDG_CONFIG_HOME/lvim/config.lua
|
||||||
|
cfz $ZDOTDIR/.zshrc
|
||||||
|
cfa $XDG_CONFIG_HOME/shell/aliasrc
|
||||||
|
cfp $XDG_CONFIG_HOME/shell/profile
|
||||||
|
cfl $XDG_CONFIG_HOME/lf/lfrc
|
||||||
|
cfL $XDG_CONFIG_HOME/lf/preview
|
Loading…
Reference in New Issue