summaryrefslogtreecommitdiff
path: root/dot_local/lib/sh
diff options
context:
space:
mode:
Diffstat (limited to 'dot_local/lib/sh')
-rw-r--r--dot_local/lib/sh/bat3
-rw-r--r--dot_local/lib/sh/bsdtar2
-rw-r--r--dot_local/lib/sh/colordiff3
-rw-r--r--dot_local/lib/sh/date2
-rw-r--r--dot_local/lib/sh/docker9
-rw-r--r--dot_local/lib/sh/docker.fish9
-rw-r--r--dot_local/lib/sh/exa7
-rw-r--r--dot_local/lib/sh/hascmd1
-rw-r--r--dot_local/lib/sh/hascmd.fish1
-rw-r--r--dot_local/lib/sh/iproute22
-rw-r--r--dot_local/lib/sh/jump5
-rw-r--r--dot_local/lib/sh/jump.fish2
-rw-r--r--dot_local/lib/sh/luarocks3
-rw-r--r--dot_local/lib/sh/luarocks.fish3
-rw-r--r--dot_local/lib/sh/rg2
-rw-r--r--dot_local/lib/sh/skim2
-rw-r--r--dot_local/lib/sh/ssh2
-rw-r--r--dot_local/lib/sh/ugrep8
-rw-r--r--dot_local/lib/sh/xh3
19 files changed, 69 insertions, 0 deletions
diff --git a/dot_local/lib/sh/bat b/dot_local/lib/sh/bat
new file mode 100644
index 0000000..6ac64f8
--- /dev/null
+++ b/dot_local/lib/sh/bat
@@ -0,0 +1,3 @@
+. hascmd bat || return
+alias cat=bat
+alias c='bat -pp'
diff --git a/dot_local/lib/sh/bsdtar b/dot_local/lib/sh/bsdtar
new file mode 100644
index 0000000..a5ca6e5
--- /dev/null
+++ b/dot_local/lib/sh/bsdtar
@@ -0,0 +1,2 @@
+. hascmd bsdtar || return
+alias tar=bsdtar
diff --git a/dot_local/lib/sh/colordiff b/dot_local/lib/sh/colordiff
new file mode 100644
index 0000000..d14132f
--- /dev/null
+++ b/dot_local/lib/sh/colordiff
@@ -0,0 +1,3 @@
+. hascmd colordiff || return
+alias diff=colordiff
+alias dif='colordiff -u'
diff --git a/dot_local/lib/sh/date b/dot_local/lib/sh/date
new file mode 100644
index 0000000..2c9e297
--- /dev/null
+++ b/dot_local/lib/sh/date
@@ -0,0 +1,2 @@
+. hascmd date || return
+alias weekdate="date '+%W %a'"
diff --git a/dot_local/lib/sh/docker b/dot_local/lib/sh/docker
new file mode 100644
index 0000000..a7ccf0a
--- /dev/null
+++ b/dot_local/lib/sh/docker
@@ -0,0 +1,9 @@
+if . hascmd podman; then
+ alias docker=podman
+elif . hascmd docker; then
+else
+ return
+fi
+
+alias dit='docker run -it --rm'
+alias drun='dit -v "$(pwd)":/pwd:Z -w /pwd'
diff --git a/dot_local/lib/sh/docker.fish b/dot_local/lib/sh/docker.fish
new file mode 100644
index 0000000..e04437b
--- /dev/null
+++ b/dot_local/lib/sh/docker.fish
@@ -0,0 +1,9 @@
+if . hascmd podman
+ alias docker=podman
+else if . hascmd docker
+else
+ return
+end
+
+alias dit='docker run -it --rm'
+alias drun='dit -v (pwd):/pwd:Z -w /pwd'
diff --git a/dot_local/lib/sh/exa b/dot_local/lib/sh/exa
new file mode 100644
index 0000000..4fcfc31
--- /dev/null
+++ b/dot_local/lib/sh/exa
@@ -0,0 +1,7 @@
+. hascmd exa || return
+alias ls=exa
+alias l='exa -l'
+alias ll='exa -l'
+alias la='exa -la'
+
+alias tree='exa -T'
diff --git a/dot_local/lib/sh/hascmd b/dot_local/lib/sh/hascmd
new file mode 100644
index 0000000..994bc71
--- /dev/null
+++ b/dot_local/lib/sh/hascmd
@@ -0,0 +1 @@
+test -x "$(command -v $1)"
diff --git a/dot_local/lib/sh/hascmd.fish b/dot_local/lib/sh/hascmd.fish
new file mode 100644
index 0000000..9d566c8
--- /dev/null
+++ b/dot_local/lib/sh/hascmd.fish
@@ -0,0 +1 @@
+type -qf $argv
diff --git a/dot_local/lib/sh/iproute2 b/dot_local/lib/sh/iproute2
new file mode 100644
index 0000000..18a0dd0
--- /dev/null
+++ b/dot_local/lib/sh/iproute2
@@ -0,0 +1,2 @@
+. hascmd ip || return
+alias ip='ip -c=auto'
diff --git a/dot_local/lib/sh/jump b/dot_local/lib/sh/jump
new file mode 100644
index 0000000..8df5747
--- /dev/null
+++ b/dot_local/lib/sh/jump
@@ -0,0 +1,5 @@
+. hascmd jump || return
+
+# this generally won't be used
+# in favor of explicit versions
+eval "$(jump shell)"
diff --git a/dot_local/lib/sh/jump.fish b/dot_local/lib/sh/jump.fish
new file mode 100644
index 0000000..1eb72a9
--- /dev/null
+++ b/dot_local/lib/sh/jump.fish
@@ -0,0 +1,2 @@
+. hascmd jump || return
+jump shell fish | source
diff --git a/dot_local/lib/sh/luarocks b/dot_local/lib/sh/luarocks
new file mode 100644
index 0000000..f7dcb84
--- /dev/null
+++ b/dot_local/lib/sh/luarocks
@@ -0,0 +1,3 @@
+. hascmd luarocks || return
+export LUA_CPATH=$(luarocks path --lr-cpath)
+export LUA_PATH=$(luarocks path --lr-path)";./?.lua"
diff --git a/dot_local/lib/sh/luarocks.fish b/dot_local/lib/sh/luarocks.fish
new file mode 100644
index 0000000..c6b92f5
--- /dev/null
+++ b/dot_local/lib/sh/luarocks.fish
@@ -0,0 +1,3 @@
+. hascmd luarocks || return
+set -x LUA_CPATH (luarocks path --lr-cpath)
+set -x LUA_PATH (luarocks path --lr-path)";./?.lua"
diff --git a/dot_local/lib/sh/rg b/dot_local/lib/sh/rg
new file mode 100644
index 0000000..77a05e3
--- /dev/null
+++ b/dot_local/lib/sh/rg
@@ -0,0 +1,2 @@
+. hascmd rg || return
+[ -f ~/.config/ripgrep.conf ] && export RIPGREP_CONFIG_PATH=~/.config/ripgrep.conf
diff --git a/dot_local/lib/sh/skim b/dot_local/lib/sh/skim
new file mode 100644
index 0000000..bef7e11
--- /dev/null
+++ b/dot_local/lib/sh/skim
@@ -0,0 +1,2 @@
+. hascmd sk || return
+export SKIM_DEFAULT_COMMAND="fd --type f || rg --files || find ."
diff --git a/dot_local/lib/sh/ssh b/dot_local/lib/sh/ssh
new file mode 100644
index 0000000..4f007b1
--- /dev/null
+++ b/dot_local/lib/sh/ssh
@@ -0,0 +1,2 @@
+. hascmd ssh || return
+alias ossh='ssh -p StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Error'
diff --git a/dot_local/lib/sh/ugrep b/dot_local/lib/sh/ugrep
new file mode 100644
index 0000000..1000a39
--- /dev/null
+++ b/dot_local/lib/sh/ugrep
@@ -0,0 +1,8 @@
+. hascmd ugrep || return
+alias grep='ugrep -G -.'
+alias xdump='ugrep -X ""'
+
+. hascmd ug || return
+alias uq='ug -Q'
+alias ux='ug -UX'
+alias uz='ug -z'
diff --git a/dot_local/lib/sh/xh b/dot_local/lib/sh/xh
new file mode 100644
index 0000000..a69fbcb
--- /dev/null
+++ b/dot_local/lib/sh/xh
@@ -0,0 +1,3 @@
+. hascmd xh || return
+alias xh='xh -F'
+alias x='xh -b'