moving all dots

This commit is contained in:
Barak Michener 2024-05-18 19:08:15 -07:00
parent 6fcf9ba919
commit d9b6fdfc1b
349 changed files with 34598 additions and 34727 deletions

1
dot_config/fish/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
work.fish

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,174 @@
# go is a tool for managing Go source code.
# See: https://golang.org
# Completions for go build commands
set -l __go_cmds_w_buildflags build get install run test generate
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s a -d 'force rebuild'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s n -d 'print the commands but do not run them'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s p -r -d 'number parallel builds (default=#cpus)'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o race -d 'enable data race detection'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o msan -d 'enable interoperation with memory sanitizer'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s v -d 'print packages being built'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o work -d 'print and preserve work directory'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -s x -d 'print the commands'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o asmflags -d 'arguments to pass on each go tool asm invocation'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o buildmode -x -d 'build mode to use' -a 'archive c-archive c-shared default shared exe pie plugin'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o compiler -x -d 'name of compiler to use, as in runtime' -a 'gccgo gc'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o gccgoflags -r -d 'gccgo compiler/linker flags'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o gcflags -r -d 'go compiler flags'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o installsuffix -r -d 'suffix for installation directory'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o ldflags -r -d 'linker flags'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o linkshared -r -d 'link against shared libraries previously created with -buildmode=shared'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o mod -x -d 'module download mode to use' -a 'readonly vendor mod'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o modcacherw -d 'leave newly-created directories in the module cache writable'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o modfile -r -d 'read (and possibly write) an alternate go.mod'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o pkgdir -r -d 'install and load all packages from dir instead of the usual locations'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o tags -r -d 'build tags'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o trimpath -d 'remove all file system paths from the resulting executable'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o toolexec -r -d 'a program to use to invoke toolchain programs'
complete -c go -n "__fish_seen_subcommand_from $__go_cmds_w_buildflags" -o mod -x -d 'module download mode to use' -a 'readonly vendor'
# Completions for go cmds that takes file arguments
complete -c go -n "__fish_seen_subcommand_from build compile fix fmt install test vet" -k -x -a "(
__fish_complete_suffix .go
)" --description File
# Completions for go cmds that takes pkg arguments
complete -c go -n "__fish_seen_subcommand_from build doc fix fmt install test vet" -x -a "(
go list -e -f '{{.ImportPath}} {{or .Doc \"Go package\"}}' (commandline -ct)... 2>/dev/null
)" --description Package
# build
complete -c go -n __fish_use_subcommand -a build -d 'compile packages and dependencies'
# clean
complete -c go -n __fish_use_subcommand -a clean -d 'remove object files'
complete -c go -n '__fish_seen_subcommand_from clean' -s i -d "remove the corresponding installed archive or binary"
complete -c go -n '__fish_seen_subcommand_from clean' -s n -d "print the command that would be executed without running"
complete -c go -n '__fish_seen_subcommand_from clean' -s r -d "recursively clean all the dependencies of package named by the import paths"
complete -c go -n '__fish_seen_subcommand_from clean' -s x -d "clean to print remove commands as it executes them"
complete -c go -n '__fish_seen_subcommand_from clean' -o cache -d 'remove the entire go build cache'
complete -c go -n '__fish_seen_subcommand_from clean' -o testcache -d 'expire all test results in the go build cache'
complete -c go -n '__fish_seen_subcommand_from clean' -o modcache -d 'remove the entire module download cache'
# doc
complete -c go -n __fish_use_subcommand -a doc -d 'run godoc on package sources'
complete -c go -n '__fish_seen_subcommand_from doc' -o all -d "show all the documentation for the package"
complete -c go -n '__fish_seen_subcommand_from doc' -s c -d 'respect case when matching symbols'
complete -c go -n '__fish_seen_subcommand_from doc' -o cmd -d 'treat a command (package main) like a regular package'
complete -c go -n '__fish_seen_subcommand_from doc' -o short -d 'one-line representation for each symbol'
complete -c go -n '__fish_seen_subcommand_from doc' -o src -d 'show the full source code for the symbol'
complete -c go -n '__fish_seen_subcommand_from doc' -s u -d 'show documentation for unexported as well as exported symbols'
# env
complete -c go -n __fish_use_subcommand -a env -d 'print Go environment information'
complete -c go -n '__fish_seen_subcommand_from env' -o json -d 'print the environment in JSON format'
complete -c go -n '__fish_seen_subcommand_from env' -s u -r -d 'set NAME to default values'
complete -c go -n '__fish_seen_subcommand_from env' -s w -r -d 'set default values for config variables'
# fix
complete -c go -n __fish_use_subcommand -a fix -d 'run go tool fix on packages'
# fmt
complete -c go -n __fish_use_subcommand -a fmt -d 'run gofmt on package sources'
complete -c go -n '__fish_seen_subcommand_from fmt' -s n -d "prints commands that would be executed"
complete -c go -n '__fish_seen_subcommand_from fmt' -s x -d "prints commands as they are executed"
# get
complete -c go -n __fish_use_subcommand -a get -d 'download and install packages and dependencies'
complete -c go -n '__fish_seen_subcommand_from get' -s d -d "stop after downloading the packages; don't install"
complete -c go -n '__fish_seen_subcommand_from get' -o fix -d "run fix tool on packages before resolving dependencies or building"
complete -c go -n '__fish_seen_subcommand_from get' -s u -d "update remote packages"
complete -c go -n '__fish_seen_subcommand_from get' -s v -d "verbose progress and debug output"
complete -c go -n '__fish_seen_subcommand_from get' -s t -d "also download the packages required to build the tests"
complete -c go -n '__fish_seen_subcommand_from get' -o insecure -d "flag permits fetching & resolving domains using insecure schemes"
# generate
complete -c go -n __fish_use_subcommand -a generate -d 'Generate runs commands described by directives within existing files.'
complete -c go -n '__fish_seen_subcommand_from get' -s n -d "prints commands that would be executed"
complete -c go -n '__fish_seen_subcommand_from get' -s x -d "prints commands as they are executed"
complete -c go -n '__fish_seen_subcommand_from get' -s v -d "prints the names of packages and files as they are processed"
complete -c go -n '__fish_seen_subcommand_from get' -o run -d "prints the names of packages and files as they are processed"
# help
complete -c go -n __fish_use_subcommand -a help -d 'get help on topic'
complete -c go -n '__fish_seen_subcommand_from help' -xa bug -d "start a bug report"
complete -c go -n '__fish_seen_subcommand_from help' -xa build -d "compile packages and dependencies"
complete -c go -n '__fish_seen_subcommand_from help' -xa clean -d "remove object files and cached files"
complete -c go -n '__fish_seen_subcommand_from help' -xa doc -d "show documentation for package or symbol"
complete -c go -n '__fish_seen_subcommand_from help' -xa env -d "print Go environment information"
complete -c go -n '__fish_seen_subcommand_from help' -xa fix -d "update packages to use new APIs"
complete -c go -n '__fish_seen_subcommand_from help' -xa fmt -d "gofmt (reformat) package sources"
complete -c go -n '__fish_seen_subcommand_from help' -xa generate -d "generate Go files by processing source"
complete -c go -n '__fish_seen_subcommand_from help' -xa get -d "download and install packages and dependencies"
complete -c go -n '__fish_seen_subcommand_from help' -xa install -d "compile and install packages and dependencies"
complete -c go -n '__fish_seen_subcommand_from help' -xa list -d "list packages or modules"
complete -c go -n '__fish_seen_subcommand_from help' -xa mod -d "module maintenance"
complete -c go -n '__fish_seen_subcommand_from help' -xa run -d "compile and run Go program"
complete -c go -n '__fish_seen_subcommand_from help' -xa test -d "test packages"
complete -c go -n '__fish_seen_subcommand_from help' -xa tool -d "run specified go tool"
complete -c go -n '__fish_seen_subcommand_from help' -xa version -d "print Go version"
complete -c go -n '__fish_seen_subcommand_from help' -xa vet -d "report likely mistakes in packages"
complete -c go -n '__fish_seen_subcommand_from help' -xa buildmode -d "build modes"
complete -c go -n '__fish_seen_subcommand_from help' -xa c -d "calling between Go and C"
complete -c go -n '__fish_seen_subcommand_from help' -xa cache -d "build and test caching"
complete -c go -n '__fish_seen_subcommand_from help' -xa environment -d "environment variables"
complete -c go -n '__fish_seen_subcommand_from help' -xa filetype -d "file types"
complete -c go -n '__fish_seen_subcommand_from help' -xa go.mod -d "the go.mod file"
complete -c go -n '__fish_seen_subcommand_from help' -xa gopath -d "GOPATH environment variable"
complete -c go -n '__fish_seen_subcommand_from help' -xa gopath-get -d "legacy GOPATH go get"
complete -c go -n '__fish_seen_subcommand_from help' -xa goproxy -d "module proxy protocol"
complete -c go -n '__fish_seen_subcommand_from help' -xa importpath -d "import path syntax"
complete -c go -n '__fish_seen_subcommand_from help' -xa modules -d "modules, module versions, and more"
complete -c go -n '__fish_seen_subcommand_from help' -xa module-get -d "module-aware go get"
complete -c go -n '__fish_seen_subcommand_from help' -xa module-auth -d "module authentication using go.sum"
complete -c go -n '__fish_seen_subcommand_from help' -xa module-private -d "module configuration for non-public modules"
complete -c go -n '__fish_seen_subcommand_from help' -xa packages -d "package lists and patterns"
complete -c go -n '__fish_seen_subcommand_from help' -xa testflag -d "testing flags"
complete -c go -n '__fish_seen_subcommand_from help' -xa testfunc -d "testing functions"
# install
complete -c go -n __fish_use_subcommand -a install -d 'compile and install packages and dependencies'
# list
complete -c go -n __fish_use_subcommand -a list -d 'list packages'
complete -c go -n '__fish_seen_subcommand_from list' -s e -d "tolerate erroneous packages"
complete -c go -n '__fish_seen_subcommand_from list' -s f -r -d "pass in template for formatting"
complete -c go -n '__fish_seen_subcommand_from list' -o json -d "print in JSON format"
complete -c go -n '__fish_seen_subcommand_from list' -o tags -r -d 'list of build tags'
complete -c go -n '__fish_seen_subcommand_from list' -s m -d 'list modules instead of packages'
# run
complete -c go -n __fish_use_subcommand -a run -d 'compile and run Go program'
# test
complete -c go -n __fish_use_subcommand -a test -d 'test packages'
complete -c go -n '__fish_seen_subcommand_from test' -s c -r -d "compile the test binary to pkg.test but do not run it"
complete -c go -n '__fish_seen_subcommand_from test' -s i -d "install dependent packages, but don't run tests"
# tool
complete -c go -n __fish_use_subcommand -a tool -d 'run specified go tool'
complete -c go -n '__fish_seen_subcommand_from tool' -a 'addr2line api asm cgo compile dist fix link nm objdump pack pprof prof vet yacc' -d "target tool"
complete -c go -n '__fish_seen_subcommand_from tool' -s n -d "print the command that would be executed but not execute it"
# version
complete -c go -f -n __fish_use_subcommand -a version -d 'print Go version'
complete -c go -f -n '__fish_seen_subcommand_from version'
# vet
complete -c go -n __fish_use_subcommand -a vet -d 'vet packages'
complete -c go -n '__fish_seen_subcommand_from vet' -s n -d "print the command that would be executed"
complete -c go -n '__fish_seen_subcommand_from vet' -s x -d "prints commands as they are executed"
# mod
complete -c go -n __fish_use_subcommand -a mod -d 'module maintenance'
complete -c go -f -n '__fish_seen_subcommand_from mod' -a download -d "download modules to local cache"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a edit -d "edit go.mod from tools or scripts"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a graph -d "print module requirement graph"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a init -d "initialize new module in current directory"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a tidy -d "add missing and remove unused modules"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a vendor -d "make vendored copy of dependencies"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a verify -d "verify dependencies have expected content"
complete -c go -f -n '__fish_seen_subcommand_from mod' -a why -d "explain why packages or modules are needed"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,12 @@
# There a several different implementations of netcat.
# Try to figure out which is the current used one
# and load the right set of completions.
set -l flavor
if string match -rq -- '^OpenBSD netcat' (nc -h 2>&1)[1]
set flavor nc.openbsd
else
set flavor (basename (realpath (command -v nc)))
end
__fish_complete_netcat nc $flavor

