From 6585cfd81eff5af6895438d00422867a9dbcb08b Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Wed, 23 Mar 2022 10:37:00 +0100 Subject: [PATCH] Steal some zsh dots from drusk --- alacritty/.config/alacritty/alacritty.yml | 6 +- ltex-ls/.config/ltex-ls/dictionary.txt | 15 +++++ ltex-ls/.config/ltex-ls/false.txt | 8 +++ zsh/.config/zsh/.zshrc | 36 ++--------- zsh/.config/zsh/keybinds.zsh | 73 +++++++++++++++++++++++ zsh/.config/zsh/utils.zsh | 20 +++++++ 6 files changed, 126 insertions(+), 32 deletions(-) create mode 100644 zsh/.config/zsh/keybinds.zsh create mode 100644 zsh/.config/zsh/utils.zsh diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml index 2007d97..d6c7141 100644 --- a/alacritty/.config/alacritty/alacritty.yml +++ b/alacritty/.config/alacritty/alacritty.yml @@ -27,10 +27,14 @@ cursor: style: "Block" unfocused_hollow: true font: - normal: { "family": "Fira Code" } + #normal: { "family": "Fira Code" } + normal: { "family": "Jetbrains Mono" } #normal: { "family": "Victor Mono" } #normal: { "family": "Monoid" } #normal: { "family": "Mono Lisa" } + #normal: { "family": "cherry" } + #normal: { "family": "scientifica" } + #normal: { "family": "cozette" } #normal: { "family": "xos4 Terminus" } offset: { "x": 0, "y": 0 } size: 12 diff --git a/ltex-ls/.config/ltex-ls/dictionary.txt b/ltex-ls/.config/ltex-ls/dictionary.txt index 2959355..da61eba 100644 --- a/ltex-ls/.config/ltex-ls/dictionary.txt +++ b/ltex-ls/.config/ltex-ls/dictionary.txt @@ -123,3 +123,18 @@ spielinternen Typsyntheseprozess Konditionalblöcken bibliotheksinterne +Typkonstrukten +Tilemap +Dropdowns +Scrollelemente +Komponentensystem +Prefabs +Instruktionskomponenten +Instruktionsblöcke +mausbasierte +Datensammlungstypen +HashMaps +skriptbasierte +summentypbasierten +Typarumente +Typargumente diff --git a/ltex-ls/.config/ltex-ls/false.txt b/ltex-ls/.config/ltex-ls/false.txt index 7eb0d33..785f4bd 100644 --- a/ltex-ls/.config/ltex-ls/false.txt +++ b/ltex-ls/.config/ltex-ls/false.txt @@ -41,3 +41,11 @@ {"rule":"COMMA_BEHIND_RELATIVE_CLAUSE","sentence":"^\\QDer größte Vorteil der Übersetzung in Maschinencode ist die Laufzeiteffizienz und Hardwarenähe, die dadurch erreicht werden kann \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q.\\E$"} {"rule":"GERMAN_SPELLER_RULE","sentence":"^\\QDa keine konkrete Syntax vorgegeben werden soll, setzt \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q hier auf eine strukturierte Darstellung in Form eines Abstract Syntax Trees (\\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q).\\E$"} {"rule":"GERMAN_SPELLER_RULE","sentence":"^\\QDer Aufbau der textbasierten Programmierspiele von Zachtronics ist ähnlich: laut Firmengründer \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q setzen diese auf eine weitgehend klassische Parser- und Compilerstruktur, welche den Programmcode in eine separate Laufzeitsimulation übergibt, die den Code schrittweise ausführt.\\E$"} +{"rule":"COMMA_BEHIND_RELATIVE_CLAUSE","sentence":"^\\QVariablen sind hier in dem Kontext, in dem sie initialisiert wurden, und allen darin enthaltenen Kontexten verfügbar, nicht aber außerhalb des jeweiligen Kontexts.\\E$"} +{"rule":"COMMA_BEHIND_RELATIVE_CLAUSE","sentence":"^\\QVariablen sind hier nur in dem Kontext, in dem sie initialisiert wurden, verfügbar.\\E$"} +{"rule":"COMMA_BEHIND_RELATIVE_CLAUSE","sentence":"^\\QVariablen sind in solchen Systemen nur in dem Kontext, in dem sie initialisiert wurden, verfügbar.\\E$"} +{"rule":"DE_CASE","sentence":"^\\QDiese Unterschiede fallen vor allem durch unterschiedliche mitgelieferte Typen und Klassen der Standardbibliothek, als auch bei der Verwendung von F-spezifischen Typkonstrukten aus C heraus auf.\\E$"} +{"rule":"GERMAN_SPELLER_RULE","sentence":"^\\QDieses ist in F als \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q mit spezifischer Syntax gut unterstützt, und wird sowohl von F- als auch C-Listen implementiert.\\E$"} +{"rule":"GERMAN_SPELLER_RULE","sentence":"^\\QDieses ist in F als \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q mit spezifischer Syntax gut unterstützt und wird sowohl von F- als auch C-Listen implementiert.\\E$"} +{"rule":"DE_CASE","sentence":"^\\QDurch die direkte Verwendung von F-spezifischen Datenstrukturen wie den Summentypen in der \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q-Darstellung oder den F-Typen \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q und \\E(?:Dummy|Ina|Jimmy-)[0-9]+$"} +{"rule":"DE_CASE","sentence":"^\\Q[Verwendung von F-spezifischen Konstrukten]\\E$"} diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc index fd9a2c4..81a79d3 100644 --- a/zsh/.config/zsh/.zshrc +++ b/zsh/.config/zsh/.zshrc @@ -9,6 +9,7 @@ setopt HIST_IGNORE_ALL_DUPS setopt EXTENDED_HISTORY setopt SHARE_HISTORY +source "$ZDOTDIR/utils.zsh" ### Added by Zinit's installer @@ -35,21 +36,6 @@ zinit light-mode for \ ### End of Zinit's installer chunk -# if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then -# print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f" -# command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit" -# command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \ -# print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \ -# print -P "%F{160}▓▒░ The clone has failed.%f%b" -# fi -# -# source "$HOME/.zinit/bin/zinit.zsh" -# autoload -Uz _zinit -# (( ${+_comps} )) && _comps[zinit]=_zinit -# -# zinit snippet OMZP::git -# zinit wait lucid for "zsh-users/zsh-completions" - # compinit must be ran before fzf-tab, but fzf-tab must be before syntax highlighting etc autoload -Uz compinit compinit @@ -65,8 +51,12 @@ zinit wait lucid for \ "pkulev/zsh-rustup-completion" +# clear the default keybinds, from utils.zsh +clear-keybinds + # load more stuff source "$ZDOTDIR/fzf-tab.zsh" +source "$ZDOTDIR/keybinds.zsh" eval "$(zoxide init zsh)" @@ -88,22 +78,6 @@ export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set n autoload -Uz colors && colors autoload -Uz promptinit && promptinit -# epic keybinds - -my-backward-delete-word() { - local WORDCHARS=${WORDCHARS/\//} - zle backward-delete-word -} -zle -N my-backward-delete-word -bindkey '^W' my-backward-delete-word -bindkey '^H' backward-delete-word -bindkey "^[[H" beginning-of-line -bindkey "^[[F" end-of-line -bindkey "^[." insert-last-word - -bindkey '^[[A' history-substring-search-up -bindkey '^[[B' history-substring-search-down - # alias alias ls="exa --icons" diff --git a/zsh/.config/zsh/keybinds.zsh b/zsh/.config/zsh/keybinds.zsh new file mode 100644 index 0000000..c70fb9a --- /dev/null +++ b/zsh/.config/zsh/keybinds.zsh @@ -0,0 +1,73 @@ +# This file is currently mostly stolen from https://github.com/druskus20/dots/blob/master/zsh/.config/zsh/modules/keybinds.zsh +# Vi mode {{{ +bindkey -v + +# https://superuser.com/questions/476532/how-can-i-make-zshs-vi-mode-behave-more-like-bashs-vi-mode +export KEYTIMEOUT=1 # Vi mode timeout for key sequences +bindkey -M vicmd '^[' undefined-key + +# Remove keybinds that begin with esc (so ESC doesnt hang) +bindkey -M vicmd -r "^[OA" # up-line-or-history +bindkey -M vicmd -r "^[OB" # down-line-or-history +bindkey -M vicmd -r "^[OC" # vi-forward-char +bindkey -M vicmd -r "^[OD" # vi-backward-char +bindkey -M vicmd -r "^[[200~" # bracketed-paste +bindkey -M vicmd -r "^[[A" # up-line-or-history +bindkey -M vicmd -r "^[[B" # down-line-or-history +bindkey -M vicmd -r "^[[C" # vi-forward-char +bindkey -M vicmd -r "^[[D" # vi-backward-char + +# Remove execute because Im dumb +bindkey -M vicmd -r ":" # execute + +bindkey -rM viins '^X' +bindkey -M viins '^X,' _history-complete-newer \ + '^X/' _history-complete-older \ + '^X`' _bash_complete-word + +# Don't use vi mode in backward delete word/char because it cannot delete +# characters on the left of position you were in insert mode. +bindkey "^?" backward-delete-char +# }}} + +# Pipr thing {{{ +_pipr_expand_widget() { + emulate -LR zsh + /dev/null + LBUFFER=$(< /tmp/pipr_out) +} +zle -N _pipr_expand_widget +bindkey '\ea' _pipr_expand_widget +#}}} + +# Keybindings + +# delete word but break on slashes +my-backward-delete-word() { + local WORDCHARS=${WORDCHARS/\//} + zle backward-delete-word +} +zle -N my-backward-delete-word + +bindkey "^[[1;5C" forward-word # C-ArrowRight +bindkey "^[[1;5D" backward-word # C-ArrowLeft +bindkey "\e[3~" delete-char # Del +bindkey "^E" end-of-line # C-E +bindkey "^[[F" end-of-line # END +bindkey "^[[H" beginning-of-line # HOME +bindkey "^A" beginning-of-line # C-A +bindkey '^W' my-backward-delete-word # C-w +bindkey '^H' my-backward-delete-word # C-backspace +bindkey "^[." insert-last-word # alt-. +bindkey "^[[3~" delete-char # DEL + +bindkey '^[[A' history-substring-search-up +bindkey '^[[B' history-substring-search-down + +# C-Q to edit command in $EDITOR +autoload -U edit-command-line +zle -N edit-command-line +bindkey -M viins "^Q" edit-command-line +bindkey -M vicmd "^Q" edit-command-line + +setopt NO_FLOW_CONTROL # Disable Ctrl+S and Ctrl+Q diff --git a/zsh/.config/zsh/utils.zsh b/zsh/.config/zsh/utils.zsh new file mode 100644 index 0000000..afc7695 --- /dev/null +++ b/zsh/.config/zsh/utils.zsh @@ -0,0 +1,20 @@ +# This part is stolen https://github.com/druskus20/dots/blob/master/zsh/.config/zsh/utils/utils.zsh +function do-nothing() {} +zle -N do-nothing do-nothing + +# Disable default keybinds +function clear-keybinds() { + local key keys=( + "^A" "^B" "^D" "^E" "^F" "^N" "^O" "^P" "^Q" "^S" "^T" "^W" "^F" "^K" + "^X*" "^X=" "^X?" "^XC" "^XG" "^Xa" "^Xc" "^Xd" "^Xe" "^Xg" "^Xh" "^Xm" "^Xn" + "^Xr" "^Xs" "^Xt" "^Xu" "^X~" "^[ " "^[!" "^['" "^[," "^[-" "^[." "^[0" "^[1" + "^[2" "^[3" "^[4" "^[5" "^[6" "^[7" "^[8" "^[9" "^[<" "^[>" "^[?" "^[A" "^[B" + "^[C" "^[D" "^[F" "^[G" "^[L" "^[M" "^[N" "^[P" "^[Q" "^[S" "^[T" "^[U" "^[W" + "^[_" "^[a" "^[b" "^[c" "^[d" "^[f" "^[g" "^[l" "^[n" "^[p" "^[q" "^[s" "^[t" + "^[u" "^[w" "^[y" "^[z" "^[|" "^[~" "^[^I" "^[^J" "^[^_" "^[\"" "^[\$" "^X^B" + "^X^F" "^X^J" "^X^K" "^X^N" "^X^O" "^X^R" "^X^U" "^X^X" "^[^D" "^[^G") + for key in $keys; do + bindkey -r $key + done +} +zle -N clear-keybinds clear-keybinds