This commit is contained in:
2025-03-19 01:00:03 +01:00
parent a614aedb5d
commit e05e9929ae
79 changed files with 2761 additions and 1 deletions

61
.config/fish/config.fish Normal file
View File

@@ -0,0 +1,61 @@
set -gx EDITOR nvim
set -gx PAGER less
set -Ux BAT_THEME gruvbox
set -Ux MANPAGER "nvim +Man!"
set -g fish_greeting
set -g fish_cursor_insert line
set -g fish_cursor_default block
set -g fish_cursor_visual underscore
set -g fish_user_key_bindings
set -g ask
#set -xU MANPAGER 'less -R --use-color -Dd+r -Du+b'
#set -xU MANROFFOPT '-P -c'
alias grep="grep --color=auto"
alias fzf="fzf --preview color='always {}'"
alias pacs="sudo pacman -Syu"
alias nmaps="sudo nmap -sn 192.168.0.0/24"
alias mem="df -H --output=source,size,used,avail | grep 480G | sort -u"
alias kittyimg="kitten icat"
alias dmz="cat ~/.config/fish/dmz.txt"
alias vpnhome="sudo wg-quick up wg0"
alias vpnvillage="sudo wg-quick up village-wg1"
alias xremaps="sudo xremap ~/.config/xremap/config.yml"
alias llama="~/projects/llama.cpp/build/bin/llama-server -m /home/anon/projects/llama.cpp/models/Llama-3.2-3B-Instruct-F16.gguf"
alias obsidian="cd ~/sync/PersonalObsidian/ && nvim"
alias cdots="cd ~/.dotfiles/.config/"
alias dots="cd ~/.dotfiles/.config/ && nvim"
alias aliases="bat ~/.config/fish/config.fish"
alias ipadd="sudo ip route add 192.168.0.234 dev wg0"
alias copy="wl-copy"
# List Directory
alias ls="lsd"
alias l="ls -l"
alias la="ls -a"
alias lla="ls -la"
alias lt="ls --tree"
# Git
alias gs="git status"
alias gca="git add -p . && git commit"
alias gd="git diff --word-diff"
alias gl="git log --graph --show-signature"
alias gla="git log --all --decorate --oneline --graph"
alias gm="git merge"
# Handy change dir shortcuts
abbr .. "cd .."
abbr ... "cd ../.."
abbr .3 "cd ../../.."
abbr .4 "cd ../../../.."
abbr .5 "cd ../../../../.."
# Always mkdir a path (this doesn't inhibit functionality to make a single dir)
abbr mkdir "mkdir -p"
zoxide init --cmd cd fish | source

30
.config/fish/dmz.txt Normal file
View File

@@ -0,0 +1,30 @@
                          .dO00Od'                          
                         d00000000d.                        
                        d0000000000k                        
                        x0000000000O                        
                         k000000000                         
                           ;0000: Okc                       
                                    kkc                     
                                      kkc                   
                                        dkl                 
                                          okl               
                                            lOl             
                                              cOo.          
 .lxkOOkxl.              .lxkOOkxl.             ;OoxkOOkxl. 
'O00000000O,            'O00000000O,            '000000000O,
O0000000000OddddddddddddO00000000000ddddddddddddO00000000000
c0000000000c            :0000000000l            :0000000000l
 .00000000.              .00000000'             '000000000' 
                             00               'd0.          
                             00             ,d0.            
                             00           ,x0               
                             00         :x0                 
                             00       cxO                   
                             00     ckO                     
                           .c00l' ckk                       
                         ck000000O0                         
                        c0000000000o                        
                        O00000000000                        
                        .0000000000.                        
                          ,000000:                          
                             :c                             

View File

@@ -0,0 +1,46 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR --export BAT_THEME:gruvbox
SETUVAR --export EDITOR:nvim
SETUVAR --export MANPAGER:nvim\x20\x2bMan\x21
SETUVAR --export MANROFFOPT:\x2dP\x20\x2dc
SETUVAR __fish_initialized:3800
SETUVAR fish_color_autosuggestion:4D5566
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:39BAE6
SETUVAR fish_color_comment:626A73
SETUVAR fish_color_cwd:59C2FF
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:F29668
SETUVAR fish_color_error:FF3333
SETUVAR fish_color_escape:95E6CB
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_keyword:39BAE6
SETUVAR fish_color_match:F07178
SETUVAR fish_color_normal:B3B1AD
SETUVAR fish_color_operator:E6B450
SETUVAR fish_color_option:B3B1AD
SETUVAR fish_color_param:B3B1AD
SETUVAR fish_color_quote:C2D94C
SETUVAR fish_color_redirection:FFEE99
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_color_selection:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_background:\x1d
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_secondary_background:\x1d
SETUVAR fish_pager_color_secondary_completion:\x1d
SETUVAR fish_pager_color_secondary_description:\x1d
SETUVAR fish_pager_color_secondary_prefix:\x1d
SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dE6B450
SETUVAR fish_pager_color_selected_completion:\x1d
SETUVAR fish_pager_color_selected_description:\x1d
SETUVAR fish_pager_color_selected_prefix:\x1d

View File

@@ -0,0 +1,3 @@
function ask --description 'answer from cht.sh'
curl -s https://cht.sh/$(string join '+' $argv[1..])
end

View File

@@ -0,0 +1,7 @@
function fish_greeting
#curl "wttr.in/Belgrade?format=%l:+%c+%t+|+%h+|+%w+|+(%%M+%m)\n"
cat ~/.config/fish/greet.txt ## populated by cronjob
date +"📅 %d. %b 🕗 %H:%M - %A"
end

View File

@@ -0,0 +1,14 @@
function fish_prompt
if test -n "$SSH_TTY"
echo -n (set_color brred)"$USER"(set_color white)'@'(set_color yellow)(prompt_hostname)' '
end
echo -n (set_color blue)(prompt_pwd)' '
set_color -o
if fish_is_root_user
echo -n (set_color red)'# '
end
echo -n (set_color red)''(set_color yellow)''(set_color green)' '
set_color normal
end

View File

@@ -0,0 +1,161 @@
function fish_right_prompt
set -l cmd_status $status
if test $cmd_status -ne 0
echo -n (set_color red)"$cmd_status"
end
if not command -sq git
set_color normal
return
end
# Get the git directory for later use.
# Return if not inside a Git repository work tree.
if not set -l git_dir (command git rev-parse --git-dir 2>/dev/null)
set_color normal
return
end
# Get the current action ("merge", "rebase", etc.)
# and if there's one get the current commit hash too.
set -l commit ''
if set -l action (fish_print_git_action "$git_dir")
set commit (command git rev-parse HEAD 2> /dev/null | string sub -l 7)
end
# Get either the branch name or a branch descriptor.
set -l branch_detached 0
if not set -l branch (command git symbolic-ref --short HEAD 2>/dev/null)
set branch_detached 1
set branch (command git describe --contains --all HEAD 2>/dev/null)
end
# Get the commit difference counts between local and remote.
command git rev-list --count --left-right 'HEAD...@{upstream}' 2>/dev/null \
| read -d \t -l status_ahead status_behind
if test $status -ne 0
set status_ahead 0
set status_behind 0
end
# Get the stash status.
# (git stash list) is very slow. => Avoid using it.
set -l status_stashed 0
if test -f "$git_dir/refs/stash"
set status_stashed 1
else if test -r "$git_dir/commondir"
read -l commondir <"$git_dir/commondir"
if test -f "$commondir/refs/stash"
set status_stashed 1
end
end
# git-status' porcelain v1 format starts with 2 letters on each line:
# The first letter (X) denotes the index state.
# The second letter (Y) denotes the working directory state.
#
# The following table presents the possible combinations:
# * The underscore character denotes whitespace.
# * The cell values stand for the following file states:
# a: added
# d: deleted
# m: modified
# r: renamed
# u: unmerged
# t: untracked
# * Cells with more than one letter signify that both states
# are simultaneously the case. This is possible since the git index
# and working directory operate independently of each other.
# * Cells which are empty are unhandled by this code.
# * T (= type change) is undocumented.
# See Git v1.7.8.2 release notes for more information.
#
# \ Y→
# X \
# ↓ | A | C | D | M | R | T | U | X | B | ? | _
# ----+----+----+----+----+----+----+----+----+----+----+----
# A | u | | ad | am | r | am | u | | | | a
# C | | | ad | am | r | am | u | | | | a
# D | | | u | am | r | am | u | | | | a
# M | | | ad | am | r | am | u | | | | a
# R | r | r | rd | rm | r | rm | ur | r | r | r | r
# T | | | ad | am | r | am | u | | | | a
# U | u | u | u | um | ur | um | u | u | u | u | u
# X | | | | m | r | m | u | | | |
# B | | | | m | r | m | u | | | |
# ? | | | | m | r | m | u | | | t |
# _ | | | d | m | r | m | u | | | |
set -l porcelain_status (command git status --porcelain 2>/dev/null | string sub -l2)
set -l status_added 0
if string match -qr '[ACDMT][ MT]|[ACMT]D' $porcelain_status
set status_added 1
end
set -l status_deleted 0
if string match -qr '[ ACMRT]D' $porcelain_status
set status_deleted 1
end
set -l status_modified 0
if string match -qr '[MT]$' $porcelain_status
set status_modified 1
end
set -l status_renamed 0
if string match -qe R $porcelain_status
set status_renamed 1
end
set -l status_unmerged 0
if string match -qr 'AA|DD|U' $porcelain_status
set status_unmerged 1
end
set -l status_untracked 0
if string match -qe '\?\?' $porcelain_status
set status_untracked 1
end
set_color -o
if test -n "$branch"
if test $branch_detached -ne 0
set_color brmagenta
else
set_color green
end
echo -n " $branch"
end
if test -n "$commit"
echo -n ' '(set_color yellow)"$commit"
end
if test -n "$action"
set_color normal
echo -n (set_color white)':'(set_color -o brred)"$action"
end
if test $status_ahead -ne 0
echo -n ' '(set_color brmagenta)'⬆'
end
if test $status_behind -ne 0
echo -n ' '(set_color brmagenta)'⬇'
end
if test $status_stashed -ne 0
echo -n ' '(set_color cyan)'✭'
end
if test $status_added -ne 0
echo -n ' '(set_color green)'✚'
end
if test $status_deleted -ne 0
echo -n ' '(set_color red)'✖'
end
if test $status_modified -ne 0
echo -n ' '(set_color blue)'✱'
end
if test $status_renamed -ne 0
echo -n ' '(set_color magenta)'➜'
end
if test $status_unmerged -ne 0
echo -n ' '(set_color yellow)'═'
end
if test $status_untracked -ne 0
echo -n ' '(set_color white)'◼'
end
set_color normal
end

View File

@@ -0,0 +1,8 @@
function fish_user_key_bindings
fish_default_key_bindings -M insert
fish_vi_key_bindings --no-erase insert
bind -M default ctrl-a beginning-of-line
bind -M default ctrl-e end-of-line
bind -M insert ctrl-space accept-autosuggestion
bind -M insert ctrl-g 'git diff' repaint
end