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
:n "RET" 'dired-find-file-dwim
:localleader
"s" 'dired-do-symlink
:desc "Open dir in image-dired" "i"
(lambda () (interactive) (image-dired buffer-file-name))
:desc "Compress/Extract" "c" 'dired-do-compress

View File

@ -3,7 +3,7 @@
# key: B
# expand-env: ((yas-wrap-around-region 'nil))
# --
INTEREST $1
$1
:PROPERTIES:
: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

View File

@ -122,3 +122,11 @@ matches:
type: shell
params:
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
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'
rev = rev-parse --short
head = rev-parse --short HEAD
root = rev-parse --show-toplevel

View File

@ -39,8 +39,9 @@ let g:firenvim_config = {
\ '.*openstreetmap\.org.*': { 'priority': 9, 'takeover': 'never', },
\ '.*wikipedia\.org.*': { 'priority': 9, 'takeover': 'never', },
\
\ '.*notion\.so.*': { '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', },
\ 'https://bigbluebutton.*': { 'priority': 9, 'takeover': 'never', },
\ 'https://dhall-lang.org.*': { 'priority': 9, 'takeover': 'never', },

View File

@ -50,7 +50,7 @@ rd() {
wh() {
res=$(which "$@")
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
else test -r "$res" && b --style=header "$res" || echo "$res" | bat --style=plain --language=sh
fi
@ -78,7 +78,7 @@ alias dedup='awk '"'"'!a[$0]++'"'"
listconf() {
{ 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 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() {
@ -88,12 +88,12 @@ edconf() {
conf_extra="$XDG_CONFIG_HOME/edconf-extra"
mkdir -p "$conf_cache_dir"
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
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}}"
alias rs="reset && exec zsh"
@ -164,8 +164,9 @@ xo() {
done
}
alias sqli='rlwrap sqlite3 -column -header -cmd .tables'
loc() { noglob locate --ignore-case --basename --existing "$@" | grep --color=always "$@" | less -F }
alias uloc='noglob sudo updatedb && loc'
loci() { locate --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|$@" | sed 's/ /|/g') | less -F }
alias loc='noglob loci'
alias uloc='noglob sudo updatedb && loci'
alias syslog='less +F /var/log/syslog'
alias println='printf "\n"'
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"; }
## System
### TODO move to sysyadm
section "System"
highlight "Enable REISUB and increase watch limit for Intellij & co"
@ -12,7 +13,7 @@ sudo sysctl --system
highlight "Default sudoers configuration"
echo "Defaults editor=/usr/bin/nvim" | sudo tee /etc/sudoers.d/editor
echo -e "Defaults timestamp_timeout=120\nDefaults passwd_timeout=30" | sudo tee /etc/sudoers.d/timeout
echo -e "Defaults timestamp_timeout=120\nDefaults passwd_timeout=30" | sudo tee /etc/sudoers.d/timeout
highlight "password-free reboot"
echo "$USER ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /usr/sbin/reboot, /sbin/poweroff, /usr/sbin/shutdown" | sudo tee /etc/sudoers.d/shutdown

View File

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

View File

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

View File

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