1
1
Fork 0

Delete fish config as I didn't end up using it

This commit is contained in:
Jonathan Schleifer 2023-03-19 00:28:04 +00:00
parent bdc88da817
commit 5e417a6b6c
43 changed files with 0 additions and 603 deletions

View file

@ -1,27 +0,0 @@
function __fish_cross_none
if test (count (commandline -opc)) -gt 1
return 1
end
end
function __fish_cross_amiga
set -l cmd (commandline -opc)
if test (count $cmd) != 2 || test $cmd[2] != "amiga"
return 1
end
end
complete -c cross -x
complete -c cross -n __fish_cross_none -x -a 3ds
complete -c cross -n __fish_cross_none -x -a nds
complete -c cross -n __fish_cross_none -x -a amiga
complete -c cross -n __fish_cross_amiga -x -a m68k
complete -c cross -n __fish_cross_amiga -x -a ppc
complete -c cross -n __fish_cross_none -x -a ios
complete -c cross -n __fish_cross_none -x -a iossim
complete -c cross -n __fish_cross_none -x -a mingw
complete -c cross -n __fish_cross_none -x -a morphos
complete -c cross -n __fish_cross_none -x -a switch
complete -c cross -n __fish_cross_none -x -a wii
complete -c cross -n __fish_cross_none -x -a wii-u

View file

@ -1 +0,0 @@
complete -c pkg_delete -x -a "(pkg_info | awk '{ print \$1 }')"

View file

@ -1 +0,0 @@
complete -c pkg_info -x -a "(pkg_info | awk '{ print \$1 }')"

View file

@ -1 +0,0 @@
complete -c run -a '(__fish_complete_subcommand)'

View file

@ -1,68 +0,0 @@
set -g fish_greeting
set -g fish_key_bindings hybrid_bindings
set -g fish_escape_delay_ms 300
set -g fish_cursor_unknown block
set -g fish_color_autosuggestion 303030
set -g fish_color_command 205cb3
set -g fish_color_comment 6600cc
set -g fish_color_cwd 209060
set -g fish_color_end 730099
set -g fish_color_host 176945
set -g fish_color_jobs --bold yellow
set -g fish_color_operator cc6fdf
set -g fish_color_param 3377cf
set -g fish_color_quote ff751a
set -g fish_color_redirection bf4080
set -g fish_color_search_match ffff00
set -g fish_color_selection c0c0c0
set -g fish_color_status --bold red
set -g fish_color_suffix 29bc7d
set -g fish_color_user 00ff00
set -g fish_color_valid_path normal
set -g fish_color_vcs 43d696
set -g fish_color_vcs_braces 29bc7d
set -g fish_normal_user js
test -n "$XDG_CONFIG_HOME"
or set -x XDG_CONFIG_HOME "$HOME/.config"
test -n "$XDG_CACHE_HOME"
or set -x XDG_CACHE_HOME "$HOME/.cache"
test -n "$XDG_DATA_HOME"
or set -x XDG_DATA_HOME "$HOME/.local/share"
set -x EDITOR vim
set -x VIMINIT "source $XDG_CONFIG_HOME/vim/vimrc"
set -x LS_COLORS 'di=34:ow=44;37:tw=44;37:st=44;37:ex=31:su=7;31:sg=7;31:ln=33:or=7;33:pi=32:do=32:bd=35:cd=35:so=32:*.bz2=36:*.dmg=36:*.gz=36:*.gpg=36:*.rar=36:*.tar=36:*.tbz2=36:*.tgz=36:*.xz=36:*.zip=36:*.orig=90:*~=90'
set -x SUDO_PROMPT (printf "\033[0;31m[\033[1;31msudo -> %%U\033[0;31m]\033[0m Password for \033[1m%%p@%%H\033[0m: ")
set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
set -x CVS_RSH ssh
if type -q gpg2
alias gpg=gpg2
end
if type -q gpg
# Make sure the GPG agent is running
gpg --card-status &>/dev/null
set -l sock
if test -d "$XDG_RUNTIME_DIR/gnupg"
set sock (find $XDG_RUNTIME_DIR/gnupg -name S.gpg-agent.ssh | head -1)
end
if test -z "$sock"
set sock "$GNUPGHOME/S.gpg-agent.ssh"
end
alias gssh="SSH_AUTH_SOCKET=$sock ssh"
alias gssh-add="SSH_AUTH_SOCKET=$sock ssh-add"
alias gsftp="SSH_AUTH_SOCKET=$sock sftp"
end
if test (uname -s) = Darwin
set -x MAKEFLAGS -j(math (sysctl -n machdep.cpu.thread_count)'*2')
else if test (uname -s) = NetBSD
set -x MAKEFLAGS -j(math (sysctl -n hw.ncpu)'*2')
else if type -q nproc
set -x MAKEFLAGS -j(math (nproc)'*2')
end

