diff options
| author | Anton Bobov <anton@bobov.name> | 2024-01-24 22:23:53 +0500 |
|---|---|---|
| committer | Anton Bobov <anton@bobov.name> | 2024-01-24 22:23:53 +0500 |
| commit | 727e75a26120c8b56e93c7319281cbfc84d63a8b (patch) | |
| tree | 9691aba02cf883a718c35d2cb3c1b1ebf2930903 /files/.zsh | |
| parent | 75a739e1fe61cbde14331282d8729809e826c3f1 (diff) | |
[zsh] Updates
Diffstat (limited to 'files/.zsh')
| -rw-r--r-- | files/.zsh/rc/S06_grml_extension | 8 | ||||
| -rw-r--r-- | files/.zsh/rc/S20_environment | 2 | ||||
| -rw-r--r-- | files/.zsh/rc/S20_sdkman | 2 | ||||
| -rw-r--r-- | files/.zsh/rc/S50_aliases | 6 | ||||
| -rw-r--r-- | files/.zsh/rc/S50_nnn | 15 | ||||
| -rw-r--r-- | files/.zsh/rc/S51_ledger | 5 |
6 files changed, 33 insertions, 5 deletions
diff --git a/files/.zsh/rc/S06_grml_extension b/files/.zsh/rc/S06_grml_extension index ba106f0..e9b673d 100644 --- a/files/.zsh/rc/S06_grml_extension +++ b/files/.zsh/rc/S06_grml_extension @@ -2,9 +2,15 @@ function virtual_env_prompt () { REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) } } +function nnn_prompt() { + REPLY=${NNNLVL+N3 } +} + grml_theme_add_token \ virtual-env -f virtual_env_prompt '%F{magenta}' '%f' +grml_theme_add_token \ + nnn -f nnn_prompt '%F{green}' '%f' zstyle ':prompt:grml:left:setup' items \ - rc virtual-env change-root user at host path vcs percent + rc virtual-env nnn change-root user at host path vcs percent # vim: ft=zsh : diff --git a/files/.zsh/rc/S20_environment b/files/.zsh/rc/S20_environment index 74b9327..e4a16a8 100644 --- a/files/.zsh/rc/S20_environment +++ b/files/.zsh/rc/S20_environment @@ -27,6 +27,8 @@ elif [ -f "/usr/bin/src-hilite-lesspipe.sh" ] ; then export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" fi +export XZ_DEFAULTS="--threads 4" + # this make man pages look nicer export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' diff --git a/files/.zsh/rc/S20_sdkman b/files/.zsh/rc/S20_sdkman index 8183b48..71a972a 100644 --- a/files/.zsh/rc/S20_sdkman +++ b/files/.zsh/rc/S20_sdkman @@ -15,7 +15,7 @@ else fi jdk-select() { - version=$(sdk ls java | grep installed | fzf --exact | awk -F '|' '{print $6}' | tr -d ' ') + version=$(sdk ls java | grep -E '(installed|local only)' | fzf --exact | awk -F '|' '{print $6}' | tr -d ' ') test -z "$version" || sdk use java $version } diff --git a/files/.zsh/rc/S50_aliases b/files/.zsh/rc/S50_aliases index cf1588a..c28ee90 100644 --- a/files/.zsh/rc/S50_aliases +++ b/files/.zsh/rc/S50_aliases @@ -29,6 +29,7 @@ alias -s git="git clone --recursive" # Fix aliases alias sudo='sudo ' +alias sudo-path='sudo env "PATH=$PATH"' alias watch='watch ' alias df='df -h' @@ -87,12 +88,15 @@ alias scratch='vim -c Scratch +startinsert' alias scratchmd='scratch -c "set ft=markdown"' alias rscp='rsync -rlptDvzhP' is_command pigz && alias gzip='pigz' +is_command pigz && alias zcat='pigz -cd' is_command unpigz && alias gunzip='unpigz' alias man='LANG=C man ' alias sc=systemctl alias jf="journalctl --unit" +alias pwgen="pwgen --capitalize --numerals --secure" +alias pw="pwgen 40 1" alias lsblk="lsblk -o NAME,SIZE,UUID,FSTYPE,MOUNTPOINT,LABEL,MODEL" @@ -120,7 +124,7 @@ else fi alias yd='yt-dlp' -alias yd-date='yd --download-archive=download-archive.log --ignore-errors --output="[%(playlist_index)s] %(upload_date)s - %(title)s-%(id)s.%(ext)s"' +alias yd-date='yd --download-archive=download-archive.log --playlist-reverse --ignore-errors --output="[%(playlist_autonumber)04d] %(upload_date)s - %(title)s-%(id)s.%(ext)s"' alias yd-audio='yd --format bestaudio --embed-thumbnail --extract-audio --audio-format mp3' alias yd-cb='xsel -bo | xargs yt-dlp' diff --git a/files/.zsh/rc/S50_nnn b/files/.zsh/rc/S50_nnn index 94c3317..9c130b8 100644 --- a/files/.zsh/rc/S50_nnn +++ b/files/.zsh/rc/S50_nnn @@ -1,4 +1,17 @@ -NNN_PLUG='o:fzopen;z:autojump;p:preview-tui;T:-!&xdg-open "$PWD"' +nnn_plugins() { + local plugins=() + plugins=() + plugins+=(o:fzopen) + plugins+=(z:autojump) + plugins+=(p:preview-tui) + plugins+=('T:-!&xdg-open "$PWD"') # Open current dir + echo ${(j:;:)plugins} +} + +NNN_PLUG=$(nnn_plugins) + +unfunction nnn_plugins + NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$" NNN_FCOLORS="03040601000205f7d204d9f7" diff --git a/files/.zsh/rc/S51_ledger b/files/.zsh/rc/S51_ledger index 65e709b..88b66eb 100644 --- a/files/.zsh/rc/S51_ledger +++ b/files/.zsh/rc/S51_ledger @@ -19,7 +19,10 @@ _ledger_smartcase_expr() { bal() { if [ $# -eq 0 ] || [[ $1 =~ [-].+ ]] ; then - ledger balance --format '%(account)\n' ^Assets | sort | fzf --multi --preview "ledger balance $* {+}" + ledger balance --format '%(account)\n' ^Assets | + head -n-1 | sort | + fzf --multi --preview "ledger balance $* {+}" | + xargs ledger balance $* elif [ $# -eq 1 ] ; then ledger balance \( ^Assets ^Liabilities \) and $(_ledger_smartcase_expr "$*") else |
