fish: Clean up with fish_indent
This commit is contained in:
parent
6a6a8b4d2a
commit
478fede9e4
107 changed files with 370 additions and 362 deletions
|
@ -1,73 +1,73 @@
|
||||||
function __fish_setup_on_tty_login --description "Set up environment on tty login"
|
function __fish_setup_on_tty_login --description "Set up environment on tty login"
|
||||||
set -qx XDG_CONFIG_HOME; or set -Ux XDG_CONFIG_HOME $HOME/.config
|
set -qx XDG_CONFIG_HOME; or set -Ux XDG_CONFIG_HOME $HOME/.config
|
||||||
set -qx XDG_CACHE_HOME; or set -Ux XDG_CACHE_HOME $HOME/.cache
|
set -qx XDG_CACHE_HOME; or set -Ux XDG_CACHE_HOME $HOME/.cache
|
||||||
set -qx XDG_DATA_HOME; or set -Ux XDG_DATA_HOME $HOME/.local/share
|
set -qx XDG_DATA_HOME; or set -Ux XDG_DATA_HOME $HOME/.local/share
|
||||||
set -qx XDG_STATE_HOME; or set -Ux XDG_STATE_HOME $HOME/.local/state
|
set -qx XDG_STATE_HOME; or set -Ux XDG_STATE_HOME $HOME/.local/state
|
||||||
set -qx SSH_AUTH_SOCK; or set -Ux SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
|
set -qx SSH_AUTH_SOCK; or set -Ux SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
|
||||||
|
|
||||||
# Wayland session
|
# Wayland session
|
||||||
set -qx XDG_SESSION_TYPE; or set -Ux XDG_SESSION_TYPE wayland
|
set -qx XDG_SESSION_TYPE; or set -Ux XDG_SESSION_TYPE wayland
|
||||||
set -qx XDG_SESSION_DESKTOP; or set -Ux XDG_SESSION_DESKTOP wayland
|
set -qx XDG_SESSION_DESKTOP; or set -Ux XDG_SESSION_DESKTOP wayland
|
||||||
set -qx XDG_CURRENT_DESKTOP; or set -Ux XDG_CURRENT_DESKTOP wayland
|
set -qx XDG_CURRENT_DESKTOP; or set -Ux XDG_CURRENT_DESKTOP wayland
|
||||||
|
|
||||||
# Firefox
|
# Firefox
|
||||||
set -qx MOZ_ENABLE_WAYLAND; or set -Ux MOZ_ENABLE_WAYLAND 1
|
set -qx MOZ_ENABLE_WAYLAND; or set -Ux MOZ_ENABLE_WAYLAND 1
|
||||||
set -qx MOZ_DBUS_REMOTE; or set -Ux MOZ_DBUS_REMOTE 1
|
set -qx MOZ_DBUS_REMOTE; or set -Ux MOZ_DBUS_REMOTE 1
|
||||||
|
|
||||||
# QT
|
# QT
|
||||||
set -qx QT_QPA_PLATFORM; or set -Ux QT_QPA_PLATFORM wayland
|
set -qx QT_QPA_PLATFORM; or set -Ux QT_QPA_PLATFORM wayland
|
||||||
set -qx QT_QPA_PLATFORMTHEME; or set -Ux QT_QPA_PLATFORMTHEME qt5ct
|
set -qx QT_QPA_PLATFORMTHEME; or set -Ux QT_QPA_PLATFORMTHEME qt5ct
|
||||||
|
|
||||||
for extra_path in ~/.{local,nix-profile,cargo,cabal,ghcup}/bin
|
for extra_path in ~/.{local,nix-profile,cargo,cabal,ghcup}/bin
|
||||||
if test -d "$extra_path"
|
if test -d "$extra_path"
|
||||||
set -gxp PATH "$extra_path"
|
set -gxp PATH "$extra_path"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if type -qf nvim
|
if type -qf nvim
|
||||||
set -gx EDITOR nvim
|
set -gx EDITOR nvim
|
||||||
set -gx VISUAL nvim
|
set -gx VISUAL nvim
|
||||||
set -gx MANPAGER 'nvim +Man!'
|
set -gx MANPAGER 'nvim +Man!'
|
||||||
else
|
else
|
||||||
if type -qf vim
|
if type -qf vim
|
||||||
set -gx EDITOR vim
|
set -gx EDITOR vim
|
||||||
set -gx VISUAL vim
|
set -gx VISUAL vim
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if test -d {$HOME}/.nix-defexpr/channels
|
if test -d {$HOME}/.nix-defexpr/channels
|
||||||
set -gx NIX_PATH {$HOME}/.nix-defexpr/channels
|
set -gx NIX_PATH {$HOME}/.nix-defexpr/channels
|
||||||
set -gx NIX_SSL_CERT_FILE '/etc/ssl/certs/ca-certificates.crt'
|
set -gx NIX_SSL_CERT_FILE '/etc/ssl/certs/ca-certificates.crt'
|
||||||
end
|
|
||||||
|
|
||||||
if test -d /var/lib/flatpak
|
|
||||||
# https://github.com/fish-shell/fish-shell/issues/7485#issuecomment-728984689
|
|
||||||
# https://wiki.archlinux.org/title/Flatpak#Adding_Flatpak_.desktop_files_to_your_menu
|
|
||||||
set -l xdg_data_home $XDG_DATA_HOME ~/.local/share
|
|
||||||
set -gx --path XDG_DATA_DIRS $xdg_data_home[1]/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
|
|
||||||
|
|
||||||
for flatpakdir in ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin
|
|
||||||
if test -d $flatpakdir
|
|
||||||
contains $flatpakdir $PATH; or set -a PATH $flatpakdir
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if type -qf fnm
|
if test -d /var/lib/flatpak
|
||||||
fnm env --shell=fish --log-level=quiet | source
|
# https://github.com/fish-shell/fish-shell/issues/7485#issuecomment-728984689
|
||||||
end
|
# https://wiki.archlinux.org/title/Flatpak#Adding_Flatpak_.desktop_files_to_your_menu
|
||||||
|
set -l xdg_data_home $XDG_DATA_HOME ~/.local/share
|
||||||
|
set -gx --path XDG_DATA_DIRS $xdg_data_home[1]/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
|
||||||
|
|
||||||
set -gx CLICOLOR 1
|
for flatpakdir in ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin
|
||||||
set -gx LSCOLORS 'gxfxcxdxbxegedabaggxgx'
|
if test -d $flatpakdir
|
||||||
|
contains $flatpakdir $PATH; or set -a PATH $flatpakdir
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
set -Ux GST_DEBUG_NO_COLOR 1
|
if type -qf fnm
|
||||||
set -Ux GST_DEBUG_COLOR_MODE "off"
|
fnm env --shell=fish --log-level=quiet | source
|
||||||
|
end
|
||||||
|
|
||||||
mkdir -p /tmp/gst-dot
|
set -gx CLICOLOR 1
|
||||||
set -Ux GST_DEBUG_DUMP_DOT_DIR /tmp/gst-dot
|
set -gx LSCOLORS gxfxcxdxbxegedabaggxgx
|
||||||
|
|
||||||
|
set -Ux GST_DEBUG_NO_COLOR 1
|
||||||
|
set -Ux GST_DEBUG_COLOR_MODE off
|
||||||
|
|
||||||
|
mkdir -p /tmp/gst-dot
|
||||||
|
set -Ux GST_DEBUG_DUMP_DOT_DIR /tmp/gst-dot
|
||||||
end
|
end
|
||||||
|
|
||||||
# Instead of tty check, we would have liked to do this using status is-login
|
# Instead of tty check, we would have liked to do this using status is-login
|
||||||
# check but for some reason that does not work?
|
# check but for some reason that does not work?
|
||||||
set --local TTY1 (tty)
|
set --local TTY1 (tty)
|
||||||
[ "$TTY1" = "/dev/tty1" ] && __fish_setup_on_tty_login
|
[ "$TTY1" = /dev/tty1 ] && __fish_setup_on_tty_login
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# If running from tty1 start sway
|
# If running from tty1 start sway
|
||||||
set --local TTY1 (tty)
|
set --local TTY1 (tty)
|
||||||
[ "$TTY1" = "/dev/tty1" ] && exec sway
|
[ "$TTY1" = /dev/tty1 ] && exec sway
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
set -g VIRTUALFISH_VERSION 2.5.4
|
set -g VIRTUALFISH_VERSION 2.5.4
|
||||||
set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python
|
set -g VIRTUALFISH_PYTHON_EXEC /usr/bin/python
|
||||||
source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
|
source /usr/lib/python3.10/site-packages/virtualfish/virtual.fish
|
||||||
emit virtualfish_did_setup_plugins
|
emit virtualfish_did_setup_plugins
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
function b --description 'Move up the directory specified number of times'
|
function b --description 'Move up the directory specified number of times'
|
||||||
if test -z $argv[1]
|
if test -z $argv[1]
|
||||||
set n 1
|
set n 1
|
||||||
else
|
else
|
||||||
set n $argv[1]
|
set n $argv[1]
|
||||||
end
|
end
|
||||||
for i in (seq $n)
|
for i in (seq $n)
|
||||||
cd ..
|
cd ..
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function c --wraps=clear --description 'alias c=clear'
|
function c --wraps=clear --description 'alias c=clear'
|
||||||
clear $argv;
|
clear $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cat --wraps=bat --description 'alias cat=bat'
|
function cat --wraps=bat --description 'alias cat=bat'
|
||||||
bat $argv;
|
bat $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cbD --wraps='cargo doc --open' --description 'alias cbD=cargo doc --open'
|
function cbD --wraps='cargo doc --open' --description 'alias cbD=cargo doc --open'
|
||||||
cargo doc --open $argv;
|
cargo doc --open $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cba --wraps='cargo update && cargo build --all && cargo doc' --description 'alias cba=cargo update && cargo build --all && cargo doc'
|
function cba --wraps='cargo update && cargo build --all && cargo doc' --description 'alias cba=cargo update && cargo build --all && cargo doc'
|
||||||
cargo update && cargo build --all && cargo doc $argv;
|
cargo update && cargo build --all && cargo doc $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cbb --wraps='cargo build --all' --description 'alias cbb=cargo build --all'
|
function cbb --wraps='cargo build --all' --description 'alias cbb=cargo build --all'
|
||||||
cargo build --all $argv;
|
cargo build --all $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cbc --wraps='cargo clean' --description 'alias cbc=cargo clean'
|
function cbc --wraps='cargo clean' --description 'alias cbc=cargo clean'
|
||||||
cargo clean $argv;
|
cargo clean $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cbd --wraps='cargo doc' --description 'alias cbd=cargo doc'
|
function cbd --wraps='cargo doc' --description 'alias cbd=cargo doc'
|
||||||
cargo doc $argv;
|
cargo doc $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cbu --wraps='cargo update' --description 'alias cbu=cargo update'
|
function cbu --wraps='cargo update' --description 'alias cbu=cargo update'
|
||||||
cargo update $argv;
|
cargo update $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function cdG --description 'Select a coredump to run coredumpctl gdb'
|
function cdG --description 'Select a coredump to run coredumpctl gdb'
|
||||||
coredumpctl list --reverse | awk -F" " '$9 == "present"' | fzf | read -l result
|
coredumpctl list --reverse | awk -F" " '$9 == "present"' | fzf | read -l result
|
||||||
coredumpctl gdb (echo $result | awk -F" " '{print $5}')
|
coredumpctl gdb (echo $result | awk -F" " '{print $5}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function cdg --description 'coredumpctl gdb on last crashed process'
|
function cdg --description 'coredumpctl gdb on last crashed process'
|
||||||
coredumpctl gdb
|
coredumpctl gdb
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function cdi --description 'Select a coredump to run coredumpctl info'
|
function cdi --description 'Select a coredump to run coredumpctl info'
|
||||||
coredumpctl list --reverse | awk -F" " '$9 == "present"' | fzf | read -l result
|
coredumpctl list --reverse | awk -F" " '$9 == "present"' | fzf | read -l result
|
||||||
coredumpctl info (echo $result | awk -F" " '{print $5}')
|
coredumpctl info (echo $result | awk -F" " '{print $5}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function coqtop
|
function coqtop
|
||||||
rlwrap coqtop $argv
|
rlwrap coqtop $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function dotP --description 'Generate Pipewire dot graph for all nodes'
|
function dotP --description 'Generate Pipewire dot graph for all nodes'
|
||||||
pw-dot -L -a -o /tmp/pw.dot
|
pw-dot -L -a -o /tmp/pw.dot
|
||||||
dot -Tsvg /tmp/pw.dot > ~/Pictures/pipewire/pw-dot-(date +%T).svg
|
dot -Tsvg /tmp/pw.dot >~/Pictures/pipewire/pw-dot-(date +%T).svg
|
||||||
rm /tmp/pw.dot
|
rm /tmp/pw.dot
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
function dotg --description 'Generate gstreamer dot graph for selected file'
|
function dotg --description 'Generate gstreamer dot graph for selected file'
|
||||||
if count $argv > /dev/null
|
if count $argv >/dev/null
|
||||||
set dotpath "$argv"
|
set dotpath "$argv"
|
||||||
else
|
else
|
||||||
set dotpath "$GST_DEBUG_DUMP_DOT_DIR"
|
set dotpath "$GST_DEBUG_DUMP_DOT_DIR"
|
||||||
end
|
end
|
||||||
|
|
||||||
find $dotpath -maxdepth 1 -regextype posix-extended -regex ".*\.(dot)" | fzf | read -l result;
|
find $dotpath -maxdepth 1 -regextype posix-extended -regex ".*\.(dot)" | fzf | read -l result
|
||||||
|
|
||||||
if test -n "$result"
|
if test -n "$result"
|
||||||
dot -Tsvg "$result" -O
|
dot -Tsvg "$result" -O
|
||||||
mv "$result".svg ~/Pictures/gstreamer
|
mv "$result".svg ~/Pictures/gstreamer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function dotp --description 'Generate Pipewire dot graph for linked nodes'
|
function dotp --description 'Generate Pipewire dot graph for linked nodes'
|
||||||
pw-dot -L -s -o /tmp/pw.dot
|
pw-dot -L -s -o /tmp/pw.dot
|
||||||
dot -Tsvg /tmp/pw.dot > ~/Pictures/pipewire/pw-dot-(date +%T).svg
|
dot -Tsvg /tmp/pw.dot >~/Pictures/pipewire/pw-dot-(date +%T).svg
|
||||||
rm /tmp/pw.dot
|
rm /tmp/pw.dot
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function dpw --wraps=pw-dump\ \|\ jq\ \|\ nvim\ -c\ \'setlocal\ ft=json\'\ -R --description alias\ dpw=pw-dump\ \|\ jq\ \|\ nvim\ -c\ \'setlocal\ ft=json\'\ -R
|
function dpw --wraps=pw-dump\ \|\ jq\ \|\ nvim\ -c\ \'setlocal\ ft=json\'\ -R --description alias\ dpw=pw-dump\ \|\ jq\ \|\ nvim\ -c\ \'setlocal\ ft=json\'\ -R
|
||||||
pw-dump | jq | nvim -c 'setlocal ft=json' -R $argv;
|
pw-dump | jq | nvim -c 'setlocal ft=json' -R $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fcR --description 'Git revert a selected commit using fzf'
|
function fcR --description 'Git revert a selected commit using fzf'
|
||||||
git revert (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi +s | awk '{print $1}')
|
git revert (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi +s | awk '{print $1}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fcf --description 'Git commit fixup using fzf'
|
function fcf --description 'Git commit fixup using fzf'
|
||||||
git commit --fixup (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi | cut -d ' ' -f1)
|
git commit --fixup (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi | cut -d ' ' -f1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fco --description 'Checkout a branch using fzf'
|
function fco --description 'Checkout a branch using fzf'
|
||||||
git branch --all | grep -v HEAD | string trim | fzf | read -l result; and git checkout "$result"
|
git branch --all | grep -v HEAD | string trim | fzf | read -l result; and git checkout "$result"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fcoc --description 'Checkout a commit using fzf'
|
function fcoc --description 'Checkout a commit using fzf'
|
||||||
git log --pretty=oneline --abbrev-commit --reverse | fzf --tac +s -e | awk '{print $1;}' | read -l result; and git checkout "$result"
|
git log --pretty=oneline --abbrev-commit --reverse | fzf --tac +s -e | awk '{print $1;}' | read -l result; and git checkout "$result"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fcr --description 'Git reset to a selected commit using fzf'
|
function fcr --description 'Git reset to a selected commit using fzf'
|
||||||
git reset $argv (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi +s | awk '{print $1}')
|
git reset $argv (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi +s | awk '{print $1}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ffa --description 'Git add files using fzf'
|
function ffa --description 'Git add files using fzf'
|
||||||
git add -- (git ls-files --modified --others --exclude-standard | fzf -m --preview 'bat --color=always {}')
|
git add -- (git ls-files --modified --others --exclude-standard | fzf -m --preview 'bat --color=always {}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ffco --description 'Git checkout a file using fzf'
|
function ffco --description 'Git checkout a file using fzf'
|
||||||
git checkout $argv -- (git ls-files --modified --exclude-standard | fzf -m)
|
git checkout $argv -- (git ls-files --modified --exclude-standard | fzf -m)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ffr --description 'Git restore a file using fzf'
|
function ffr --description 'Git restore a file using fzf'
|
||||||
git restore $argv -- (git ls-files --modified --exclude-standard | fzf -m)
|
git restore $argv -- (git ls-files --modified --exclude-standard | fzf -m)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ffrs --description 'Git restore a staged file using fzf'
|
function ffrs --description 'Git restore a staged file using fzf'
|
||||||
git restore --staged $argv -- (git diff --name-only --staged | fzf -m)
|
git restore --staged $argv -- (git diff --name-only --staged | fzf -m)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function finfo --description "Get information from media using ffprobe"
|
function finfo --description "Get information from media using ffprobe"
|
||||||
ffprobe -v error -show_format -show_streams -show_frames $argv
|
ffprobe -v error -show_format -show_streams -show_frames $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
function fish_profile
|
function fish_profile
|
||||||
if test -e /tmp/fish.profile
|
if test -e /tmp/fish.profile
|
||||||
rm /tmp/fish.profile
|
rm /tmp/fish.profile
|
||||||
end
|
end
|
||||||
fish --profile-startup /tmp/fish.profile -i -c exit
|
fish --profile-startup /tmp/fish.profile -i -c exit
|
||||||
sort -nk2 /tmp/fish.profile
|
sort -nk2 /tmp/fish.profile
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,82 +1,93 @@
|
||||||
set --path -a NESTED_FISH_LABELS
|
set --path -a NESTED_FISH_LABELS
|
||||||
|
|
||||||
function fish_prompt
|
function fish_prompt
|
||||||
set -l command_status $status
|
set -l command_status $status
|
||||||
set -l question_mark_in_circle '?'\u20dd
|
set -l question_mark_in_circle '?'\u20dd
|
||||||
set_color red; echo -n '# '
|
set_color red
|
||||||
|
echo -n '# '
|
||||||
|
|
||||||
# Print nesting
|
# Print nesting
|
||||||
if test (count $NESTED_FISH_LABELS) -gt 0
|
if test (count $NESTED_FISH_LABELS) -gt 0
|
||||||
echo -ns '[' (set_color yellow) \
|
echo -ns '[' (set_color yellow) \
|
||||||
(string join (set_color red)/(set_color yellow) $NESTED_FISH_LABELS) \
|
(string join (set_color red)/(set_color yellow) $NESTED_FISH_LABELS) \
|
||||||
(set_color red) '] '
|
(set_color red) '] '
|
||||||
end
|
end
|
||||||
|
|
||||||
# Print current location
|
# Print current location
|
||||||
if [ "$PWD" = "$HOME" ]
|
if [ "$PWD" = "$HOME" ]
|
||||||
set_color green; echo -n '~'
|
set_color green
|
||||||
else
|
echo -n '~'
|
||||||
set -l parent_dir (dirname "$PWD")
|
|
||||||
set_color blue
|
|
||||||
if [ "$parent_dir" = "$HOME" ]
|
|
||||||
echo -n '~'
|
|
||||||
else
|
else
|
||||||
echo -n (basename "$parent_dir")
|
set -l parent_dir (dirname "$PWD")
|
||||||
|
set_color blue
|
||||||
|
if [ "$parent_dir" = "$HOME" ]
|
||||||
|
echo -n '~'
|
||||||
|
else
|
||||||
|
echo -n (basename "$parent_dir")
|
||||||
|
end
|
||||||
|
echo -n ' → '
|
||||||
|
set_color green
|
||||||
|
echo -n (basename "$PWD")
|
||||||
end
|
end
|
||||||
echo -n ' → '
|
echo -n ' '
|
||||||
set_color green; echo -n (basename "$PWD")
|
|
||||||
end
|
|
||||||
echo -n ' '
|
|
||||||
|
|
||||||
# Show some pretty git information if we're in a git repo
|
# Show some pretty git information if we're in a git repo
|
||||||
set -l is_git_worktree (git rev-parse --is-inside-work-tree 2>/dev/null)
|
set -l is_git_worktree (git rev-parse --is-inside-work-tree 2>/dev/null)
|
||||||
if test "$is_git_worktree" = true
|
if test "$is_git_worktree" = true
|
||||||
if git rev-parse '@{u}' >/dev/null 2>&1
|
if git rev-parse '@{u}' >/dev/null 2>&1
|
||||||
# If an upstream is set, check how far ahead/behind the branch is
|
# If an upstream is set, check how far ahead/behind the branch is
|
||||||
set -l git_commits_ahead (git rev-list '@{u}..HEAD' | wc -l | awk '{print $1}')
|
set -l git_commits_ahead (git rev-list '@{u}..HEAD' | wc -l | awk '{print $1}')
|
||||||
set -l git_commits_behind (git rev-list 'HEAD..@{u}' | wc -l | awk '{print $1}')
|
set -l git_commits_behind (git rev-list 'HEAD..@{u}' | wc -l | awk '{print $1}')
|
||||||
if [ \( "$git_commits_ahead" -eq 0 \) -a \( "$git_commits_behind" -eq 0 \) ]
|
if [ \( "$git_commits_ahead" -eq 0 \) -a \( "$git_commits_behind" -eq 0 \) ]
|
||||||
set_color blue; echo -n '⦿'
|
set_color blue
|
||||||
else
|
echo -n '⦿'
|
||||||
if [ "$git_commits_behind" -gt 0 ]
|
else
|
||||||
set_color red; echo -n "↓$git_commits_behind"
|
if [ "$git_commits_behind" -gt 0 ]
|
||||||
|
set_color red
|
||||||
|
echo -n "↓$git_commits_behind"
|
||||||
|
end
|
||||||
|
if [ "$git_commits_ahead" -gt 0 ]
|
||||||
|
set_color brred
|
||||||
|
echo -n "↑$git_commits_ahead"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# Otherwise, indicate that an upstream is unknown
|
||||||
|
set_color brred
|
||||||
|
echo -n "$question_mark_in_circle"
|
||||||
end
|
end
|
||||||
if [ "$git_commits_ahead" -gt 0 ]
|
|
||||||
set_color brred; echo -n "↑$git_commits_ahead"
|
set -l git_branch (git branch 2>/dev/null | sed -n '/\* /s///p')
|
||||||
|
if test -n "$git_branch"
|
||||||
|
set_color blue
|
||||||
|
echo -n ' ['
|
||||||
|
# Color the branch name differently if the working tree is dirty
|
||||||
|
if [ (count (git status --porcelain)) -gt 0 ]
|
||||||
|
set_color brred
|
||||||
|
else
|
||||||
|
set_color yellow
|
||||||
|
end
|
||||||
|
echo -n "$git_branch"
|
||||||
|
set_color blue
|
||||||
|
echo -n '] '
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if [ "$command_status" -eq 0 ]
|
||||||
|
set_color brcyan
|
||||||
|
echo -n 'λ: '
|
||||||
else
|
else
|
||||||
# Otherwise, indicate that an upstream is unknown
|
set_color red
|
||||||
set_color brred; echo -n "$question_mark_in_circle"
|
echo -n 'λ! '
|
||||||
|
end
|
||||||
|
set_color normal
|
||||||
|
|
||||||
|
# Color the hostname in the prompt dynamically whenever connected through SSH
|
||||||
|
if set -q SSH_TTY
|
||||||
|
set -g fish_color_host brred
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l git_branch (git branch 2>/dev/null | sed -n '/\* /s///p')
|
if set -q VIRTUAL_ENV
|
||||||
if test -n "$git_branch"
|
echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
|
||||||
set_color blue; echo -n ' ['
|
|
||||||
# Color the branch name differently if the working tree is dirty
|
|
||||||
if [ (count (git status --porcelain)) -gt 0 ]
|
|
||||||
set_color brred
|
|
||||||
else
|
|
||||||
set_color yellow
|
|
||||||
end
|
|
||||||
echo -n "$git_branch"
|
|
||||||
set_color blue; echo -n '] '
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if [ "$command_status" -eq 0 ]
|
|
||||||
set_color brcyan; echo -n 'λ: '
|
|
||||||
else
|
|
||||||
set_color red; echo -n 'λ! '
|
|
||||||
end
|
|
||||||
set_color normal
|
|
||||||
|
|
||||||
# Color the hostname in the prompt dynamically whenever connected through SSH
|
|
||||||
if set -q SSH_TTY
|
|
||||||
set -g fish_color_host brred
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -q VIRTUAL_ENV
|
|
||||||
echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function fish_user_key_bindings
|
function fish_user_key_bindings
|
||||||
# https://github.com/fish-shell/fish-shell/issues/5593
|
# https://github.com/fish-shell/fish-shell/issues/5593
|
||||||
bind \cd true
|
bind \cd true
|
||||||
fzf_key_bindings
|
fzf_key_bindings
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function frbi --description 'Git interactive rebase using fzf'
|
function frbi --description 'Git interactive rebase using fzf'
|
||||||
git rebase -i (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi | cut -d ' ' -f1)
|
git rebase -i (git log --pretty=oneline --abbrev-commit --color=always | fzf --ansi | cut -d ' ' -f1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fstream --description "Show streams in media using ffprobe"
|
function fstream --description "Show streams in media using ffprobe"
|
||||||
ffprobe -v error -show_streams $argv
|
ffprobe -v error -show_streams $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function fu
|
function fu
|
||||||
fnm use
|
fnm use
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gd
|
function gd
|
||||||
git diff $argv
|
git diff $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gdba --description 'Attach to a process'
|
function gdba --description 'Attach to a process'
|
||||||
gdb attach -p (ps -ef | fzf | awk '{print $2}' | head -1)
|
gdb attach -p (ps -ef | fzf | awk '{print $2}' | head -1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gdbp --description 'Attach to a python process'
|
function gdbp --description 'Attach to a python process'
|
||||||
gdb python3 (ps -ef | fzf | awk '{print $2}' | head -1)
|
gdb python3 (ps -ef | fzf | awk '{print $2}' | head -1)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gdbr --description 'Start a command/process with rust-gdb'
|
function gdbr --description 'Start a command/process with rust-gdb'
|
||||||
rust-gdb --args $argv
|
rust-gdb --args $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
function gdbt -d "GDB with tmux panes"
|
function gdbt -d "GDB with tmux panes"
|
||||||
if set -q TMUX
|
if set -q TMUX
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
|
|
||||||
if test -n "$proc"
|
if test -n "$proc"
|
||||||
set -l tty1_id (tmux split-pane -hPF "#D" "tail -f /dev/null")
|
set -l tty1_id (tmux split-pane -hPF "#D" "tail -f /dev/null")
|
||||||
tmux last-pane
|
tmux last-pane
|
||||||
set -l tty1 (tmux display-message -p -t "$tty1_id" '#{pane_tty}')
|
set -l tty1 (tmux display-message -p -t "$tty1_id" '#{pane_tty}')
|
||||||
|
|
||||||
set -l tty2_id (tmux split-pane -hPF "#D" "tail -f /dev/null")
|
set -l tty2_id (tmux split-pane -hPF "#D" "tail -f /dev/null")
|
||||||
tmux last-pane
|
tmux last-pane
|
||||||
set -l tty2 (tmux display-message -p -t "$tty2_id" '#{pane_tty}')
|
set -l tty2 (tmux display-message -p -t "$tty2_id" '#{pane_tty}')
|
||||||
|
|
||||||
tmux select-layout even-horizontal
|
tmux select-layout even-horizontal
|
||||||
|
|
||||||
gdb -q -ex "dashboard breakpoints -output $tty1" -ex "dashboard variables -output $tty1" -ex "dashboard threads -output $tty2" -ex "attach $proc"
|
gdb -q -ex "dashboard breakpoints -output $tty1" -ex "dashboard variables -output $tty1" -ex "dashboard threads -output $tty2" -ex "attach $proc"
|
||||||
|
|
||||||
tmux kill-pane -t $tty1_id
|
tmux kill-pane -t $tty1_id
|
||||||
tmux kill-pane -t $tty2_id
|
tmux kill-pane -t $tty2_id
|
||||||
|
end
|
||||||
|
else
|
||||||
|
echo "Not inside TMUX"
|
||||||
end
|
end
|
||||||
else
|
|
||||||
echo "Not inside TMUX"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
function gdd --description "Use difftastic as a difftool"
|
function gdd --description "Use difftastic as a difftool"
|
||||||
git difftool --tool=difftastic $argv
|
git difftool --tool=difftastic $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gdk
|
function gdk
|
||||||
git difftool --tool=kitty $argv
|
git difftool --tool=kitty $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gdt
|
function gdt
|
||||||
git difftool $argv
|
git difftool $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gf
|
function gf
|
||||||
git fetch --all --tags -f
|
git fetch --all --tags -f
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,76 +1,76 @@
|
||||||
function git_remote_toggle --description 'Switch git repository between HTTPS and SSH'
|
function git_remote_toggle --description 'Switch git repository between HTTPS and SSH'
|
||||||
set -l options h/help q/quiet S/ssh H/https
|
set -l options h/help q/quiet S/ssh H/https
|
||||||
argparse $options -- $argv; or return
|
argparse $options -- $argv; or return
|
||||||
|
|
||||||
if set -q _flag_help
|
if set -q _flag_help
|
||||||
echo 'Usage: git_remote_toggle [-h/--help] [-q/--quiet] [-S/--ssh] [-H/--https] [remotes ...]'
|
echo 'Usage: git_remote_toggle [-h/--help] [-q/--quiet] [-S/--ssh] [-H/--https] [remotes ...]'
|
||||||
return 0
|
return 0
|
||||||
end
|
|
||||||
|
|
||||||
if set -q _flag_ssh; and set -q _flag_https
|
|
||||||
echo 'Must choose only one of --ssh and --https'
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
if ! __grt_in_git
|
|
||||||
echo 'Not in a git repository'
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
for remote in $argv
|
|
||||||
set -l url (git remote get-url $remote 2>/dev/null)
|
|
||||||
set -l newurl
|
|
||||||
|
|
||||||
if test -z "$url"
|
|
||||||
if ! set -q _flag_quiet
|
|
||||||
echo "Remote $remote does not exist"
|
|
||||||
end
|
|
||||||
continue
|
|
||||||
else if __grt_is_ssh $url; and ! set -q _flag_ssh
|
|
||||||
set newurl (__grt_to_https $url)
|
|
||||||
else if __grt_is_https $url; and ! set -q _flag_https
|
|
||||||
set newurl (__grt_to_ssh $url)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if test -n "$newurl"
|
if set -q _flag_ssh; and set -q _flag_https
|
||||||
# Sanity check
|
echo 'Must choose only one of --ssh and --https'
|
||||||
if __grt_is_ssh $url; and __grt_is_https $newurl
|
return 1
|
||||||
else if __grt_is_https $url; and __grt_is_ssh $newurl
|
end
|
||||||
else
|
|
||||||
echo "Something went wrong: $url -> $newurl"
|
if ! __grt_in_git
|
||||||
continue
|
echo 'Not in a git repository'
|
||||||
end
|
return 1
|
||||||
|
end
|
||||||
if ! set -q _flag_quiet
|
|
||||||
echo "$remote: $url -> $newurl"
|
for remote in $argv
|
||||||
end
|
set -l url (git remote get-url $remote 2>/dev/null)
|
||||||
git remote set-url $remote $newurl
|
set -l newurl
|
||||||
|
|
||||||
|
if test -z "$url"
|
||||||
|
if ! set -q _flag_quiet
|
||||||
|
echo "Remote $remote does not exist"
|
||||||
|
end
|
||||||
|
continue
|
||||||
|
else if __grt_is_ssh $url; and ! set -q _flag_ssh
|
||||||
|
set newurl (__grt_to_https $url)
|
||||||
|
else if __grt_is_https $url; and ! set -q _flag_https
|
||||||
|
set newurl (__grt_to_ssh $url)
|
||||||
|
end
|
||||||
|
|
||||||
|
if test -n "$newurl"
|
||||||
|
# Sanity check
|
||||||
|
if __grt_is_ssh $url; and __grt_is_https $newurl
|
||||||
|
else if __grt_is_https $url; and __grt_is_ssh $newurl
|
||||||
|
else
|
||||||
|
echo "Something went wrong: $url -> $newurl"
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
|
if ! set -q _flag_quiet
|
||||||
|
echo "$remote: $url -> $newurl"
|
||||||
|
end
|
||||||
|
git remote set-url $remote $newurl
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# git@github.com:{repo} -> https://github.com/{repo}
|
# git@github.com:{repo} -> https://github.com/{repo}
|
||||||
function __grt_to_https
|
function __grt_to_https
|
||||||
set -l url (string replace ':' '/' $argv)
|
set -l url (string replace ':' '/' $argv)
|
||||||
set -l url (string replace 'git@' 'https://' $url)
|
set -l url (string replace 'git@' 'https://' $url)
|
||||||
echo $url
|
echo $url
|
||||||
end
|
end
|
||||||
|
|
||||||
# https://github.com/{repo} -> git@github.com:{repo}
|
# https://github.com/{repo} -> git@github.com:{repo}
|
||||||
function __grt_to_ssh
|
function __grt_to_ssh
|
||||||
set -l url (string replace 'https://' 'git@' $argv)
|
set -l url (string replace 'https://' 'git@' $argv)
|
||||||
set -l url (string replace '/' ':' $url)
|
set -l url (string replace '/' ':' $url)
|
||||||
echo $url
|
echo $url
|
||||||
end
|
end
|
||||||
|
|
||||||
function __grt_is_ssh
|
function __grt_is_ssh
|
||||||
string match -qr '^git@' $argv
|
string match -qr '^git@' $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
function __grt_is_https
|
function __grt_is_https
|
||||||
string match -qr '^https://' $argv
|
string match -qr '^https://' $argv
|
||||||
end
|
end
|
||||||
|
|
||||||
function __grt_in_git
|
function __grt_in_git
|
||||||
git status 2&>/dev/null
|
git status 2&>/dev/null
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
function gl --description 'Git browse commits'
|
function gl --description 'Git browse commits'
|
||||||
set -l log_line_to_hash "echo {} | grep -o '[a-f0-9]\{7\}' | head -1"
|
set -l log_line_to_hash "echo {} | grep -o '[a-f0-9]\{7\}' | head -1"
|
||||||
set -l view_commit "$log_line_to_hash | xargs -I % sh -c 'git show --color=always % | bat -ldiff'"
|
set -l view_commit "$log_line_to_hash | xargs -I % sh -c 'git show --color=always % | bat -ldiff'"
|
||||||
set -l view_commit_nvim "$log_line_to_hash | xargs -I % sh -c 'git show %'"
|
set -l view_commit_nvim "$log_line_to_hash | xargs -I % sh -c 'git show %'"
|
||||||
set -l copy_commit_hash "$log_line_to_hash | wl-copy"
|
set -l copy_commit_hash "$log_line_to_hash | wl-copy"
|
||||||
set -l git_checkout "$log_line_to_hash | xargs -I % sh -c 'git checkout %'"
|
set -l git_checkout "$log_line_to_hash | xargs -I % sh -c 'git checkout %'"
|
||||||
set -l git_cherry_pick "$log_line_to_hash | xargs -I % sh -c 'git cherry-pick %'"
|
set -l git_cherry_pick "$log_line_to_hash | xargs -I % sh -c 'git cherry-pick %'"
|
||||||
set -l open_cmd "xdg-open"
|
set -l open_cmd xdg-open
|
||||||
|
|
||||||
set github_open "$log_line_to_hash | xargs -I % sh -c '$open_cmd https://github.\$(git config remote.origin.url | cut -f2 -d. | tr \':\' /)/commit/%'"
|
set github_open "$log_line_to_hash | xargs -I % sh -c '$open_cmd https://github.\$(git config remote.origin.url | cut -f2 -d. | tr \':\' /)/commit/%'"
|
||||||
|
|
||||||
git log --color=always --format='%C(auto)%h%d %s %C(green)%C(bold)%cr% C(blue)%an' $argv | \
|
git log --color=always --format='%C(auto)%h%d %s %C(green)%C(bold)%cr% C(blue)%an' $argv | fzf --exact --no-sort --reverse --tiebreak=index --no-multi --ansi \
|
||||||
fzf --exact --no-sort --reverse --tiebreak=index --no-multi --ansi \
|
--preview="$view_commit" \
|
||||||
--preview="$view_commit" \
|
--header="ENTER to view, CTRL-Y to copy hash, CTRL-O to open on GitHub, CTRL-X to checkout, CTRL-C to exit, CTRL-S to cherry-pick" \
|
||||||
--header="ENTER to view, CTRL-Y to copy hash, CTRL-O to open on GitHub, CTRL-X to checkout, CTRL-C to exit, CTRL-S to cherry-pick" \
|
--bind "enter:execute:$view_commit_nvim | nvim -R -" \
|
||||||
--bind "enter:execute:$view_commit_nvim | nvim -R -" \
|
--bind "ctrl-y:execute:$copy_commit_hash" \
|
||||||
--bind "ctrl-y:execute:$copy_commit_hash" \
|
--bind "ctrl-x:execute:$git_checkout" \
|
||||||
--bind "ctrl-x:execute:$git_checkout" \
|
--bind "ctrl-o:execute:$github_open" \
|
||||||
--bind "ctrl-o:execute:$github_open" \
|
--bind "ctrl-s:execute:$git_cherry_pick" \
|
||||||
--bind "ctrl-s:execute:$git_cherry_pick" \
|
--bind "ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-n:preview-down,ctrl-p:preview-up,ctrl-f:preview-page-down,ctrl-b:preview-page-up"
|
||||||
--bind "ctrl-d:half-page-down,ctrl-u:half-page-up,ctrl-n:preview-down,ctrl-p:preview-up,ctrl-f:preview-page-down,ctrl-b:preview-page-up"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gm
|
function gm
|
||||||
git merge $argv
|
git merge $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gn --wraps='nvim +Git +only' --description 'alias gn=nvim +Git +only'
|
function gn --wraps='nvim +Git +only' --description 'alias gn=nvim +Git +only'
|
||||||
nvim +Git +only $argv;
|
nvim +Git +only $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function grf --description 'Search within a file with grep with context'
|
function grf --description 'Search within a file with grep with context'
|
||||||
grep --color=always -C 10 --group-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | less -R
|
grep --color=always -C 10 --group-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | less -R
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gs --wraps='git status'
|
function gs --wraps='git status'
|
||||||
git status
|
git status
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gsl --wraps=gst-launch-1.0 --description 'alias gsl=gst-launch-1.0'
|
function gsl --wraps=gst-launch-1.0 --description 'alias gsl=gst-launch-1.0'
|
||||||
gst-launch-1.0 $argv;
|
gst-launch-1.0 $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gst --wraps=gst-inspect-1.0 --description 'alias gst=gst-inspect-1.0'
|
function gst --wraps=gst-inspect-1.0 --description 'alias gst=gst-inspect-1.0'
|
||||||
gst-inspect-1.0 $argv;
|
gst-inspect-1.0 $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function gsv --wraps='git status'
|
function gsv --wraps='git status'
|
||||||
git status --verbose
|
git status --verbose
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function hf --description "Start htop with commands matching filter"
|
function hf --description "Start htop with commands matching filter"
|
||||||
htop -F $argv
|
htop -F $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function icat --wraps='kitty +kitten icat (fzf)' --description 'alias icat=kitty +kitten icat (fzf)'
|
function icat --wraps='kitty +kitten icat (fzf)' --description 'alias icat=kitty +kitten icat (fzf)'
|
||||||
kitty +kitten icat (fzf) $argv;
|
kitty +kitten icat (fzf) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jb --wraps='journalctl -r -b -1' --description 'alias jb=journalctl -r -b -1'
|
function jb --wraps='journalctl -r -b -1' --description 'alias jb=journalctl -r -b -1'
|
||||||
journalctl -r -b -1 $argv;
|
journalctl -r -b -1 $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jbl --description 'Select a boot to view logs'
|
function jbl --description 'Select a boot to view logs'
|
||||||
journalctl -r -b (journalctl --list-boots | fzf --tac | awk '{print $1}')
|
journalctl -r -b (journalctl --list-boots | fzf --tac | awk '{print $1}')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jf --wraps='journalctl -f' --description 'alias jf=journalctl -f'
|
function jf --wraps='journalctl -f' --description 'alias jf=journalctl -f'
|
||||||
journalctl -f $argv;
|
journalctl -f $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jk --wraps='journalctl -r -k' --description 'alias jk=journalctl -r -k'
|
function jk --wraps='journalctl -r -k' --description 'alias jk=journalctl -r -k'
|
||||||
journalctl -r -k $argv;
|
journalctl -r -k $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jr --wraps='journalctl -r' --description 'alias jr=journalctl -r'
|
function jr --wraps='journalctl -r' --description 'alias jr=journalctl -r'
|
||||||
journalctl -r $argv;
|
journalctl -r $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ju --wraps='journalctl -u' --description 'alias ju=journalctl -u'
|
function ju --wraps='journalctl -u' --description 'alias ju=journalctl -u'
|
||||||
journalctl -u $argv;
|
journalctl -u $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function jx --wraps='journalctl -xe' --description 'alias jx=journalctl -xe'
|
function jx --wraps='journalctl -xe' --description 'alias jx=journalctl -xe'
|
||||||
journalctl -xe $argv;
|
journalctl -xe $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function kr --description "Reload kitty configuration"
|
function kr --description "Reload kitty configuration"
|
||||||
for pid in (pidof kitty | string split ' ')
|
for pid in (pidof kitty | string split ' ')
|
||||||
kill -SIGUSR1 $pid
|
kill -SIGUSR1 $pid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function l -w exa
|
function l -w exa
|
||||||
exa -l $argv
|
exa -l $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function lg
|
function lg
|
||||||
lazygit -ucd ~/.config/lazygit
|
lazygit -ucd ~/.config/lazygit
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function ll -w exa
|
function ll -w exa
|
||||||
exa -la $argv
|
exa -la $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function lt -w exa
|
function lt -w exa
|
||||||
exa --tree --git-ignore $argv
|
exa --tree --git-ignore $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function m --wraps=mutt --description 'alias m=mutt'
|
function m --wraps=mutt --description 'alias m=mutt'
|
||||||
mutt $argv;
|
mutt $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function mkdcd -d "Create a new directory and immediately cd into it"
|
function mkdcd -d "Create a new directory and immediately cd into it"
|
||||||
mkdir -p -- $argv
|
mkdir -p -- $argv
|
||||||
if test $status = 0
|
if test $status = 0
|
||||||
cd $argv
|
cd $argv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function mkdir
|
function mkdir
|
||||||
command mkdir -p $argv
|
command mkdir -p $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function mkvtomp4 --description "Reencode mkv to mp4"
|
function mkvtomp4 --description "Reencode mkv to mp4"
|
||||||
for i in *.mkv
|
for i in *.mkv
|
||||||
set fname (basename $i .mkv)
|
set fname (basename $i .mkv)
|
||||||
ffmpeg -i $i -c:v libx264 -c:a aac $fname.mp4
|
ffmpeg -i $i -c:v libx264 -c:a aac $fname.mp4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
function nvim_profile
|
function nvim_profile
|
||||||
if test -e /tmp/nvim_profile.profile
|
if test -e /tmp/nvim_profile.profile
|
||||||
rm /tmp/nvim_profile.profile
|
rm /tmp/nvim_profile.profile
|
||||||
end
|
end
|
||||||
nvim --startuptime /tmp/nvim_profile.profile +q
|
nvim --startuptime /tmp/nvim_profile.profile +q
|
||||||
tail -1 /tmp/nvim_profile.profile | awk '{print $1}'
|
tail -1 /tmp/nvim_profile.profile | awk '{print $1}'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function pfr --description 'Select a process to record performance data in given file name'
|
function pfr --description 'Select a process to record performance data in given file name'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
perf record -F 99 -o $argv -p $proc
|
perf record -F 99 -o $argv -p $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function pft --description 'Select a process to run perf top'
|
function pft --description 'Select a process to run perf top'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
perf top -p $proc
|
perf top -p $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function pk --description 'Fuzzy find a process to kill'
|
function pk --description 'Fuzzy find a process to kill'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
kill -SIGKILL $proc
|
kill -SIGKILL $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function psmem --description 'Show memory usage of a process'
|
function psmem --description 'Show memory usage of a process'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
ps_mem -p $proc
|
ps_mem -p $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function pst --description 'Show process tree of a process'
|
function pst --description 'Show process tree of a process'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}' | head -1)
|
set proc (ps -ef | fzf | awk '{print $2}' | head -1)
|
||||||
pstree -H $proc $proc
|
pstree -H $proc $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function rfc --description 'Search for string in RFC documents and open'
|
function rfc --description 'Search for string in RFC documents and open'
|
||||||
if test -e ~/rfc
|
if test -e ~/rfc
|
||||||
rg --files-with-matches $argv ~/rfc | fzf --preview='less {}' | read -l result
|
rg --files-with-matches $argv ~/rfc | fzf --preview='less {}' | read -l result
|
||||||
nvim -R $result
|
nvim -R $result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function rgc --description 'Search within a file with ripgrep with context'
|
function rgc --description 'Search within a file with ripgrep with context'
|
||||||
rg --color never -C 10 --context-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | nvim -R
|
rg --color never -C 10 --context-separator="---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------" $argv | nvim -R
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function rgf --description 'Search within a file with ripgrep'
|
function rgf --description 'Search within a file with ripgrep'
|
||||||
rg --color never $argv | nvim -R
|
rg --color never $argv | nvim -R
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function sdd --wraps='systemctl disable ' --description 'alias sdd=systemctl disable '
|
function sdd --wraps='systemctl disable ' --description 'alias sdd=systemctl disable '
|
||||||
systemctl disable $argv;
|
systemctl disable $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function sde --wraps='systemctl enable ' --description 'alias sde=systemctl enable '
|
function sde --wraps='systemctl enable ' --description 'alias sde=systemctl enable '
|
||||||
systemctl enable $argv;
|
systemctl enable $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function sds --wraps='systemctl status ' --description 'alias sds=systemctl status '
|
function sds --wraps='systemctl status ' --description 'alias sds=systemctl status '
|
||||||
systemctl status $argv;
|
systemctl status $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function sfc --wraps='source ~/.config/fish/config.fish' --description 'alias sfc=source ~/.config/fish/config.fish'
|
function sfc --wraps='source ~/.config/fish/config.fish' --description 'alias sfc=source ~/.config/fish/config.fish'
|
||||||
source ~/.config/fish/config.fish $argv;
|
source ~/.config/fish/config.fish $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# https://wiki.archlinux.org/title/fish#Make_su_launch_fish
|
# https://wiki.archlinux.org/title/fish#Make_su_launch_fish
|
||||||
function su
|
function su
|
||||||
command su --shell=/usr/bin/fish $argv
|
command su --shell=/usr/bin/fish $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function t --wraps='tokei .' --description 'alias t=tokei .'
|
function t --wraps='tokei .' --description 'alias t=tokei .'
|
||||||
tokei . $argv;
|
tokei . $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function ta --description 'Attaches to a selected session'
|
function ta --description 'Attaches to a selected session'
|
||||||
set session (tmux list-sessions | fzf | awk -F':' '{print $1}')
|
set session (tmux list-sessions | fzf | awk -F':' '{print $1}')
|
||||||
tmux attach -t $session;
|
tmux attach -t $session
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function tks --wraps='tmux kill-server' --description 'alias tks=tmux kill-server'
|
function tks --wraps='tmux kill-server' --description 'alias tks=tmux kill-server'
|
||||||
tmux kill-server $argv;
|
tmux kill-server $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function tksa --wraps='tmux kill-session -a' --description 'alias tksa=tmux kill-session -a'
|
function tksa --wraps='tmux kill-session -a' --description 'alias tksa=tmux kill-session -a'
|
||||||
tmux kill-session -a $argv;
|
tmux kill-session -a $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function tls --wraps='tmux ls' --description 'alias tls=tmux ls'
|
function tls --wraps='tmux ls' --description 'alias tls=tmux ls'
|
||||||
tmux ls $argv;
|
tmux ls $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function topf --description 'Select a process to run top'
|
function topf --description 'Select a process to run top'
|
||||||
set proc (ps -ef | fzf | awk '{print $2}')
|
set proc (ps -ef | fzf | awk '{print $2}')
|
||||||
top -H -p $proc
|
top -H -p $proc
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function v --wraps=nvim --description 'alias v=nvim'
|
function v --wraps=nvim --description 'alias v=nvim'
|
||||||
nvim $argv;
|
nvim $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vc --wraps='nvim --clean' --description 'alias vc=nvim --clean'
|
function vc --wraps='nvim --clean' --description 'alias vc=nvim --clean'
|
||||||
nvim --clean $argv;
|
nvim --clean $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
# ACMRU = Added || Copied || Modified || Renamed || Unmerged
|
# ACMRU = Added || Copied || Modified || Renamed || Unmerged
|
||||||
# Edit all uncommitted files that have changes since the last commit (be they staged or unstaged)
|
# Edit all uncommitted files that have changes since the last commit (be they staged or unstaged)
|
||||||
function vd --wraps='nvim (git diff HEAD --name-only --diff-filter=ACMR)' --description 'alias vd=nvim (git diff HEAD --name-only --diff-filter=ACMR)'
|
function vd --wraps='nvim (git diff HEAD --name-only --diff-filter=ACMR)' --description 'alias vd=nvim (git diff HEAD --name-only --diff-filter=ACMR)'
|
||||||
nvim (git diff HEAD --name-only --diff-filter=ACMR) $argv;
|
nvim (git diff HEAD --name-only --diff-filter=ACMR) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vdc --wraps='nvim (git diff HEAD^ --name-only --diff-filter=ACMR)' --description 'Edit all files that were altered in the last commit'
|
function vdc --wraps='nvim (git diff HEAD^ --name-only --diff-filter=ACMR)' --description 'Edit all files that were altered in the last commit'
|
||||||
nvim (git diff HEAD^ --name-only --diff-filter=ACMR) $argv;
|
nvim (git diff HEAD^ --name-only --diff-filter=ACMR) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vdm --wraps='nvim (git diff master --name-only --diff-filter=ACMR)' --description 'Edit files changed since master'
|
function vdm --wraps='nvim (git diff master --name-only --diff-filter=ACMR)' --description 'Edit files changed since master'
|
||||||
nvim (git diff master --name-only --diff-filter=ACMR) $argv;
|
nvim (git diff master --name-only --diff-filter=ACMR) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vds --wraps='nvim (git diff --staged --name-only --diff-filter=ACMR)' --description 'Edit all staged files that have changes since the last commit'
|
function vds --wraps='nvim (git diff --staged --name-only --diff-filter=ACMR)' --description 'Edit all staged files that have changes since the last commit'
|
||||||
nvim (git diff --staged --name-only --diff-filter=ACMR) $argv;
|
nvim (git diff --staged --name-only --diff-filter=ACMR) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vdu --wraps='nvim (git diff --name-only --diff-filter=U | uniq)' --description 'Edit files unmerged'
|
function vdu --wraps='nvim (git diff --name-only --diff-filter=U | uniq)' --description 'Edit files unmerged'
|
||||||
nvim (git diff --name-only --diff-filter=U | uniq) $argv;
|
nvim (git diff --name-only --diff-filter=U | uniq) $argv
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
function vdua --wraps='git add (git diff --name-only --diff-filter=U)' --description 'Add unmerged files'
|
function vdua --wraps='git add (git diff --name-only --diff-filter=U)' --description 'Add unmerged files'
|
||||||
git add (git diff --name-only --diff-filter=U) $argv;
|
git add (git diff --name-only --diff-filter=U) $argv
|
||||||
end
|
end
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue