From 27a01b4cc019da7197e01962c5c56413fb14661f Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Sun, 10 May 2026 18:00:11 +0300 Subject: [PATCH] updoot --- .config/fish/conf.d/source.fish | 6 +- .config/fish/source/direnv.fish | 24 ++++ .config/fish/source/zoxide.fish | 106 ++++++++++++++++++ .config/helix/config.toml | 4 +- .config/htop/htoprc | 6 +- .../switch-on-connect.conf | 6 +- .gitignore | 1 - .local/share/cargo/config.toml | 4 +- 8 files changed, 143 insertions(+), 14 deletions(-) create mode 100644 .config/fish/source/direnv.fish create mode 100644 .config/fish/source/zoxide.fish diff --git a/.config/fish/conf.d/source.fish b/.config/fish/conf.d/source.fish index ec609ee..7af0604 100644 --- a/.config/fish/conf.d/source.fish +++ b/.config/fish/conf.d/source.fish @@ -22,7 +22,7 @@ cached_source direnv hook fish status is-interactive; or return cached_source zoxide init fish -cached_source trashy completions fish -cached_source sqlx completions fish +# cached_source trashy completions fish +# cached_source sqlx completions fish -cached_source_static zmk --show-completion +# cached_source_static zmk --show-completion diff --git a/.config/fish/source/direnv.fish b/.config/fish/source/direnv.fish new file mode 100644 index 0000000..9da0074 --- /dev/null +++ b/.config/fish/source/direnv.fish @@ -0,0 +1,24 @@ + + function __direnv_export_eval --on-event fish_prompt; + "/usr/bin/direnv" export fish | source; + + if test "$direnv_fish_mode" != "disable_arrow"; + function __direnv_cd_hook --on-variable PWD; + if test "$direnv_fish_mode" = "eval_after_arrow"; + set -g __direnv_export_again 0; + else; + "/usr/bin/direnv" export fish | source; + end; + end; + end; + end; + + function __direnv_export_eval_2 --on-event fish_preexec; + if set -q __direnv_export_again; + set -e __direnv_export_again; + "/usr/bin/direnv" export fish | source; + echo; + end; + + functions --erase __direnv_cd_hook; + end; diff --git a/.config/fish/source/zoxide.fish b/.config/fish/source/zoxide.fish new file mode 100644 index 0000000..e90938a --- /dev/null +++ b/.config/fish/source/zoxide.fish @@ -0,0 +1,106 @@ +# ============================================================================= +# +# Utility functions for zoxide. +# + +# pwd based on the value of _ZO_RESOLVE_SYMLINKS. +function __zoxide_pwd + builtin pwd -L +end + +# A copy of fish's internal cd function. This makes it possible to use +# `alias cd=z` without causing an infinite loop. +if ! builtin functions --query __zoxide_cd_internal + if status list-files functions/cd.fish &>/dev/null + status get-file functions/cd.fish | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source + else + string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source + end +end + +# cd + custom logic based on the value of _ZO_ECHO. +function __zoxide_cd + if set -q __zoxide_loop + builtin echo "zoxide: infinite loop detected" + builtin echo "Avoid aliasing `cd` to `z` directly, use `zoxide init --cmd=cd fish` instead" + return 1 + end + __zoxide_loop=1 __zoxide_cd_internal $argv +end + +# ============================================================================= +# +# Hook configuration for zoxide. +# + +# Initialize hook to add new entries to the database. +function __zoxide_hook --on-variable PWD + test -z "$fish_private_mode" + and command zoxide add -- (__zoxide_pwd) +end + +# ============================================================================= +# +# When using zoxide with --no-cmd, alias these internal functions as desired. +# + +# Jump to a directory using only keywords. +function __zoxide_z + set -l argc (builtin count $argv) + if test $argc -eq 0 + __zoxide_cd $HOME + else if test "$argv" = - + __zoxide_cd - + else if test $argc -eq 1 -a -d $argv[1] + __zoxide_cd $argv[1] + else if test $argc -eq 2 -a $argv[1] = -- + __zoxide_cd -- $argv[2] + else + set -l result (command zoxide query --exclude (__zoxide_pwd) -- $argv) + and __zoxide_cd $result + end +end + +# Completions. +function __zoxide_z_complete + set -l tokens (builtin commandline --current-process --tokenize) + set -l curr_tokens (builtin commandline --cut-at-cursor --current-process --tokenize) + + if test (builtin count $tokens) -le 2 -a (builtin count $curr_tokens) -eq 1 + # If there are < 2 arguments, use `cd` completions. + complete --do-complete "'' "(builtin commandline --cut-at-cursor --current-token) | string match --regex -- '.*/$' + else if test (builtin count $tokens) -eq (builtin count $curr_tokens) + # If the last argument is empty, use interactive selection. + set -l query $tokens[2..-1] + set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query) + and __zoxide_cd $result + and builtin commandline --function cancel-commandline repaint + end +end +complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)' + +# Jump to a directory using interactive search. +function __zoxide_zi + set -l result (command zoxide query --interactive -- $argv) + and __zoxide_cd $result +end + +# ============================================================================= +# +# Commands for zoxide. Disable these using --no-cmd. +# + +abbr --erase z &>/dev/null +complete --erase --command z +alias z=__zoxide_z + +abbr --erase zi &>/dev/null +complete --erase --command zi +alias zi=__zoxide_zi + +# ============================================================================= +# +# To initialize zoxide, add this to your configuration (usually +# ~/.config/fish/config.fish): +# +# zoxide init fish | source diff --git a/.config/helix/config.toml b/.config/helix/config.toml index 1ddaedd..8a340e1 100644 --- a/.config/helix/config.toml +++ b/.config/helix/config.toml @@ -58,8 +58,8 @@ right = [ [editor.lsp] display-progress-messages = true # looks cool auto-signature-help = false -auto-document-highlight = false -display-inlay-hints = false # meh +# auto-document-highlight = false +display-inlay-hints = false # meh [editor.cursor-shape] normal = "block" diff --git a/.config/htop/htoprc b/.config/htop/htoprc index 674731c..88092ac 100644 --- a/.config/htop/htoprc +++ b/.config/htop/htoprc @@ -1,6 +1,6 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. -htop_version=3.5.0-3.5.0 +htop_version=3.5.1-1-arch config_reader_min_version=3 fields=0 48 17 18 38 40 39 2 50 37 46 47 49 1 hide_kernel_threads=1 @@ -41,14 +41,14 @@ column_meter_modes_0=1 1 column_meters_1=DateTime Uptime LoadAverage Tasks Battery DiskIO NetworkIO Memory Swap column_meter_modes_1=2 2 2 2 2 2 2 1 1 tree_view=0 -sort_key=47 +sort_key=46 tree_sort_key=0 sort_direction=-1 tree_sort_direction=1 tree_view_always_by_pid=0 all_branches_collapsed=0 screen:Main=PID USER PRIORITY NICE M_VIRT M_SHARE M_RESIDENT STATE NLWP PROCESSOR PERCENT_CPU PERCENT_MEM TIME Command -.sort_key=PERCENT_MEM +.sort_key=PERCENT_CPU .tree_sort_key=PID .tree_view_always_by_pid=0 .tree_view=0 diff --git a/.config/pipewire/pipewire-pulse.conf.d/switch-on-connect.conf b/.config/pipewire/pipewire-pulse.conf.d/switch-on-connect.conf index afd885c..76187f2 100644 --- a/.config/pipewire/pipewire-pulse.conf.d/switch-on-connect.conf +++ b/.config/pipewire/pipewire-pulse.conf.d/switch-on-connect.conf @@ -1,3 +1,3 @@ -pulse.cmd = [ - { cmd = "load-module" args = "module-switch-on-connect" } -] +# pulse.cmd = [ +# { cmd = "load-module" args = "module-switch-on-connect" } +# ] diff --git a/.gitignore b/.gitignore index 9772bda..661e395 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,6 @@ # CLI / TUI !.config/gdu/ !.config/fish/ -.config/fish/source !.config/paru/ !.config/htop/ !.config/tealdeer/ diff --git a/.local/share/cargo/config.toml b/.local/share/cargo/config.toml index 7b597c4..f6e7ca8 100644 --- a/.local/share/cargo/config.toml +++ b/.local/share/cargo/config.toml @@ -52,5 +52,5 @@ lto = false [target.x86_64-unknown-linux-gnu] linker = "clang" -rustflags = ["-C", "link-arg=--ld-path=wild"] -# rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] # "target-cpu=native" +# rustflags = ["-C", "link-arg=--ld-path=wild"] +rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"] # "target-cpu=native"