From b93bcbba4e3acb955c3c205aa7916ce19e657132 Mon Sep 17 00:00:00 2001 From: Von Random Date: Sun, 5 Feb 2023 22:38:36 +0200 Subject: [PATCH] fish: more config and functions --- cli/.config/fish/conf.d/globals.fish | 6 ++++++ cli/.config/fish/conf.d/prompt.fish | 6 ++++++ cli/.config/fish/config.fish | 7 ------- cli/.config/fish/functions/gsi.fish | 2 +- cli/.config/fish/functions/s.fish | 3 +++ cli/.config/fish/functions/termcompat.fish | 15 +++++++++++++++ cli/.config/fish/functions/tig.fish | 3 +++ 7 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 cli/.config/fish/conf.d/globals.fish create mode 100644 cli/.config/fish/conf.d/prompt.fish create mode 100644 cli/.config/fish/functions/s.fish create mode 100644 cli/.config/fish/functions/termcompat.fish create mode 100644 cli/.config/fish/functions/tig.fish diff --git a/cli/.config/fish/conf.d/globals.fish b/cli/.config/fish/conf.d/globals.fish new file mode 100644 index 0000000..79ff1a8 --- /dev/null +++ b/cli/.config/fish/conf.d/globals.fish @@ -0,0 +1,6 @@ +set -x LESS 'i M R' +set -x PAGER less +set -x EDITOR nvim +set -x TIME_STYLE long-iso +set -x SSH_AUTH_SOCK "$HOME/.ssh/ssh_auth_sock" +set -x ALTERNATE_EDITOR "" diff --git a/cli/.config/fish/conf.d/prompt.fish b/cli/.config/fish/conf.d/prompt.fish new file mode 100644 index 0000000..b563d1e --- /dev/null +++ b/cli/.config/fish/conf.d/prompt.fish @@ -0,0 +1,6 @@ +set prompt_sep_a \ue0b0 +set prompt_bang \n\ (set_color brblue)\u266a\ +set git_sign \ue0a0 +set color_fg brwhite +set color_git_branch 3c3c3c +set color_git yellow blue red purple diff --git a/cli/.config/fish/config.fish b/cli/.config/fish/config.fish index ef2d1f1..4fe2b37 100644 --- a/cli/.config/fish/config.fish +++ b/cli/.config/fish/config.fish @@ -1,11 +1,4 @@ if status is-interactive - set prompt_sep_a \ue0b0 - set prompt_bang \n\ (set_color brblue)\u266a\ - set git_sign \ue0a0 - set color_fg brwhite - set color_git_branch 3c3c3c - set color_git yellow blue red purple - set -l grc_cmds \ iptables ipneighbor ipaddr iproute ip nmap netstat \ traceroute tcpdump ss ping \ diff --git a/cli/.config/fish/functions/gsi.fish b/cli/.config/fish/functions/gsi.fish index dd40563..28793c0 100644 --- a/cli/.config/fish/functions/gsi.fish +++ b/cli/.config/fish/functions/gsi.fish @@ -1,3 +1,3 @@ function gsi - tig status + termcompat tig status end diff --git a/cli/.config/fish/functions/s.fish b/cli/.config/fish/functions/s.fish new file mode 100644 index 0000000..e297813 --- /dev/null +++ b/cli/.config/fish/functions/s.fish @@ -0,0 +1,3 @@ +function s + termcompat ssh $argv +end diff --git a/cli/.config/fish/functions/termcompat.fish b/cli/.config/fish/functions/termcompat.fish new file mode 100644 index 0000000..11128c6 --- /dev/null +++ b/cli/.config/fish/functions/termcompat.fish @@ -0,0 +1,15 @@ +function termcompat + set -l term $TERM + switch $term + case 'alacritty*' 'kitty*' 'wezterm' 'xterm-*' + set term xterm + case 'rxvt-unicode-*' + set term rxvt-unicode + case 'tmux*' + set term screen.xterm-new + end + begin + set -lx TERM $term + command $argv + end +end diff --git a/cli/.config/fish/functions/tig.fish b/cli/.config/fish/functions/tig.fish new file mode 100644 index 0000000..54b0d0f --- /dev/null +++ b/cli/.config/fish/functions/tig.fish @@ -0,0 +1,3 @@ +function tig + termcompat tig $argv +end