+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanEnable motd25665e9

main
4.3 KiB161 linesraw
1# TODO: completion configuration (troubleshoot kill signals not showing up)
2# TODO: keybindings
3
4# if status is-login
5fish_add_path -P $HOME/.cargo/bin
6fish_add_path -P $HOME/.local/bin
7# end
8
9set -e __HM_SESS_VARS_SOURCED
10source ~/.nix-profile/etc/profile.d/hm-session-vars.fish
11
12function give-me-a-ping-vasily
13    # One Ping Only...
14    echo -n "Ping: "
15    ping -qc1 -W1 $argv[1] &| awk -F/ 'END{ print (/^rtt/? "OK "$5" ms":"FAIL") }'
16end
17
18function latest-screenshot
19    set -l p ~/images/screenshots/
20    echo -n $p
21    l $p --sort=time | tail -n1
22end
23
24function latest-snapshot
25    find /home/.snapshots -mindepth 2 -maxdepth 2 -type d -name snapshot | sort -V | tail -n 1
26end
27
28if ! status is-interactive
29    return
30end
31
32abbr -a config git -C $CONF_DIR
33abbr -a reload exec fish
34
35set -gx fish_lsp_diagnostic_disable_error_codes 4004
36
37function fish_greeting
38    if test (hostname) != Cortana # i already have it there
39        eval (random choice randomcat "pokedex mon random")
40    end
41end
42
43function mkconfig
44    set -l name $argv[1]config
45    set -e argv[1]
46    eval "function $name
47        pushd $CONF_DIR >/dev/null; hx dotfiles/{$argv}; popd >/dev/null
48    end"
49end
50
51mkconfig hx .config/helix/config.toml, .config/helix/languages.toml
52mkconfig vim .config/nvim/lua/main.lua, ".config/nvim/**/*.lua", ".config/nvim/**/*.vim"
53mkconfig zsh .zshrc, .zshenv, ".config/zsh/*"
54mkconfig fish .config/fish/extra.fish, ".config/fish/conf.d/*"
55mkconfig niri .config/niri/config.kdl, ".config/niri/*"
56mkconfig sway .config/sway/common_config, .config/sway/(hostname -s), \
57    .config/waybar/config.jsonc, ".config/waybar/*.css"
58mkconfig wez .config/wezterm/config.lua, ".config/wezterm/*.lua"
59mkconfig git .config/git/extraConfig, .config/git/ignore, ".config/git/*"
60mkconfig nix ../mixins/home/common.nix, "../**/*.nix"
61
62set -x MANPAGER less -M -j5 +Gg
63set -x PATH (printf '%s\n' $PATH | awk '!seen[$0]++')
64set -x EDITOR hx
65set -x VISUAL hx
66set -g fish_cursor_default line
67
68function p
69    string split ' ' $PATH | sd $HOME '~'
70end
71abbr -a vi hx
72abbr -a cat bat
73function l
74    eza --icons --time-style relative --color-scale all --group-directories-first $argv
75end
76abbr -a unset set -e
77abbr -a ls l -l
78abbr -a la l -la
79abbr -a tree l -T --git-ignore
80abbr -a o xdg-open
81abbr -a c clear
82abbr -a please sudo
83abbr -a fuck killall
84function note
85    cd ~/documents/notes && hx todo/TODO.md **/*.md && cd -
86end
87
88abbr -a send "wormhole-rs tx"
89abbr -a receive "wormhole-rs rx"
90abbr -a rs rsync -a --info=progress2
91abbr -a drag ripdrag
92abbr -a getsong "ytmdl --dont-transcode --download-archive ~/.cache/ytmdl/archive"
93abbr -a wine32 "WINEPREFIX=$HOME/.wine32 wine"
94abbr -a du diskus
95abbr -a ncdu gdu
96abbr -a dirdiff git diff --no-index
97function ststatus
98    syncthing cli show system |
99        jq -r '.myID, .uptime, .startTime, .guiAddressUsed, .cpuPercent' |
100        read -L id uptime start url cpu
101    echo -e "ID: $id\nStarted $start $(numbat -e "print("$uptime"s to human)")"
102    echo -e "CPU: $cpu%\nGUI: $(echo $url | sd 127.0.0.1 localhost)"
103end
104
105abbr -a sc systemctl
106abbr -a music rmpc
107abbr -a m music
108function shuffle
109    mpc clear && mpc ls | mpc add && mpc shuffle && mpc play
110end
111
112abbr -a bp factorio-bp-helper
113function fontcheck
114    set -ql font $argv[2]; or set font sans
115    FC_DEBUG=4 pango-view -q -t $argv[1] --font=$font &|
116        rg -or '$1' 'family: "([^"]+)"' | tail -1
117end
118
119function nixfind
120    nix-locate --color=always -rt r -t x -t s $argv | sd '/nix/store/[^/\x1b]+' '' | sort
121end
122
123abbr -a nixsize nix-tree
124abbr -a nixclean nh clean all
125
126function _switch
127    if test (uname) = Darwin
128        set cmd darwin
129    else if command -qv nixos-rebuild >/dev/null
130        set cmd os
131    else
132        set cmd home
133    end
134    nh $cmd switch $CONF_DIR $argv
135end
136abbr -a switch _switch
137abbr -a update switch -u
138
139function repeat
140    for i in (seq $argv[1])
141        eval "$argv[2..]"
142    end
143end
144
145function fzf-dir-widget
146    FZF_CTRL_T_COMMAND=$FZF_ALT_C_COMMAND fzf-file-widget
147end
148
149# alt for W's, ctrl for w's
150bind alt-backspace backward-kill-token
151bind ctrl-backspace backward-kill-word
152bind alt-left prevd-or-backward-token
153bind ctrl-left backward-word
154bind alt-right nextd-or-forward-token
155bind ctrl-right forward-word
156
157bind ctrl-f fzf-file-widget
158bind ctrl-g fzf-dir-widget
159bind ctrl-e edit_command_buffer
160bind ctrl-k up-or-search
161bind ctrl-j down-or-search