View file

@ -0,0 +1 @@
__fish_complete_netcat nc.openbsd

View file

@ -0,0 +1 @@
__fish_complete_netcat nc.traditional

View file

@ -0,0 +1,74 @@
# Completions for ncat (https://www.nmap.org)
complete -c ncat -f -a "(__fish_print_hostnames)"
# PROTOCOL OPTIONS
complete -c ncat -s 4 -d "IPv4 only"
complete -c ncat -s 6 -d "IPv6 only"
complete -c ncat -s U -l unixsock -d "Use Unix domain sockets"
complete -c ncat -s u -l udp -d "Use UDP"
complete -c ncat -l sctp -d "Use SCTP"
# CONNECT MODE OPTIONS
complete -c ncat -s g -x -d "Loose source routing"
complete -c ncat -s G -x -d "Set source routing pointer"
complete -c ncat -s p -l source-port -x -d "Specify source port"
complete -c ncat -s s -l source -x -d "Specify source address"
# LISTEN MODE OPTIONS
complete -c ncat -s l -l listen -d "Listen for connections"
complete -c ncat -s m -l max-conns -x -d "Specify maximum number of connections"
complete -c ncat -s k -l keep-open -d "Accept multiple connections"
complete -c ncat -l broker -d "Connection brokering"
complete -c ncat -l chat -d "Ad-hoc \"chat server\""
# SSL OPTIONS
complete -c ncat -l ssl -d "Use SSL"
complete -c ncat -l ssl-verify -d "Verify server certificates"
complete -c ncat -l ssl-cert -r -d "Specify SSL certificate"
complete -c ncat -l ssl-key -r -d "Specify SSL private key"
complete -c ncat -l ssl-trustfile -r -d "List trusted certificates"
function __fish_complete_openssl_ciphers
openssl ciphers -s -stdname | string replace -r '^([^ ]*) - ([^ ]*).*$' '$2\t$1'
for cs in COMPLEMENTOFDEFAULT ALL COMPLEMENTOFALL HIGH MEDIUM LOW eNULL NULL aNULL kRSA aRSA RSA kDHr kDHd kDH kDHE kEDH DH DHE EDH ADH kEECDH kECDHE ECDH ECDHE EECDH AECDH aDSS DSS aDH aECDSA ECDSA TLSv1.2 TLSv1.0 SSLv3 AES128 AES256 AES AESGCM AESCCM AESCCM8 ARIA128 ARIA256 ARIA CAMELLIA128 CAMELLIA256 CAMELLIA CHACHA20 3DES DES RC4 RC2 IDEA SEED MD5 SHA1 SHA SHA256 SHA384 aGOST aGOST01 kGOST GOST94 GOST89MAC PSK kPSK kECDHEPSK kDHEPSK kRSAPSK aPSK SUITEB128 SUITEB128ONLY SUITEB192
printf "%s\tCipher String\n" $cs
end
end
complete -c ncat -l ssl-ciphers -x -a "(__fish_complete_list : __fish_complete_openssl_ciphers)" -d "Specify SSL ciphersuites"
complete -c ncat -l ssl-alpn -x -d "Specify ALPN protocol list"
# PROXY OPTIONS
complete -c ncat -l proxy -x -d "Specify proxy address"
complete -c ncat -l proxy-type -x -d "Specify proxy protocol"
complete -c ncat -l proxy-auth -x -d "Specify proxy credentials"
# COMMAND EXECUTION OPTIONS
complete -c ncat -s e -l exec -r -d "Execute command"
complete -c ncat -s c -l sh-exec -r -d "Execute command via sh"
complete -c ncat -l lua-exec -r -d "Execute a .lua script"
# ACCESS CONTROL OPTIONS
complete -c ncat -l allow -x -a "(__fish_print_hostnames)" -d "Allow connections"
complete -c ncat -l allowfile -r -d "Allow connections from file"
complete -c ncat -l deny -x -a "(__fish_print_hostnames)" -d "Deny connections"
complete -c ncat -l denyfile -r -d "Deny connections from file"
# TIMING OPTIONS
complete -c ncat -s d -l delay -x -d "Specify line delay"
complete -c ncat -s i -l idle-timeout -x -d "Specify idle timeout"
complete -c ncat -s w -l wait -x -d "Specify connect timeout"
# OUTPUT OPTIONS
complete -c ncat -s o -l output -r -d "Save session data"
complete -c ncat -s x -l hex-dump -r -d "Save session data in hex"
complete -c ncat -l append-output -d "Append output"
complete -c ncat -s v -l verbose -d "Be verbose"
# MISC OPTIONS
complete -c ncat -s C -l crlf -d "Use CRLF as EOL"
complete -c ncat -s h -l help -d "Help screen"
complete -c ncat -l -recv-only -d "Only receive data"
complete -c ncat -l send-only -d "Only send data"
complete -c ncat -l no-shutdown -d "Do not shutdown into half-duplex mode"
complete -c ncat -s t -l telnet -d "Answer Telnet negotiations"
complete -c ncat -l version -d "Display version"

View file

@ -0,0 +1,12 @@
# There a several different implementations of netcat.
# Try to figure out which is the current used one
# and load the right set of completions.
set -l flavor
if string match -rq -- '^OpenBSD netcat' (netcat -h 2>&1)[1]
set flavor nc.openbsd
else
set flavor (basename (realpath (command -v netcat)))
end
__fish_complete_netcat netcat $flavor

View file

@ -0,0 +1,172 @@
# ____ ____
# / __/___ / __/
# / /_/_ / / /_
# / __/ / /_/ __/
# /_/ /___/_/ key-bindings.fish
#
# - $FZF_TMUX_OPTS
# - $FZF_CTRL_T_COMMAND
# - $FZF_CTRL_T_OPTS
# - $FZF_CTRL_R_OPTS
# - $FZF_ALT_C_COMMAND
# - $FZF_ALT_C_OPTS
# Key bindings
# ------------
function fzf_key_bindings
# Store current token in $dir as root for the 'find' command
function fzf-file-widget -d "List files and folders"
set -l commandline (__fzf_parse_commandline)
set -l dir $commandline[1]
set -l fzf_query $commandline[2]
set -l prefix $commandline[3]
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
# $dir itself, even if hidden.
test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND "
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-o -type f -print \
-o -type d -print \
-o -type l -print 2> /dev/null | sed 's@^\./@@'"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS"
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
end
if [ -z "$result" ]
commandline -f repaint
return
else
# Remove last token from commandline.
commandline -t ""
end
for i in $result
commandline -it -- $prefix
commandline -it -- (string escape $i)
commandline -it -- ' '
end
commandline -f repaint
end
function fzf-history-widget -d "Show command history"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m"
set -l FISH_MAJOR (echo $version | cut -f1 -d.)
set -l FISH_MINOR (echo $version | cut -f2 -d.)
# history's -z flag is needed for multi-line support.
# history's -z flag was added in fish 2.4.0, so don't use it for versions
# before 2.4.0.
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
and commandline -- $result
else
history | eval (__fzfcmd) -q '(commandline)' | read -l result
and commandline -- $result
end
end
commandline -f repaint
end
function fzf-cd-widget -d "Change directory"
set -l commandline (__fzf_parse_commandline)
set -l dir $commandline[1]
set -l fzf_query $commandline[2]
set -l prefix $commandline[3]
test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND "
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
-o -type d -print 2> /dev/null | sed 's@^\./@@'"
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
begin
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
if [ -n "$result" ]
builtin cd -- $result
# Remove last token from commandline.
commandline -t ""
commandline -it -- $prefix
end
end
commandline -f repaint
end
function __fzfcmd
test -n "$FZF_TMUX"; or set FZF_TMUX 0
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
if [ -n "$FZF_TMUX_OPTS" ]
echo "fzf-tmux $FZF_TMUX_OPTS -- "
else if [ $FZF_TMUX -eq 1 ]
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
else
echo "fzf"
end
end
bind \ct fzf-file-widget
bind \cr fzf-history-widget
bind \ec fzf-cd-widget
if bind -M insert > /dev/null 2>&1
bind -M insert \ct fzf-file-widget
bind -M insert \cr fzf-history-widget
bind -M insert \ec fzf-cd-widget
end
function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
set -l commandline (commandline -t)
# strip -option= from token if present
set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
set commandline (string replace -- "$prefix" '' $commandline)
# eval is used to do shell expansion on paths
eval set commandline $commandline
if [ -z $commandline ]
# Default to current directory with no --query
set dir '.'
set fzf_query ''
else
set dir (__fzf_get_dir $commandline)
if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
# if $dir is "." but commandline is not a relative path, this means no file path found
set fzf_query $commandline
else
# Also remove trailing slash after dir, to "split" input properly
set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
end
end
echo $dir
echo $fzf_query
echo $prefix
end
function __fzf_get_dir -d 'Find the longest existing filepath from input string'
set dir $argv
# Strip all trailing slashes. Ignore if $dir is root dir (/)
if [ (string length -- $dir) -gt 1 ]
set dir (string replace -r '/*$' -- '' $dir)
end
# Iteratively check if dir exists and strip tail end of path
while [ ! -d "$dir" ]
# If path is absolute, this can keep going until ends up at /
# If path is relative, this can keep going until entire input is consumed, dirname returns "."
set dir (dirname -- "$dir")
end
echo $dir
end
end

View file

@ -0,0 +1,28 @@
set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin ~/.ghcup/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin ~/.rye/shims $PATH
if command -vq flatpak
set -ga fish_user_paths ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bin
set -gx --path XDG_DATA_DIRS /usr/local/share/ /usr/share/ ~/.local/share/flatpak/exports/share
for install_dir in (flatpak --installations)
set -gxa XDG_DATA_DIRS $install_dir/exports/share
end
end
set fish_greeting ""
set EDITOR vi
set -x GOPATH ~/.go
if test -e $HOME/.asdf/asdf.fish
. ~/.asdf/asdf.fish
end
if test -e $HOME/.config/fish/work.fish
. ~/.config/fish/work.fish
end
. ~/.config/fish/fish_aliases.fish
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/barak/local/google-cloud-sdk/path.fish.inc' ]; . '/home/barak/local/google-cloud-sdk/path.fish.inc'; end
set GOOGLE_APPLICATION_CREDENTIALS "/home/barak/.memtoken.json"

View file

@ -0,0 +1,55 @@
alias :e='vi'
alias t='task'
alias em='emacs'
alias grep="grep --color=auto"
#alias screen="screen -R"
alias dvtm="dvtm -m \"^w\""
alias tm="tmux -2 attach"
alias ppjson="python -mjson.tool"
#alias tmux-pwn='tmux list-clients | sed "s|^\(/dev/ttys[0-9]\+\).*\[\([0-9]\+x[0-9]\+\).*$|\2 \1|" | sort -r -n | tail -n +2 | cut -d " " -f 2 | xargs -n 1 tmux detach-client -t'
# I can never remember the xclip options, so:
alias setclip='xclip -selection c'
alias getclip='xclip -selection clipboard -o'
#machines
alias puck="ssh -D 7777 -Y barak@puck.barakmich.com"
alias hero="ssh -D 7777 -Y barak@hero.barakmich.com"
alias hermia="ssh -Y barak@hermia.home.0b100.net"
#Cosmetic/useful
#alias naim="naim --noscreen"
alias wallall="wallall -p"
#alias cal="cal -3"
#alias google='surfraw google'
alias hd='od -Ax -tx1z -v'
alias gcal='gcalcli'
#Sysdadmin
alias aptsearch="aptitude search"
alias pki="pk i"
alias pks="pk s"
alias openports="lsof -i 4 -n"
alias saupdate="sa-learn --mbox --spam ~/mail/spam"
alias pshosers="ps axeo pcpu,pid,user,command | sort -k 1 -r | head -11 "
alias memhosers="ps axeo size,pcpu,pid,user,command | sort -n -r | head -11 "
alias psx="ps auxwww | grep $1"
alias blaze="bazel"
alias pb='curl -F c=@- https://busb.us/'
alias pburl='curl -F c=@- https://busb.us/u'
#work
alias totemp="cd `pwd | sed 's/controllers/templates/'`"
alias tocont="cd `pwd | sed 's/templates/controllers/'`"
alias kubecat="awk 'FNR==1 && NR!=1 {print \"---\"}{print}'"
#Some orly aliases
alias yarly="orly -y"
alias nowai="orly -n"
alias srsly="orly -s"
#Funnies
alias whothefuckis='finger'
alias whoami="echo 24601"
alias yeet="rm -rf"

View file

@ -0,0 +1,31 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR __fish_initialized:3400
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_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_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr

View file

@ -0,0 +1,44 @@
function fish_prompt --description 'Write out the prompt'
# Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
switch $USER
case root
if not set -q __fish_prompt_cwd
if set -q fish_color_cwd_root
set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
else
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
end
echo -n -s (set_color red) "$USER" (set_color normal) @ (set_color green) "$__fish_prompt_hostname" (set_color normal) ':[' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" ']'
echo
echo -n '# '
case '*'
if not set -q __fish_prompt_cwd
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
if set -q VIRTUAL_ENV
echo -n -s (set_color -b blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
end
echo -n -s (set_color blue) "(" (set_color yellow) (date "+%H:%M") (set_color blue) ")[" (set_color green) "$USER@$__fish_prompt_hostname " (set_color cyan) "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" (set_color blue) ']'
echo
echo -n '$ '
end
end

View file

@ -0,0 +1 @@
function fish_right_prompt; end

View file

@ -0,0 +1,7 @@
function fish_user_key_bindings
fzf_key_bindings
end
function fsize
sed -i "s/size:.*/size: $argv/" $HOME/.config/alacritty/alacritty.yml
end