about summary refs log tree commit diff
path: root/fish
diff options
context:
space:
mode:
Diffstat (limited to 'fish')
-rw-r--r--fish/.local/etc/fish/conf.d/00_language.fish1
-rw-r--r--fish/.local/etc/fish/conf.d/10_xdg.fish36
-rw-r--r--fish/.local/etc/fish/conf.d/30_path.fish12
-rw-r--r--fish/.local/etc/fish/conf.d/50_browser.fish21
-rw-r--r--fish/.local/etc/fish/conf.d/50_diff.fish16
-rw-r--r--fish/.local/etc/fish/conf.d/50_editor.fish16
-rw-r--r--fish/.local/etc/fish/conf.d/50_pager.fish18
-rw-r--r--fish/.local/etc/fish/conf.d/bear.fish22
-rw-r--r--fish/.local/etc/fish/conf.d/beet.fish9
-rw-r--r--fish/.local/etc/fish/conf.d/ccache.fish11
-rw-r--r--fish/.local/etc/fish/conf.d/doom.fish7
-rw-r--r--fish/.local/etc/fish/conf.d/dotnet.fish14
-rw-r--r--fish/.local/etc/fish/conf.d/fzf.fish4
-rw-r--r--fish/.local/etc/fish/conf.d/git.fish7
-rw-r--r--fish/.local/etc/fish/conf.d/gnupg.fish3
-rw-r--r--fish/.local/etc/fish/config.fish0
-rw-r--r--fish/.local/etc/fish/fish_variables32
-rw-r--r--fish/.local/etc/fish/functions/ag.fish3
-rw-r--r--fish/.local/etc/fish/functions/disk.fish5
-rw-r--r--fish/.local/etc/fish/functions/ram.fish5
-rw-r--r--fish/.local/etc/fish/functions/sudo.fish5
-rwxr-xr-xfish/@install19
22 files changed, 266 insertions, 0 deletions
diff --git a/fish/.local/etc/fish/conf.d/00_language.fish b/fish/.local/etc/fish/conf.d/00_language.fish
new file mode 100644
index 0000000..5779887
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/00_language.fish
@@ -0,0 +1 @@
+set -x LC_COLLATE C
diff --git a/fish/.local/etc/fish/conf.d/10_xdg.fish b/fish/.local/etc/fish/conf.d/10_xdg.fish
new file mode 100644
index 0000000..dfe4125
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/10_xdg.fish
@@ -0,0 +1,36 @@
+#!/bin/fish
+
+set -x XDG_CACHE_HOME       "$HOME/.local/var/cache"
+set -x XDG_CONFIG_HOME      "$HOME/.local/etc"
+set -x XDG_DATA_HOME        "$HOME/.local/var/lib"
+set -x XDG_DESKTOP_DIR      "$HOME/documents"
+set -x XDG_DOCUMENTS_DIR    "$HOME/documents"
+set -x XDG_DOWNLOAD_DIR     "$HOME/downloads"
+set -x XDG_MUSIC_DIR        "$HOME/music"
+set -x XDG_PICTURES_DIR     "$HOME/pictures"
+set -x XDG_PUBLICSHARE_DIR  "$HOME/documents"
+set -x XDG_RUNTIME_DIR      "$HOME/.local/var/run"
+set -x XDG_TEMPLATES_DIR    "$HOME/documents"
+set -x XDG_VIDEOS_DIR       "$HOME/videos"
+
+set xdg_dirs
+set -a xdg_dirs $XDG_CACHE_HOME
+set -a xdg_dirs $XDG_CONFIG_HOME
+set -a xdg_dirs $XDG_DATA_HOME
+set -a xdg_dirs $XDG_DESKTOP_DIR
+set -a xdg_dirs $XDG_DOCUMENTS_DIR
+set -a xdg_dirs $XDG_DOWNLOAD_DIR
+set -a xdg_dirs $XDG_MUSIC_DIR
+set -a xdg_dirs $XDG_PICTURES_DIR
+set -a xdg_dirs $XDG_PUBLICSHARE_DIR
+set -a xdg_dirs $XDG_RUNTIME_DIR
+set -a xdg_dirs $XDG_TEMPLATES_DIR
+set -a xdg_dirs $XDG_VIDEOS_DIR
+
+for i in $xdg_dirs
+    if ! test -d $i
+        mkdir -p $i
+    end
+end
+
+set -e xdg_dirs
diff --git a/fish/.local/etc/fish/conf.d/30_path.fish b/fish/.local/etc/fish/conf.d/30_path.fish
new file mode 100644
index 0000000..b8b6bfa
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/30_path.fish
@@ -0,0 +1,12 @@
+set -e PATH
+
+set PATH
+set -a PATH "/sbin"
+set -a PATH "/bin"
+set -a PATH "/usr/sbin"
+set -a PATH "/usr/bin"
+set -a PATH "/usr/local/bin"
+set -a PATH "$HOME/.bin"
+set -a PATH "$HOME/.local/bin"
+
+set -x PATH
diff --git a/fish/.local/etc/fish/conf.d/50_browser.fish b/fish/.local/etc/fish/conf.d/50_browser.fish
new file mode 100644
index 0000000..0e79ba6
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/50_browser.fish
@@ -0,0 +1,21 @@
+set alts
+set -a alts qutebrowser
+set -a alts librewolf
+set -a alts firefox
+set -a alts chromium
+set -a alts chromium-browser
+set -a alts surf
+set -a alts w3m
+set -a alts lynx
+set -a alts elinks
+set -a alts links
+
+for i in $alts
+    if command -s $i &>/dev/null
+        set -x BROWSER $i
+        alias b $i
+        break
+    end
+end
+
+set -e alts
diff --git a/fish/.local/etc/fish/conf.d/50_diff.fish b/fish/.local/etc/fish/conf.d/50_diff.fish
new file mode 100644
index 0000000..000c93b
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/50_diff.fish
@@ -0,0 +1,16 @@
+set alts
+set -a alts batdiff
+set -a alts colordiff
+set -a alts cwdiff
+set -a alts wdiff
+set -a alts diff
+
+for i in $alts
+    if command -s $i &>/dev/null
+        set -x DIFF $i
+        alias d $i
+        break
+    end
+end
+
+set -e alts
diff --git a/fish/.local/etc/fish/conf.d/50_editor.fish b/fish/.local/etc/fish/conf.d/50_editor.fish
new file mode 100644
index 0000000..a240123
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/50_editor.fish
@@ -0,0 +1,16 @@
+set alts
+set -a alts nvim
+set -a alts vim
+set -a alts vi
+set -a alts nano
+set -a alts ed
+
+for i in $alts
+    if command -s $i &>/dev/null
+        set -x EDITOR $i
+        alias e $i
+        break
+    end
+end
+
+set -e alts
diff --git a/fish/.local/etc/fish/conf.d/50_pager.fish b/fish/.local/etc/fish/conf.d/50_pager.fish
new file mode 100644
index 0000000..dd643b5
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/50_pager.fish
@@ -0,0 +1,18 @@
+set alts
+set -a alts
+set -a alts slit
+set -a alts moar
+set -a alts most
+set -a alts less
+set -a alts more
+set -a alts cat
+
+for i in $alts
+    if command -s $i &>/dev/null
+        set -x PAGER $i
+        alias p $i
+        break
+    end
+end
+
+set -e alts
diff --git a/fish/.local/etc/fish/conf.d/bear.fish b/fish/.local/etc/fish/conf.d/bear.fish
new file mode 100644
index 0000000..096ba44
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/bear.fish
@@ -0,0 +1,22 @@
+if command -s bear &>/dev/null
+    set alts
+    set -a remake
+    set -a make
+
+    for i in $alts
+        if command -s $i &>/dev/null
+            set bear_base="bear --include=./include --include=../include $i"
+            if command -s nproc &>/dev/null
+                alias m "$bear_base --jobs=(math (nproc) + 1)"
+            else
+                alias m "$bear_base"
+            end
+            set -e bear_base
+
+            alias mc "m clean"
+
+            break
+        end
+    end
+    set -e alts
+end
diff --git a/fish/.local/etc/fish/conf.d/beet.fish b/fish/.local/etc/fish/conf.d/beet.fish
new file mode 100644
index 0000000..0882aba
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/beet.fish
@@ -0,0 +1,9 @@
+if command -s beet &>/dev/null
+    set -x BEETSDIR $XDG_DATA_HOME/beets
+
+    set beets_config $XDG_CONFIG_HOME/beets/config.yaml
+    if test -e $beets_config
+        alias beet "beet -c $beets_config"
+    end
+    set -e beets_config
+end
diff --git a/fish/.local/etc/fish/conf.d/ccache.fish b/fish/.local/etc/fish/conf.d/ccache.fish
new file mode 100644
index 0000000..d973e03
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/ccache.fish
@@ -0,0 +1,11 @@
+if command -s ccache &>/dev/null
+    set -x CCACHE_DIR $HOME/.ccache
+
+    set ccache_bin "/usr/lib/ccache/bin"
+    if test -d $ccache_bin
+        set -x CCACHE_PATH $ccache_bin:$PATH
+    else
+        set -x CCACHE_PATH $PATH
+    end
+    set -e ccache_bin
+end
diff --git a/fish/.local/etc/fish/conf.d/doom.fish b/fish/.local/etc/fish/conf.d/doom.fish
new file mode 100644
index 0000000..44cb0c8
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/doom.fish
@@ -0,0 +1,7 @@
+set doom_bin $HOME/.emacs.d/bin
+
+if test -x $doom_bin/doom
+    set -a PATH $doom_bin
+end
+
+set -e doom_bin
diff --git a/fish/.local/etc/fish/conf.d/dotnet.fish b/fish/.local/etc/fish/conf.d/dotnet.fish
new file mode 100644
index 0000000..282aa60
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/dotnet.fish
@@ -0,0 +1,14 @@
+if command -s dotnet &>/dev/null
+    set -a PATH $HOME/.dotnet/tools
+
+    set -x DOTNET_CLI_TELEMETRY_OPTOUT 1
+    set -x DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
+
+    if command -s nuget &>/dev/null
+        set -x NUGET_CERT_REVOCATION_MODE online
+        set -x NUGET_PERSIST_DG false
+        set -x NUGET_RESTORE_MSBUILD_VERBOSITY normal
+        set -x NUGET_SHOW_STACK true
+        set -x NUGET_XMLDOC_MODE skip
+    end
+end
diff --git a/fish/.local/etc/fish/conf.d/fzf.fish b/fish/.local/etc/fish/conf.d/fzf.fish
new file mode 100644
index 0000000..5f11499
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/fzf.fish
@@ -0,0 +1,4 @@
+if command -s fzf &>/dev/null
+    set -x FZF_DEFAULT_COMMAND
+    set -x FZF_DEFAULT_OPTS "--height 20% --reverse --border"
+end
diff --git a/fish/.local/etc/fish/conf.d/git.fish b/fish/.local/etc/fish/conf.d/git.fish
new file mode 100644
index 0000000..f3c33f5
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/git.fish
@@ -0,0 +1,7 @@
+if command -s git &>/dev/null
+    if command -s hub &>/dev/null
+        alias git hub
+    end
+
+    alias g git
+end
diff --git a/fish/.local/etc/fish/conf.d/gnupg.fish b/fish/.local/etc/fish/conf.d/gnupg.fish
new file mode 100644
index 0000000..ccf9205
--- /dev/null
+++ b/fish/.local/etc/fish/conf.d/gnupg.fish
@@ -0,0 +1,3 @@
+if command -s gpg &>/dev/null
+    set -x GPG_TTY (tty)
+end
diff --git a/fish/.local/etc/fish/config.fish b/fish/.local/etc/fish/config.fish
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fish/.local/etc/fish/config.fish
diff --git a/fish/.local/etc/fish/fish_variables b/fish/.local/etc/fish/fish_variables
new file mode 100644
index 0000000..8fec0ec
--- /dev/null
+++ b/fish/.local/etc/fish/fish_variables
@@ -0,0 +1,32 @@
+# This file contains fish universal variable definitions.
+# VERSION: 3.0
+SETUVAR __fish_initialized:3100
+SETUVAR fish_color_autosuggestion:555\x1ebrblack
+SETUVAR fish_color_cancel:\x2dr
+SETUVAR fish_color_command:005fd7
+SETUVAR fish_color_comment:990000
+SETUVAR fish_color_cwd:green
+SETUVAR fish_color_cwd_root:red
+SETUVAR fish_color_end:009900
+SETUVAR fish_color_error:ff0000
+SETUVAR fish_color_escape:00a6b2
+SETUVAR fish_color_history_current:\x2d\x2dbold
+SETUVAR fish_color_host:normal
+SETUVAR fish_color_host_remote:yellow
+SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
+SETUVAR fish_color_normal:normal
+SETUVAR fish_color_operator:00a6b2
+SETUVAR fish_color_param:00afff
+SETUVAR fish_color_quote:999900
+SETUVAR fish_color_redirection:00afff
+SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
+SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
+SETUVAR fish_color_status:red
+SETUVAR fish_color_user:brgreen
+SETUVAR fish_color_valid_path:\x2d\x2dunderline
+SETUVAR fish_greeting:\x1d
+SETUVAR fish_key_bindings:fish_default_key_bindings
+SETUVAR fish_pager_color_completion:\x1d
+SETUVAR fish_pager_color_description:B3A06D\x1eyellow
+SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
+SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
diff --git a/fish/.local/etc/fish/functions/ag.fish b/fish/.local/etc/fish/functions/ag.fish
new file mode 100644
index 0000000..6c76e6b
--- /dev/null
+++ b/fish/.local/etc/fish/functions/ag.fish
@@ -0,0 +1,3 @@
+if command -s ag &>/dev/null
+    alias ag "ag --color --smart-case"
+end
diff --git a/fish/.local/etc/fish/functions/disk.fish b/fish/.local/etc/fish/functions/disk.fish
new file mode 100644
index 0000000..ae91056
--- /dev/null
+++ b/fish/.local/etc/fish/functions/disk.fish
@@ -0,0 +1,5 @@
+if command -v df &>/dev/null
+    function disk -w df
+        df --human-readable --exclude-type=tmpfs --exclude-type=devtmpfs $argv
+    end
+end
diff --git a/fish/.local/etc/fish/functions/ram.fish b/fish/.local/etc/fish/functions/ram.fish
new file mode 100644
index 0000000..720328f
--- /dev/null
+++ b/fish/.local/etc/fish/functions/ram.fish
@@ -0,0 +1,5 @@
+if command -v free &>/dev/null
+    function ram -w free
+        free --human --wide
+    end
+end
diff --git a/fish/.local/etc/fish/functions/sudo.fish b/fish/.local/etc/fish/functions/sudo.fish
new file mode 100644
index 0000000..ad84a67
--- /dev/null
+++ b/fish/.local/etc/fish/functions/sudo.fish
@@ -0,0 +1,5 @@
+if command -v doas &>/dev/null and not command -s sudo &>/dev/null
+    function sudo -w doas
+        doas $argv
+    end
+end
diff --git a/fish/@install b/fish/@install
new file mode 100755
index 0000000..63c8393
--- /dev/null
+++ b/fish/@install
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+[ ! -d "${XDG_CONFIG_HOME}/fish" ] &&
+    mkdir -p "${XDG_CONFIG_HOME}/fish"
+
+[ ! -d "${XDG_CONFIG_HOME}/fish/completions" ] &&
+    mkdir -p "${XDG_CONFIG_HOME}/fish/completions"
+
+[ ! -d "${XDG_CONFIG_HOME}/fish/conf.d" ] &&
+    mkdir -p "${XDG_CONFIG_HOME}/fish/conf.d"
+
+[ ! -d "${XDG_CONFIG_HOME}/fish/functions" ] &&
+    mkdir -p "${XDG_CONFIG_HOME}/fish/functions"
+
+stow \
+    --target="${HOME}" \
+    --ignore="^@.*" \
+    --verbose \
+    fish

Consider giving Nix/NixOS a try! <3