config: adjustments

This commit is contained in:
xeruf 2021-07-17 22:48:33 +02:00
parent f3392d61dd
commit 537bcf9d84
10 changed files with 26 additions and 13 deletions

View File

@ -371,6 +371,7 @@ Version 2019-11-04 2021-02-16"
(map! :map dired-mode-map (map! :map dired-mode-map
:n "RET" 'dired-find-file-dwim :n "RET" 'dired-find-file-dwim
:localleader :localleader
"s" 'dired-do-symlink
:desc "Open dir in image-dired" "i" :desc "Open dir in image-dired" "i"
(lambda () (interactive) (image-dired buffer-file-name)) (lambda () (interactive) (image-dired buffer-file-name))
:desc "Compress/Extract" "c" 'dired-do-compress :desc "Compress/Extract" "c" 'dired-do-compress

View File

@ -3,7 +3,7 @@
# key: B # key: B
# expand-env: ((yas-wrap-around-region 'nil)) # expand-env: ((yas-wrap-around-region 'nil))
# -- # --
INTEREST $1 $1
:PROPERTIES: :PROPERTIES:
:Author: ${2:+} :Author: ${2:+}
:LibErlangen: https://stadtbibliothek-recherche.erlangen.de/Mediensuche/Einfache-Suche?search=${1:$(replace-regexp-in-string " " "+" yas-text)}+${2:$(replace-regexp-in-string " " "+" yas-text)}&top=y&facets=v_____Sachb%C3%BCcher%7CJugendsachbuch%7CJugendroman%7CBuch+Romane%7CSachb%C3%BCcher+Weih.%2fOst&facetsc=_____15&pagesize=20 :LibErlangen: https://stadtbibliothek-recherche.erlangen.de/Mediensuche/Einfache-Suche?search=${1:$(replace-regexp-in-string " " "+" yas-text)}+${2:$(replace-regexp-in-string " " "+" yas-text)}&top=y&facets=v_____Sachb%C3%BCcher%7CJugendsachbuch%7CJugendroman%7CBuch+Romane%7CSachb%C3%BCcher+Weih.%2fOst&facetsc=_____15&pagesize=20

View File

@ -122,3 +122,11 @@ matches:
type: shell type: shell
params: params:
cmd: "pass information/signature" cmd: "pass information/signature"
- trigger: ":iban"
replace: "{{output}}"
vars:
- name: output
type: shell
params:
cmd: "pass information/banking/dkb | head -1"

View File

@ -97,7 +97,9 @@
sd = switch -d sd = switch -d
sm = !git switch $(git main) sm = !git switch $(git main)
find = log --patch --all --full-history
ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' ref = reflog show --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset'
rev = rev-parse --short rev = rev-parse --short
head = rev-parse --short HEAD head = rev-parse --short HEAD
root = rev-parse --show-toplevel root = rev-parse --show-toplevel

View File

@ -39,8 +39,9 @@ let g:firenvim_config = {
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '.*wikipedia\.org.*': { 'priority': 9, 'takeover': 'never', }, \ '.*wikipedia\.org.*': { 'priority': 9, 'takeover': 'never', },
\ \
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
\ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', }, \ '.*docs\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*contacts\.google\.com.*': { 'priority': 9, 'takeover': 'never', },
\ '.*notion\.so.*': { 'priority': 9, 'takeover': 'never', },
\ '.*cloud\.atomtoast\.xyz.*': { 'priority': 9, 'takeover': 'never', }, \ '.*cloud\.atomtoast\.xyz.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', }, \ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', }, \ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },

View File

@ -50,7 +50,7 @@ rd() {
wh() { wh() {
res=$(which "$@") res=$(which "$@")
if expr "$res" : "${@:$#}: aliased to" >/dev/null if expr "$res" : "${@:$#}: aliased to" >/dev/null
then echo "$res" | bat --style=plain --language=sh && wh $(expr "$res" : "${@:$#}: aliased to ${@:$#} " >/dev/null && echo "-p") $(echo "$res" | cut -d' ' -f4) then echo "$res" | bat --style=plain --language=sh && wh $(expr "$res" : "${@:$#}: aliased to ${@:$#} " >/dev/null && echo "-p") $(echo "$res" | cut -d' ' -f$(expr 5 '&' "$res" : ".*\(sudo\|noglob\)" '|' 4))
# use command which for other shells # use command which for other shells
else test -r "$res" && b --style=header "$res" || echo "$res" | bat --style=plain --language=sh else test -r "$res" && b --style=header "$res" || echo "$res" | bat --style=plain --language=sh
fi fi
@ -78,7 +78,7 @@ alias dedup='awk '"'"'!a[$0]++'"'"
listconf() { listconf() {
{ cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra"; { cat "$conf_cache"; test -f "$conf_extra" && cat "$conf_extra";
fd --hidden --type file --size -1m --max-depth 1 . ~; fd --hidden --type file --size -1m --max-depth 1 . ~;
fd --hidden --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } | dedup sudo fd --hidden --type file --size -1m --max-depth 3 . --full-path "$XDG_CONFIG_HOME" /etc } | dedup
} }
edconf() { edconf() {
@ -88,12 +88,12 @@ edconf() {
conf_extra="$XDG_CONFIG_HOME/edconf-extra" conf_extra="$XDG_CONFIG_HOME/edconf-extra"
mkdir -p "$conf_cache_dir" mkdir -p "$conf_cache_dir"
touch "$conf_cache" touch "$conf_cache"
sel=$(listconf | fzf -1 -0 --tiebreak=end,length --preview 'bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches") sel=$(listconf | fzf -1 -0 --tiebreak=end,length --preview '$(test -r "{}" || echo "sudo") bat --color=always --style=numbers --line-range :200 {}' --query="$1" --history "$conf_cache_dir/searches")
# | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow # | xargs file | grep text | cut -d':' -f1 # this filters out non-text files, but it's ridiculously slow
test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -30 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & edit "$sel") test "$sel" && ((echo "$sel" | cat - "$conf_cache" | head -30 >"$conf_tmp" && mv "$conf_tmp" "$conf_cache") & edit "$sel")
} }
alias hist='print -z $(history | tac | fzf --tiebreak=index | tr -s " " | cut -d" " -f5-)' alias hist='print -z $(history | tac | fzf --tiebreak=index --bind="'"del:execute(echo \"'/;{4..}$/d'\" && sed '/;{4..}$/d' -i.bak $HISTFILE)"'" | sed "s|^ \+||" | cut -d" " -f5-)'
CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}" CONFIG_SHELL_FUNCTIONS="${BASH_SOURCE[0]:-${(%):-%x}}"
alias rs="reset && exec zsh" alias rs="reset && exec zsh"
@ -164,8 +164,9 @@ xo() {
done done
} }
alias sqli='rlwrap sqlite3 -column -header -cmd .tables' alias sqli='rlwrap sqlite3 -column -header -cmd .tables'
loc() { noglob locate --ignore-case --basename --existing "$@" | grep --color=always "$@" | less -F } loci() { locate --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|$@" | sed 's/ /|/g') | less -F }
alias uloc='noglob sudo updatedb && loc' alias loc='noglob loci'
alias uloc='noglob sudo updatedb && loci'
alias syslog='less +F /var/log/syslog' alias syslog='less +F /var/log/syslog'
alias println='printf "\n"' alias println='printf "\n"'
alias graphics='lspci -vnn | grep VGA --color=never && xrandr --listproviders' alias graphics='lspci -vnn | grep VGA --color=never && xrandr --listproviders'

View File

@ -3,6 +3,7 @@ section() { printf "\n$1\n"; }
highlight() { printf "$1\n"; } highlight() { printf "$1\n"; }
## System ## System
### TODO move to sysyadm
section "System" section "System"
highlight "Enable REISUB and increase watch limit for Intellij & co" highlight "Enable REISUB and increase watch limit for Intellij & co"

View File

@ -34,8 +34,8 @@ plugins=(
#git #git
gitfast gitfast
#git-auto-fetch #git-auto-fetch
fast-syntax-highlighting
zsh-autosuggestions zsh-autosuggestions
fast-syntax-highlighting
zsh-vim-mode zsh-vim-mode
history-substring-search history-substring-search
) )

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
echo "Args: $@" echo "$# Args: $@"
echo "Number of args: $#"
echo "${@:-default}" | sed 's/\(\w\+\)/\1+sed/g' echo "${@:-default}" | sed 's/\(\w\+\)/\1+sed/g'
echo "Last arg: ${@:$#}" echo "Last arg: ${@:$#}"

View File

@ -37,7 +37,7 @@ KEY_TWOUP_1=KEY_IC
KEY_TWOUP_2=0 KEY_TWOUP_2=0
KEY_END_1=KEY_END KEY_END_1=KEY_END
KEY_END_2='e' KEY_END_2='e'
KEY_PGDN_1=KEY_NPAGE KEY_PGDN_1=KEY_CTRL('d')
KEY_PGDN_2='d' KEY_PGDN_2='d'
KEY_PGDN_AUTO_1=0 KEY_PGDN_AUTO_1=0
KEY_PGDN_AUTO_2=' ' KEY_PGDN_AUTO_2=' '