View file

@ -1,3 +0,0 @@
function 0x0st
curl -F'file=@-' https://0x0.st
end

View file

@ -1,66 +0,0 @@
#
# Wrap the builtin cd command to maintain directory history.
#
function cd --description "Change directory"
set -l MAX_DIR_HIST 25
if test (count $argv) -gt (test "$argv[1]" = "--" && echo 2 || echo 1)
printf "%s\n" (_ "Too many args for cd command")
return 1
end
# Skip history in subshells.
if status --is-command-substitution
builtin cd $argv
return $status
end
# Avoid set completions.
set -l previous $PWD
if test "$argv" = "-"
if test "$__fish_cd_direction" = "next"
nextd
else
prevd
end
return $status
end
# allow explicit "cd ." if the mount-point became stale in the meantime
if test "$argv" = "."
cd "$PWD"
return $status
end
builtin cd $argv
set -l cd_status $status
if test $cd_status -eq 0 -a "$PWD" != "$previous"
set -q dirprev
or set -l dirprev
set -q dirprev[$MAX_DIR_HIST]
and set -e dirprev[1]
# If dirprev, dirnext, __fish_cd_direction
# are set as universal variables, honor their scope.
set -U -q dirprev
and set -U -a dirprev $previous
or set -g -a dirprev $previous
set -U -q dirnext
and set -U -e dirnext
or set -e dirnext
set -U -q __fish_cd_direction
and set -U __fish_cd_direction prev
or set -g __fish_cd_direction prev
end
if test $cd_status -eq 0
ls
end
return $cd_status
end

View file

@ -1,174 +0,0 @@
function cross --description 'Set up cross-compilation environment'
if test (count $argv) = 0
echo 'Usage: cross platform [architecture1] [architecture2]'
return 1
end
switch $argv[1]
case 3ds nds
if test -z "$DEVKITPRO"
echo 'Please set DEVKITPRO!'
return 1
end
if test -z "$DEVKITARM"
echo 'Please set DEVKITARM!'
return 1
end
set PATH $DEVKITARM/bin $PATH
set -g cross_host arm-none-eabi
set -g objfw_configure_flags --with-$argv[1]
case amiga
switch $argv[2]
case m68k
if test -z "$amiga_gcc_path"
echo 'Please set amiga_gcc_path!'
return 1
end
set PATH $amiga_gcc_path/bin $PATH
set -g cross_host m68k-amigaos
case ppc
if test -z "$adtools_path"
echo 'Please set adtools_path!'
return 1
end
set PATH $adtools_path/bin $PATH
set -g cross_host ppc-amigaos
end
if test (count $argv) != 2 -o -z "$cross_host"
echo 'Usage: cross amiga m68k|ppc'
return 1
end
case ios iossim
if not type -q xcrun
echo 'Can only cross-compile for iOS on a Mac with Xcode!'
return 1
end
set -l sdk_type
set -l default_archs
switch $argv[1]
case ios
set sdk_type iphoneos
set default_archs arm64
case iossim
set sdk_type iphonesimulator
set default_archs x86_64
end
set -l sdk (xcrun --show-sdk-path --sdk $sdk_type)
set -l archs $argv[2..-1]
if test (count $archs) = 0
set archs $default_archs
end
set -gx CC clang -isysroot $sdk
set -gx CPP clang -E -isysroot $sdk
set -gx CXX clang++ -isysroot $sdk
set -gx CXXPP clang++ -E -isysroot $sdk
for arch in $archs
set -a CC -arch $arch
set -a CXX -arch $arch
end
set -a CPP -arch $archs[1]
set -a CXXPP -arch $archs[1]
set -gx OBJC $CC
set -gx OBJCPP $CPP
set -gx OBJCXX $CXX
set -gx OBJCPPXX $CXXPP
set -gx IPHONEOS_DEPLOYMENT_TARGET 10.0
set -g cross_host $archs[1]-apple-darwin
case macos
if test -z "$retro68_path"
echo 'Please set retro68_path!'
return 1
end
set PATH $retro68_path/bin $PATH
switch $argv[2]
case m68k
set -g cross_host m68k-apple-macos
case ppc
set -g cross_host powerpc-apple-macos
end
if test (count $argv) != 2 -o -z "$cross_host"
echo 'Usage: cross macos m68k|ppc'
return 1
end
case mingw
set -l pkg
switch $argv[2]
case i686 x86_64
set pkg mingw-w64-$argv[2]-gcc
set -g cross_host $argv[2]-w64-mingw32
end
if test (count $argv) != 2 -o -z "$cross_host"
echo 'Usage: cross mingw i686|x86_64'
return 1
end
set -l prefix (pkg_info -qp $pkg | awk '/^@cwd/ { print $2; exit }')
if test -z "$prefix"
echo 'Please install $pkg from pkgsrc!'
return 1
end
set PATH $prefix/cross/$cross_host/bin $PATH
case morphos
set -l prefix (pkg_info -qp ppc-morphos-gcc-11 |
awk '/^@cwd/ { print $2; exit }')
if test -z "$prefix"
echo 'Please install ppc-morphos-gcc-9 from pkgsrc!'
return 1
end
set PATH $prefix/gg/bin $PATH
set -gx CC ppc-morphos-gcc-11
set -gx CXX ppc-morphos-g++-11
set -gx OBJC ppc-morphos-gcc-11
set -gx OBJCXX ppc-morphos-g++-11
set -g cross_host ppc-morphos
case switch
if test -z "$DEVKITPRO"
echo 'Please set DEVKITPRO!'
return 1
end
if test -z "$DEVKITA64"
echo 'Please set DEVKITA64!'
return 1
end
set PATH $DEVKITA64/bin $DEVKITPRO/tools/bin $PATH
set -g cross_host aarch64-none-elf
set -g objfw_configure_flags --with-nintendo-switch
case wii wii-u
if test -z "$DEVKITPRO"
echo 'Please set DEVKITPRO!'
return 1
end
if test -z "$DEVKITPPC"
echo 'Please set DEVKITPPC!'
return 1
end
set PATH $DEVKITPPC/bin $DEVKITPRO/tools/bin $PATH
set -g cross_host powerpc-eabi
set -g objfw_configure_flags --with-$argv[1]
case '*'
echo "Unknown target: $argv[1]"
return 1
end
set -g objfw_configure_flags --host=$cross_host $objfw_configure_flags
end

View file

@ -1,11 +0,0 @@
function cvsd --wraps 'cvs diff'
if type -q colordiff
command cvs diff -uN $argv | colordiff | less -FRX
else
set -l red (printf "\033[31m")
set -l green (printf "\033[32m")
set -l reset (printf "\033[0m")
cvs diff -uN $argv | sed "s/^+.*\$/$green&$reset/" |
sed "s/^-.*\$/$red&$reset/" | less -FRX
end
end

View file

@ -1,10 +0,0 @@
function dlna
set -l cmd minidlnad -d -R
set -a cmd -f $XDG_CONFIG_HOME/minidlna/minidlna.conf
set -a cmd -P $XDG_DATA_HOME/minidlna/minidlna.pid
type -q caffeinate
set cmd caffeinate $cmd
eval $cmd
end

View file

@ -1,4 +0,0 @@
function eps --description 'Expand, print and set variable $e'
set -g e $argv
echo $e
end

View file

@ -1,7 +0,0 @@
function fgrep
if type -q ggrep
command ggrep -F --color=auto $argv
else
command fgrep --color=auto $argv
end
end

View file

@ -1,28 +0,0 @@
function fish_prompt --description 'Write out the prompt'
set -l suffix
switch "$USER"
case root toor
set suffix (set_color $fish_color_cwd_root)'#'
case '*'
set suffix '>'
end
set -l branch (fossil branch current 2>/dev/null)
if test -z "$branch"
set branch (git symbolic-ref HEAD 2>/dev/null)
set branch (string replace -r "^refs/heads/" "" $branch)
end
set -l vcs
if test -n "$branch"
set vcs (set_color $fish_color_vcs_braces)"(" \
(set_color $fish_color_vcs)"$branch" \
(set_color $fish_color_vcs_braces)")"
end
echo -n -s (set_color $fish_color_host) (prompt_user) (prompt_hostname) \
' ' (set_color $fish_color_cwd) (prompt_pwd) \
(string join '' $vcs) (set_color $fish_color_suffix) $suffix \
(set_color normal) ' '
end

View file

@ -1,15 +0,0 @@
function fish_right_prompt
set -l code $status
set -l jobs (jobs | wc -l)
set -l prompt
test $jobs -gt 0
and set -a prompt (set_color $fish_color_jobs)$jobs
test $code -gt 0
and set -a prompt (set_color $fish_color_status)$code
echo $prompt
set_color normal
end

View file

@ -1,3 +0,0 @@
function fish_title
echo (status current-command) · (prompt_pwd) · (prompt_hostname)
end

View file

@ -1,3 +0,0 @@
function fl --wraps=fossil
command fossil $argv
end

View file

@ -1,3 +0,0 @@
function flc --wraps='fossil changes --differ'
command fossil changes --differ $argv
end

View file

@ -1,11 +0,0 @@
function fld --wraps 'fossil diff'
if type -q colordiff
command fossil diff -N $argv | colordiff | less -FRX
else
set -l red (printf "\033[31m")
set -l green (printf "\033[32m")
set -l reset (printf "\033[0m")
fossil diff -N $argv | sed "s/^+.*\$/$green&$reset/" |
sed "s/^-.*\$/$red&$reset/" | less -FRX
end
end

View file

@ -1,8 +0,0 @@
function flgrep
set -l ret
fossil changes --all . | awk '{ print $2 }' | while read file
grep -H $argv "$file" && set ret 0
test $status -gt 1 && return $status
end
return $ret
end

View file

@ -1,3 +0,0 @@
function flpu --wraps='fossil update'
fossil pull && fossil update $argv
end

View file

@ -1,7 +0,0 @@
function flveri
if not set -q argv[1]
set argv[1] current
end
echo -e "\033[1m$argv[1]\033[0m"
fossil artifact "$argv[1]" | gpg --verify
end

View file

@ -1,7 +0,0 @@
function grep
if type -q ggrep
command ggrep --color=auto $argv
else
command grep --color=auto $argv
end
end

View file

@ -1,4 +0,0 @@
function gsftp --wraps sftp
set -lx SSH_AUTH_SOCK $GNUPGHOME/S.gpg-agent.ssh
sftp -o IdentitiesOnly=no $argv
end

View file

@ -1,4 +0,0 @@
function gssh-add --wraps ssh-add
set -lx SSH_AUTH_SOCK $GNUPGHOME/S.gpg-agent.ssh
ssh-add $argv
end

View file

@ -1,4 +0,0 @@
function gssh --wraps ssh
set -lx SSH_AUTH_SOCK $GNUPGHOME/S.gpg-agent.ssh
ssh -o IdentitiesOnly=no $argv
end

View file

@ -1,7 +0,0 @@
function hybrid_bindings --description 'Vi-style bindings that inherit emacs-style bindings in all modes'
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
end

View file

@ -1,3 +0,0 @@
function ixio
curl -F 'f:1=<-' ix.io
end

View file

@ -1,9 +0,0 @@
if type -q gls
function ls --description 'List contents of directory'
command gls --color=auto $argv
end
else if command ls --color=auto &>/dev/null
function ls --description 'List contents of directory'
command ls --color=auto $argv
end
end

View file

@ -1,15 +0,0 @@
# Automatically use bmake instead of make when using pkgsrc, if necessary
function make
if string match -q -r '/pkgsrc$|/pkgsrc/' $PWD
# pkgsrc does not like MAKEFLAGS including -j
set -lx MAKEFLAGS
if type -q bmake
command bmake $argv
else
command make $argv
end
else
command make $argv
end
end

View file

@ -1,5 +0,0 @@
# To work around mpv not liking locales that use , as a decimal separator
function mpv
set -lx LC_ALL C
command mpv $argv
end

View file

@ -1,4 +0,0 @@
function pkg_chk
set -lx MAKEFLAGS
command pkg_chk $argv
end

View file

@ -1,4 +0,0 @@
function pkg_rolling-replace
set -lx MAKEFLAGS
command pkg_rolling-replace $argv
end

View file

@ -1,5 +0,0 @@
if test -f /sys/class/power_supply/BAT0/power_now
function power_now
awk '{ print $1*10^-6 " W" }' /sys/class/power_supply/BAT0/power_now
end
end

View file

@ -1,19 +0,0 @@
function prompt_pwd --description 'Print the current working directory'
set -l options 'h/help'
argparse -n prompt_pwd --max-args=0 $options -- $argv
or return
if set -q _flag_help
__fish_print_help prompt_pwd
return 0
end
# Replace $HOME with "~"
set realhome ~
set -l tmp (basename (string replace -r '^'"$realhome"'($|/)' '~$1' $PWD))
test $PWD = "/$tmp"
and set tmp $PWD
echo $tmp
end

View file

@ -1,5 +0,0 @@
function prompt_user
if test (whoami) != "$fish_normal_user"
echo (whoami)"@"
end
end

View file

@ -1,3 +0,0 @@
function pw --wraps pwnk
pwnk -k ~/.cryptopassphrase.key $argv
end

View file

@ -1,15 +0,0 @@
function pwnk
set -l clipboard
if type -q wl-copy
set clipboard wl-copy
else if type -q pbcopy
set clipboard pbcopy
else if type -q xclip
set clipboard xclip
else
echo "No clipboard handler found!"
return 1
end
cryptopassphrase $argv | tr -d '\n' | $clipboard
end

View file

@ -1,3 +0,0 @@
function pws --wraps pwnk
pwnk -k ~/.cryptopassphrase-server.key $argv
end

View file

@ -1,9 +0,0 @@
function run
if test (count $argv) = 0
echo "Usage: run command"
return 1
end
$argv &
disown
end

View file

@ -1,3 +0,0 @@
function tmux
command tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf $argv
end

View file

@ -1,13 +0,0 @@
switch (uname -s)
case Linux
function uart
if not set -q argv[1]
set argv[1] 115200
end
if not set -q argv[2]
set argv[2] 0
end
screen /dev/ttyUSB"$argv[2]" "$argv[1]"
end
end
end

View file

@ -1,5 +0,0 @@
# pkgsrc does not like MAKEFLAGS being set
function url2pkg
set -lx MAKEFLAGS
command url2pkg $argv
end

View file

@ -1,3 +0,0 @@
function vi --wraps=vim
command vim $argv
end