diff --git a/dot_config/private_fish/completions/bun.fish b/dot_config/private_fish/completions/bun.fish new file mode 100644 index 0000000..19f3dfa --- /dev/null +++ b/dot_config/private_fish/completions/bun.fish @@ -0,0 +1,184 @@ +# This is terribly complicated +# It's because: +# 1. bun run has to have dynamic completions +# 2. there are global options +# 3. bun {install add remove} gets special options +# 4. I don't know how to write fish completions well +# Contributions very welcome!! + +function __fish__get_bun_bins + string split ' ' (bun getcompletes b) +end + +function __fish__get_bun_scripts + set -lx SHELL bash + set -lx MAX_DESCRIPTION_LEN 40 + string trim (string split '\n' (string split '\t' (bun getcompletes z))) +end + +function __fish__get_bun_packages + if test (commandline -ct) != "" + set -lx SHELL fish + string split ' ' (bun getcompletes a (commandline -ct)) + end +end + +function __history_completions + set -l tokens (commandline --current-process --tokenize) + history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' +end + +function __fish__get_bun_bun_js_files + string split ' ' (bun getcompletes j) +end + +set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global +set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't install devDependencies" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" + +set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x +set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x + +function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts" + # Do nothing if we already have a builtin subcommand, + # or any subcommand other than "run". + if __fish_seen_subcommand_from $bun_builtin_cmds_without_run + or not __fish_use_subcommand && not __fish_seen_subcommand_from run + return + end + # Do we already have a bin or script subcommand? + set -l bins (__fish__get_bun_bins) + if __fish_seen_subcommand_from $bins + return + end + # Scripts have descriptions appended with a tab separator. + # Strip off descriptions for the purposes of subcommand testing. + set -l scripts (__fish__get_bun_scripts) + if __fish_seen_subcommand_from $(string split \t -f 1 -- $scripts) + return + end + # Emit scripts. + for script in $scripts + echo $script + end + # Emit binaries and JS files (but only if we're doing `bun run`). + if __fish_seen_subcommand_from run + for bin in $bins + echo "$bin"\t"package bin" + end + for file in (__fish__get_bun_bun_js_files) + echo "$file"\t"Bun.js" + end + end +end + + +# Clear existing completions +complete -e -c bun + +# Dynamically emit scripts and binaries +complete -c bun -f -a "(__bun_complete_bins_scripts)" + +# Complete flags if we have no subcommand or a flag-friendly one. +set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags" +complete -c bun \ + -n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' +complete -c bun \ + -n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' +complete -c bun \ + -n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' +complete -c bun \ + -n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' +complete -c bun \ + -n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)' +complete -c bun \ + -n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' + +# Complete dev and create as first subcommand. +complete -c bun \ + -n "__fish_use_subcommand" -a 'dev' -d 'Start dev server' +complete -c bun \ + -n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' + +# Complete "next" and "react" if we've seen "create". +complete -c bun \ + -n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project' + +complete -c bun \ + -n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project' + +# Complete "upgrade" as first subcommand. +complete -c bun \ + -n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x +# Complete "-h/--help" unconditionally. +complete -c bun \ + -s "h" -l "help" -d 'See all commands and flags' -x + +# Complete "-v/--version" if we have no subcommand. +complete -c bun \ + -n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x + +# Complete additional subcommands. +complete -c bun \ + -n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x + + +complete -c bun \ + -n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' + + +complete -c bun \ + -n "__fish_seen_subcommand_from bun" -F -d 'Bundle this' + +complete -c bun \ + -n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory" + + +complete -c bun \ + -n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' + +complete -c bun \ + -n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' + + +for i in (seq (count $bun_install_boolean_flags)) + complete -c bun \ + -n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" +end + +complete -c bun \ + -n "__fish_seen_subcommand_from install add remove" -l 'cwd' -d 'Change working directory' + +complete -c bun \ + -n "__fish_seen_subcommand_from install add remove" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' + +complete -c bun \ + -n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)' + +complete -c bun \ + -n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)' + +complete -c bun \ + -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f + +complete -c bun \ + -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f + +# Add built-in subcommands with descriptions. +complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template" +complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files" +complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun" +complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary" +complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f +complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f +complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f +complete -c bun -n "__fish_use_subcommand" -a "link" -d "Unregister a local npm package" -f +complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f +complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f diff --git a/dot_config/private_fish/completions/fzf_configure_bindings.fish b/dot_config/private_fish/completions/fzf_configure_bindings.fish new file mode 100644 index 0000000..ec7db93 --- /dev/null +++ b/dot_config/private_fish/completions/fzf_configure_bindings.fish @@ -0,0 +1,8 @@ +complete fzf_configure_bindings --no-files +complete fzf_configure_bindings --long help --short h --description "Print help" +complete fzf_configure_bindings --long directory --description "Change the key binding for searching directory" +complete fzf_configure_bindings --long git_log --description "Change the key binding for searching git log" +complete fzf_configure_bindings --long git_status --description "Change the key binding for searching git status" +complete fzf_configure_bindings --long history --description "Change the key binding for searching history" +complete fzf_configure_bindings --long processes --description "Change the key binding for searching processes" +complete fzf_configure_bindings --long variables --description "Change the key binding for searching variables" diff --git a/dot_config/private_fish/conf.d/aliases.fish b/dot_config/private_fish/conf.d/aliases.fish new file mode 100644 index 0000000..571fc78 --- /dev/null +++ b/dot_config/private_fish/conf.d/aliases.fish @@ -0,0 +1,5 @@ + +# alias g="git" +# alias gpr="git pull -r" + +# alias dns="dscacheutil -flushcache; sudo killall -HUP mDNSResponder" diff --git a/dot_config/private_fish/conf.d/fzf.fish b/dot_config/private_fish/conf.d/fzf.fish new file mode 100644 index 0000000..8156c11 --- /dev/null +++ b/dot_config/private_fish/conf.d/fzf.fish @@ -0,0 +1,28 @@ +# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup +if not status is-interactive && test "$CI" != true + exit +end + +# Because of scoping rules, to capture the shell variables exactly as they are, we must read +# them before even executing _fzf_search_variables. We use psub to store the +# variables' info in temporary files and pass in the filenames as arguments. +# This variable is global so that it can be referenced by fzf_configure_bindings and in tests +set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' + + +# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings +fzf_configure_bindings + +# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased +function _fzf_uninstall --on-event fzf_uninstall + _fzf_uninstall_bindings + + set --erase _fzf_search_vars_command + functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings + complete --erase fzf_configure_bindings + + set_color cyan + echo "fzf.fish uninstalled." + echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings." + set_color normal +end diff --git a/dot_config/private_fish/conf.d/git_aliases.fish b/dot_config/private_fish/conf.d/git_aliases.fish new file mode 100644 index 0000000..7d58671 --- /dev/null +++ b/dot_config/private_fish/conf.d/git_aliases.fish @@ -0,0 +1,159 @@ +# migrating from https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh + +# Aliases +alias g='git' +#compdef g=git +alias gst='git status' +#compdef _git gst=git-status +alias gd='git diff' +#compdef _git gd=git-diff +alias gdc='git diff --cached' +#compdef _git gdc=git-diff +alias gl='git pull' +#compdef _git gl=git-pull +alias gup='git pull --rebase' +#compdef _git gup=git-fetch +alias gp='git push' +#compdef _git gp=git-push +alias gd='git diff' + +function gdv + git diff -w $argv | view - +end + +#compdef _git gdv=git-diff +alias gc='git commit -v' +#compdef _git gc=git-commit +alias gc!='git commit -v --amend' +#compdef _git gc!=git-commit +alias gca='git commit -v -a' +#compdef _git gc=git-commit +alias gca!='git commit -v -a --amend' +#compdef _git gca!=git-commit +alias gcmsg='git commit -m' +#compdef _git gcmsg=git-commit +alias gco='git checkout' +#compdef _git gco=git-checkout +alias gcm='git checkout master' +alias gr='git remote' +#compdef _git gr=git-remote +alias grv='git remote -v' +#compdef _git grv=git-remote +alias grmv='git remote rename' +#compdef _git grmv=git-remote +alias grrm='git remote remove' +#compdef _git grrm=git-remote +alias grset='git remote set-url' +#compdef _git grset=git-remote +alias grup='git remote update' +#compdef _git grset=git-remote +alias grbi='git rebase -i' +#compdef _git grbi=git-rebase +alias grbc='git rebase --continue' +#compdef _git grbc=git-rebase +alias grba='git rebase --abort' +#compdef _git grba=git-rebase +alias gb='git branch' +#compdef _git gb=git-branch +alias gba='git branch -a' +#compdef _git gba=git-branch +alias gcount='git shortlog -sn' +#compdef gcount=git +alias gcl='git config --list' +alias gcp='git cherry-pick' +#compdef _git gcp=git-cherry-pick +alias glg='git log --stat --max-count=10' +#compdef _git glg=git-log +alias glgg='git log --graph --max-count=10' +#compdef _git glgg=git-log +alias glgga='git log --graph --decorate --all' +#compdef _git glgga=git-log +alias glo='git log --oneline' +#compdef _git glo=git-log +alias gss='git status -s' +#compdef _git gss=git-status +alias ga='git add' +#compdef _git ga=git-add +alias gm='git merge' +#compdef _git gm=git-merge +alias grh='git reset HEAD' +alias grhh='git reset HEAD --hard' +alias gclean='git reset --hard; and git clean -dfx' +alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' + +#remove the gf alias +#alias gf='git ls-files | grep' + +alias gpoat='git push origin --all; and git push origin --tags' +alias gmt='git mergetool --no-prompt' +#compdef _git gm=git-mergetool + +alias gg='git gui citool' +alias gga='git gui citool --amend' +alias gk='gitk --all --branches' + +alias gsts='git stash show --text' +alias gsta='git stash' +alias gstp='git stash pop' +alias gstd='git stash drop' + +# Will cd into the top of the current repository +# or submodule. +alias grt='cd (git rev-parse --show-toplevel; or echo ".")' + +# Git and svn mix +alias git-svn-dcommit-push='git svn dcommit; and git push github master:svntrunk' +#compdef git-svn-dcommit-push=git + +alias gsr='git svn rebase' +alias gsd='git svn dcommit' +# +# Will return the current branch name +# Usage example: git pull origin $(current_branch) +# +function current_branch + set ref (git symbolic-ref HEAD 2> /dev/null); or \ + set ref (git rev-parse --short HEAD 2> /dev/null); or return + echo ref | sed s-refs/heads-- +end + +function current_repository + set ref (git symbolic-ref HEAD 2> /dev/null); or \ + set ref (git rev-parse --short HEAD 2> /dev/null); or return + echo (git remote -v | cut -d':' -f 2) +end + +# these aliases take advantage of the previous function +alias ggpull='git pull origin (current_branch)' +#compdef ggpull=git +alias ggpur='git pull --rebase origin (current_branch)' +#compdef ggpur=git +alias ggpush='git push origin (current_branch)' +#compdef ggpush=git +alias ggpnp='git pull origin (current_branch); and git push origin (current_branch)' +#compdef ggpnp=git + +# Pretty log messages +function _git_log_prettily + if ! [ -z $1 ]; then + git log --pretty=$1 + end +end + +alias glp="_git_log_prettily" +#compdef _git glp=git-log + +# Work In Progress (wip) +# These features allow to pause a branch development and switch to another one (wip) +# When you want to go back to work, just unwip it +# +# This function return a warning if the current branch is a wip +function work_in_progress + if git log -n 1 | grep -q -c wip; then + echo "WIP!!" + end +end + +# these alias commit and uncomit wip branches +alias gwip='git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m "wip"' +alias gunwip='git log -n 1 | grep -q -c wip; and git reset HEAD~1' \ No newline at end of file diff --git a/dot_config/private_fish/conf.d/omf.fish b/dot_config/private_fish/conf.d/omf.fish new file mode 100644 index 0000000..3e0f6d6 --- /dev/null +++ b/dot_config/private_fish/conf.d/omf.fish @@ -0,0 +1,7 @@ +# Path to Oh My Fish install. +set -q XDG_DATA_HOME + and set -gx OMF_PATH "$XDG_DATA_HOME/omf" + or set -gx OMF_PATH "$HOME/.local/share/omf" + +# Load Oh My Fish configuration. +source $OMF_PATH/init.fish diff --git a/dot_config/private_fish/config.fish b/dot_config/private_fish/config.fish new file mode 100644 index 0000000..8878ae7 --- /dev/null +++ b/dot_config/private_fish/config.fish @@ -0,0 +1,120 @@ +zoxide init fish | source +if status is-interactive + # fenv source /etc/profile + # Commands to run in interactive sessions can go here + + # doas + # alias sudo='doas' + + # ls + alias exa='eza' + alias l='exa -lh --icons' + alias ls='exa --icons --group-directories-first' + alias ll='exa -lah --icons' + alias lm='exa -m' + alias lr='exa -R' + alias lg='exa -l --group-directories-first --icons' + alias tree='exa --tree' + + # git + alias gcl='git clone --depth 1' + alias gi='git init' + alias ga='git add' + alias gc='git commit -m' + alias gp='git push origin master' + + # cat + alias cat='bat -p' + + # cd/zoxide + alias cd='z' + + # helix + alias hx='helix' + alias h='helix' + + # vim + alias vim='nvim' + alias v='vim' + + # emacs + # alias emacs='emacsclient -nc -s instance1' + + # pn + alias pn='pnpm' + + # paru + alias pa='paru' + alias yay='paru' + + # codium wayland + # alias codium='codium --enable-features=UseOzonePlatform --ozone-platform=wayland' + alias codiumwl='codium --enable-features=UseOzonePlatform --ozone-platform=wayland' + alias codewl='code --enable-features=UseOzonePlatform --ozone-platform=wayland' + + # systemctl + alias sys='systemctl' + + alias sysuser='systemctl --user' + + # fancy cp + alias fcp='rsync -avP' + + # pager + alias less='bat --style plain' + + # helix + alias hx='helix' + + # unset + alias unset 'set --erase' + + # adb + alias adb='HOME="$XDG_DATA_HOME"/android adb' + + function nnn_cd + if test -n "$NNN_PIPE" + printf "%s\0" "0c$PWD" > "$NNN_PIPE" !& + end + end + + trap nnn_cd EXIT +end + +thefuck --alias | source + +# pnpm +set -gx PNPM_HOME "/home/eric/.local/share/pnpm" +if not string match -q -- $PNPM_HOME $PATH + set -gx PATH "$PNPM_HOME" $PATH +end +# pnpm end + +# nnn +alias N="sudo -E nnn" +set -gx LC_COLLATE "C" +set -gx NNN_PAGER "cat" +set -gx NNN_OPTS "eaA" +set -gx NNN_OPENER '/home/eric/.config/nnn/plugins/nuke' +set -gx NNN_PLUG 'd:dragdrop;f:finder;i:!fish -i*;m:mtpmount;o:fzopen;p:preview-tui;r:rsynccp;s:suedit;t:nmount;v:imgview;z:autojump' +set -gx SPLIT 'v' # to split Kitty vertically + +set BLK "03" +set CHR "03" +set DIR "04" +set EXE "02" +set REG "07" +set HARDLINK "05" +set SYMLINK "05" +set MISSING "08" +set ORPHAN "01" +set FIFO "06" +set SOCK "03" +set UNKNOWN "01" +set -gx NNN_FCOLORS "$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN" +set -gx NNN_COLORS "#04020301;4231" +set -gx NNN_TERMINAL "foot" + +# source /opt/miniconda3/etc/fish/conf.d/conda.fish + +starship init fish | source diff --git a/dot_config/private_fish/dot_git/COMMIT_EDITMSG b/dot_config/private_fish/dot_git/COMMIT_EDITMSG new file mode 100644 index 0000000..c6f4d30 --- /dev/null +++ b/dot_config/private_fish/dot_git/COMMIT_EDITMSG @@ -0,0 +1 @@ +Update fish diff --git a/dot_config/private_fish/dot_git/FETCH_HEAD b/dot_config/private_fish/dot_git/FETCH_HEAD new file mode 100644 index 0000000..41f6d7c --- /dev/null +++ b/dot_config/private_fish/dot_git/FETCH_HEAD @@ -0,0 +1 @@ +f5306476ea72d9688fa66cd538782271979e5dc5 branch 'master' of git.siklos-chaneru.dev:Siklos/fish-config diff --git a/dot_config/private_fish/dot_git/HEAD b/dot_config/private_fish/dot_git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/dot_config/private_fish/dot_git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/dot_config/private_fish/dot_git/branches/.keep b/dot_config/private_fish/dot_git/branches/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/dot_git/config b/dot_config/private_fish/dot_git/config new file mode 100644 index 0000000..60e097c --- /dev/null +++ b/dot_config/private_fish/dot_git/config @@ -0,0 +1,11 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = git@git.siklos-chaneru.dev:Siklos/fish-config.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/dot_config/private_fish/dot_git/description b/dot_config/private_fish/dot_git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/dot_config/private_fish/dot_git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_config/private_fish/dot_git/hooks/executable_applypatch-msg.sample b/dot_config/private_fish/dot_git/hooks/executable_applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/dot_config/private_fish/dot_git/hooks/executable_commit-msg.sample b/dot_config/private_fish/dot_git/hooks/executable_commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/dot_config/private_fish/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_config/private_fish/dot_git/hooks/executable_fsmonitor-watchman.sample new file mode 100644 index 0000000..14ed0aa --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_fsmonitor-watchman.sample @@ -0,0 +1,173 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + } + my $query = <<" END"; + ["query", "$git_work_tree", { + "since": $last_update_token, + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/dot_config/private_fish/dot_git/hooks/executable_post-update.sample b/dot_config/private_fish/dot_git/hooks/executable_post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-applypatch.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-commit.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-commit.sample new file mode 100644 index 0000000..e144712 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-merge-commit.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-push.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-rebase.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/dot_config/private_fish/dot_git/hooks/executable_pre-receive.sample b/dot_config/private_fish/dot_git/hooks/executable_pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/dot_config/private_fish/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_config/private_fish/dot_git/hooks/executable_prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/dot_config/private_fish/dot_git/hooks/executable_push-to-checkout.sample b/dot_config/private_fish/dot_git/hooks/executable_push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/dot_config/private_fish/dot_git/hooks/executable_push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/dot_config/private_fish/dot_git/index b/dot_config/private_fish/dot_git/index new file mode 100644 index 0000000..4cd9e0d Binary files /dev/null and b/dot_config/private_fish/dot_git/index differ diff --git a/dot_config/private_fish/dot_git/info/exclude b/dot_config/private_fish/dot_git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/dot_config/private_fish/dot_git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/dot_config/private_fish/dot_git/logs/HEAD b/dot_config/private_fish/dot_git/logs/HEAD new file mode 100644 index 0000000..e78ed93 --- /dev/null +++ b/dot_config/private_fish/dot_git/logs/HEAD @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 f5306476ea72d9688fa66cd538782271979e5dc5 Hydroxycarbamide 1654631308 +0200 commit (initial): Added my fish config +f5306476ea72d9688fa66cd538782271979e5dc5 123172a72b60a0f43bf77c22bb7d09bfcbd90cab Hydroxycarbamide 1680532839 +0200 commit: Update fish diff --git a/dot_config/private_fish/dot_git/logs/refs/heads/master b/dot_config/private_fish/dot_git/logs/refs/heads/master new file mode 100644 index 0000000..e78ed93 --- /dev/null +++ b/dot_config/private_fish/dot_git/logs/refs/heads/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 f5306476ea72d9688fa66cd538782271979e5dc5 Hydroxycarbamide 1654631308 +0200 commit (initial): Added my fish config +f5306476ea72d9688fa66cd538782271979e5dc5 123172a72b60a0f43bf77c22bb7d09bfcbd90cab Hydroxycarbamide 1680532839 +0200 commit: Update fish diff --git a/dot_config/private_fish/dot_git/logs/refs/remotes/origin/master b/dot_config/private_fish/dot_git/logs/refs/remotes/origin/master new file mode 100644 index 0000000..98a7bdd --- /dev/null +++ b/dot_config/private_fish/dot_git/logs/refs/remotes/origin/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 f5306476ea72d9688fa66cd538782271979e5dc5 Hydroxycarbamide 1654631324 +0200 update by push +f5306476ea72d9688fa66cd538782271979e5dc5 123172a72b60a0f43bf77c22bb7d09bfcbd90cab Hydroxycarbamide 1680532842 +0200 update by push diff --git a/dot_config/private_fish/dot_git/objects/12/readonly_09e498fb691ece39d6716ba484d74e1f8caa1a b/dot_config/private_fish/dot_git/objects/12/readonly_09e498fb691ece39d6716ba484d74e1f8caa1a new file mode 100644 index 0000000..35c353a Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/12/readonly_09e498fb691ece39d6716ba484d74e1f8caa1a differ diff --git a/dot_config/private_fish/dot_git/objects/12/readonly_3172a72b60a0f43bf77c22bb7d09bfcbd90cab b/dot_config/private_fish/dot_git/objects/12/readonly_3172a72b60a0f43bf77c22bb7d09bfcbd90cab new file mode 100644 index 0000000..3340268 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/12/readonly_3172a72b60a0f43bf77c22bb7d09bfcbd90cab differ diff --git a/dot_config/private_fish/dot_git/objects/15/readonly_085be84fed7180bb7e293f4838a911c073c381 b/dot_config/private_fish/dot_git/objects/15/readonly_085be84fed7180bb7e293f4838a911c073c381 new file mode 100644 index 0000000..7344581 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/15/readonly_085be84fed7180bb7e293f4838a911c073c381 differ diff --git a/dot_config/private_fish/dot_git/objects/19/readonly_bed86cdaf2f38d1e42f8d093a9608d37fcbd31 b/dot_config/private_fish/dot_git/objects/19/readonly_bed86cdaf2f38d1e42f8d093a9608d37fcbd31 new file mode 100644 index 0000000..12a3580 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/19/readonly_bed86cdaf2f38d1e42f8d093a9608d37fcbd31 differ diff --git a/dot_config/private_fish/dot_git/objects/19/readonly_f3dfa5df898a1015ebab982bf97c7753c65802 b/dot_config/private_fish/dot_git/objects/19/readonly_f3dfa5df898a1015ebab982bf97c7753c65802 new file mode 100644 index 0000000..1d2ad98 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/19/readonly_f3dfa5df898a1015ebab982bf97c7753c65802 differ diff --git a/dot_config/private_fish/dot_git/objects/1a/readonly_aaa17635b2ce79f9a13a81aed44e60bfdd517f b/dot_config/private_fish/dot_git/objects/1a/readonly_aaa17635b2ce79f9a13a81aed44e60bfdd517f new file mode 100644 index 0000000..838db7b Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/1a/readonly_aaa17635b2ce79f9a13a81aed44e60bfdd517f differ diff --git a/dot_config/private_fish/dot_git/objects/1e/readonly_def783dc4ca73f9fac862acab78eb7edbc9344 b/dot_config/private_fish/dot_git/objects/1e/readonly_def783dc4ca73f9fac862acab78eb7edbc9344 new file mode 100644 index 0000000..85d93be Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/1e/readonly_def783dc4ca73f9fac862acab78eb7edbc9344 differ diff --git a/dot_config/private_fish/dot_git/objects/27/readonly_1cfcc9356c38e6ca22cf4ee29dc55e523a155f b/dot_config/private_fish/dot_git/objects/27/readonly_1cfcc9356c38e6ca22cf4ee29dc55e523a155f new file mode 100644 index 0000000..3e756b8 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/27/readonly_1cfcc9356c38e6ca22cf4ee29dc55e523a155f differ diff --git a/dot_config/private_fish/dot_git/objects/27/readonly_cf4f137add8b863ec9f4557f759420eec2683b b/dot_config/private_fish/dot_git/objects/27/readonly_cf4f137add8b863ec9f4557f759420eec2683b new file mode 100644 index 0000000..b75cda2 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/27/readonly_cf4f137add8b863ec9f4557f759420eec2683b differ diff --git a/dot_config/private_fish/dot_git/objects/29/readonly_e74057d36bf32202a4c95bf6700cfdf4137724 b/dot_config/private_fish/dot_git/objects/29/readonly_e74057d36bf32202a4c95bf6700cfdf4137724 new file mode 100644 index 0000000..d936ca7 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/29/readonly_e74057d36bf32202a4c95bf6700cfdf4137724 differ diff --git a/dot_config/private_fish/dot_git/objects/2b/readonly_3af165d6a1255b9a5098b1f5e1163a11db6cb3 b/dot_config/private_fish/dot_git/objects/2b/readonly_3af165d6a1255b9a5098b1f5e1163a11db6cb3 new file mode 100644 index 0000000..35b517e --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/2b/readonly_3af165d6a1255b9a5098b1f5e1163a11db6cb3 @@ -0,0 +1,4 @@ +xRMo0 ݙ_a!NӴ'* +4(Nk$ x==TV( 4Zg̝ @\ba.T` ْܝx +b\Jd +^;JG%wM2`xմ`7l} %0\Lݫ=[Vٶqis/XF+9F2XVm6[νȧW3ϳ?[b7ӚeðiAyέڤl6T뻤%VbW;YZCV++UH?Uy¬|v4S`T9:TrTl-aG0SR҈nr :% +ZɀAO@a +ۿAQ/XVնGDmGg7`K.4&zt! avI ֌Ov9,m&G _/jK~ @LF!nU;_ ZSQ2GB_uf~?wf08F&Ҭ=L,/%K\ n V+6y6g$D㤊M;9*EYwWzgm52L >|R\\mgPdH]MJ5>A|F{AEnDƵ_ri_̋1JV{&'xB;9ݭ0${+]XLֻ[2٦ \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/3f/readonly_e17fc2a3b34833a957391b1b9ae0e1701192f3 b/dot_config/private_fish/dot_git/objects/3f/readonly_e17fc2a3b34833a957391b1b9ae0e1701192f3 new file mode 100644 index 0000000..76f033a Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/3f/readonly_e17fc2a3b34833a957391b1b9ae0e1701192f3 differ diff --git a/dot_config/private_fish/dot_git/objects/49/readonly_e02e1ca3311dbc345fa4b7d137bdd3d51f2195 b/dot_config/private_fish/dot_git/objects/49/readonly_e02e1ca3311dbc345fa4b7d137bdd3d51f2195 new file mode 100644 index 0000000..790bb1d --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/49/readonly_e02e1ca3311dbc345fa4b7d137bdd3d51f2195 @@ -0,0 +1,2 @@ +xeN0 dWXS```E|G:zڴ'|w]/ v$#>ȠתR6P)F'!8 IKz JZܲaJN}=8,"(9^XW0MFQ& f Eo( +-9lϓnyСB] \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/53/readonly_d527d414481eefd6b7a1ecc2d1f0d66f656e55 b/dot_config/private_fish/dot_git/objects/53/readonly_d527d414481eefd6b7a1ecc2d1f0d66f656e55 new file mode 100644 index 0000000..7724f55 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/53/readonly_d527d414481eefd6b7a1ecc2d1f0d66f656e55 differ diff --git a/dot_config/private_fish/dot_git/objects/57/readonly_1fc78e6245676911b3f8da27646eab8a52e0e2 b/dot_config/private_fish/dot_git/objects/57/readonly_1fc78e6245676911b3f8da27646eab8a52e0e2 new file mode 100644 index 0000000..f5a1dec Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/57/readonly_1fc78e6245676911b3f8da27646eab8a52e0e2 differ diff --git a/dot_config/private_fish/dot_git/objects/57/readonly_d3d132512054a5fe3851771db095e0c4ee42ef b/dot_config/private_fish/dot_git/objects/57/readonly_d3d132512054a5fe3851771db095e0c4ee42ef new file mode 100644 index 0000000..2135ea0 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/57/readonly_d3d132512054a5fe3851771db095e0c4ee42ef differ diff --git a/dot_config/private_fish/dot_git/objects/59/readonly_86a49c9af94660e4c627d5bc58db2605fc63c8 b/dot_config/private_fish/dot_git/objects/59/readonly_86a49c9af94660e4c627d5bc58db2605fc63c8 new file mode 100644 index 0000000..cc58753 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/59/readonly_86a49c9af94660e4c627d5bc58db2605fc63c8 differ diff --git a/dot_config/private_fish/dot_git/objects/65/readonly_e2cb83e67f2094b2ad9924dd88d0ed2f624002 b/dot_config/private_fish/dot_git/objects/65/readonly_e2cb83e67f2094b2ad9924dd88d0ed2f624002 new file mode 100644 index 0000000..6e862fe Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/65/readonly_e2cb83e67f2094b2ad9924dd88d0ed2f624002 differ diff --git a/dot_config/private_fish/dot_git/objects/65/readonly_e8fe4cafe17ce1571975eda85e71f333314454 b/dot_config/private_fish/dot_git/objects/65/readonly_e8fe4cafe17ce1571975eda85e71f333314454 new file mode 100644 index 0000000..ed80961 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/65/readonly_e8fe4cafe17ce1571975eda85e71f333314454 differ diff --git a/dot_config/private_fish/dot_git/objects/74/readonly_4f2262de22398af2ced75f5c6269dfd2b723e5 b/dot_config/private_fish/dot_git/objects/74/readonly_4f2262de22398af2ced75f5c6269dfd2b723e5 new file mode 100644 index 0000000..8b4f88f Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/74/readonly_4f2262de22398af2ced75f5c6269dfd2b723e5 differ diff --git a/dot_config/private_fish/dot_git/objects/79/readonly_a5c79d9ac6c1de6e21937c0f401986aa2bf8f3 b/dot_config/private_fish/dot_git/objects/79/readonly_a5c79d9ac6c1de6e21937c0f401986aa2bf8f3 new file mode 100644 index 0000000..9da26a1 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/79/readonly_a5c79d9ac6c1de6e21937c0f401986aa2bf8f3 differ diff --git a/dot_config/private_fish/dot_git/objects/7b/readonly_debde6595c9660ab7e42679172554235c28e70 b/dot_config/private_fish/dot_git/objects/7b/readonly_debde6595c9660ab7e42679172554235c28e70 new file mode 100644 index 0000000..68172ff Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/7b/readonly_debde6595c9660ab7e42679172554235c28e70 differ diff --git a/dot_config/private_fish/dot_git/objects/7d/readonly_586715f4c323221440d302a7ba61e2d74f6344 b/dot_config/private_fish/dot_git/objects/7d/readonly_586715f4c323221440d302a7ba61e2d74f6344 new file mode 100644 index 0000000..9af4037 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/7d/readonly_586715f4c323221440d302a7ba61e2d74f6344 differ diff --git a/dot_config/private_fish/dot_git/objects/7f/readonly_03e1847ba4ba4c4cfe514f01e16bfee75ab8a0 b/dot_config/private_fish/dot_git/objects/7f/readonly_03e1847ba4ba4c4cfe514f01e16bfee75ab8a0 new file mode 100644 index 0000000..60b7bf2 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/7f/readonly_03e1847ba4ba4c4cfe514f01e16bfee75ab8a0 differ diff --git a/dot_config/private_fish/dot_git/objects/81/readonly_56c11b8f2d1cb411af6337007f5f27f9fd4f9f b/dot_config/private_fish/dot_git/objects/81/readonly_56c11b8f2d1cb411af6337007f5f27f9fd4f9f new file mode 100644 index 0000000..c88f411 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/81/readonly_56c11b8f2d1cb411af6337007f5f27f9fd4f9f differ diff --git a/dot_config/private_fish/dot_git/objects/82/readonly_4c697b310cd472cd7252ea8ca9d8be09d97977 b/dot_config/private_fish/dot_git/objects/82/readonly_4c697b310cd472cd7252ea8ca9d8be09d97977 new file mode 100644 index 0000000..34d7538 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/82/readonly_4c697b310cd472cd7252ea8ca9d8be09d97977 differ diff --git a/dot_config/private_fish/dot_git/objects/84/readonly_fb64fabc28f32f26d6f4de2c7be32d3d5a1086 b/dot_config/private_fish/dot_git/objects/84/readonly_fb64fabc28f32f26d6f4de2c7be32d3d5a1086 new file mode 100644 index 0000000..46e6f26 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/84/readonly_fb64fabc28f32f26d6f4de2c7be32d3d5a1086 differ diff --git a/dot_config/private_fish/dot_git/objects/89/readonly_0c69a7209a44949cab061d498f3a21e52e7416 b/dot_config/private_fish/dot_git/objects/89/readonly_0c69a7209a44949cab061d498f3a21e52e7416 new file mode 100644 index 0000000..18ad9be Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/89/readonly_0c69a7209a44949cab061d498f3a21e52e7416 differ diff --git a/dot_config/private_fish/dot_git/objects/89/readonly_e0a4ad6cdc0c4df0876cb2befbe990d8199fef b/dot_config/private_fish/dot_git/objects/89/readonly_e0a4ad6cdc0c4df0876cb2befbe990d8199fef new file mode 100644 index 0000000..e4c877c Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/89/readonly_e0a4ad6cdc0c4df0876cb2befbe990d8199fef differ diff --git a/dot_config/private_fish/dot_git/objects/93/readonly_1c4a423af53a0f0e1c786e6d9b503da6fe0ea8 b/dot_config/private_fish/dot_git/objects/93/readonly_1c4a423af53a0f0e1c786e6d9b503da6fe0ea8 new file mode 100644 index 0000000..73d8e82 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/93/readonly_1c4a423af53a0f0e1c786e6d9b503da6fe0ea8 differ diff --git a/dot_config/private_fish/dot_git/objects/94/readonly_24aad6647f29e3922a8ec8cd4cad862f2968ea b/dot_config/private_fish/dot_git/objects/94/readonly_24aad6647f29e3922a8ec8cd4cad862f2968ea new file mode 100644 index 0000000..61ebeb7 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/94/readonly_24aad6647f29e3922a8ec8cd4cad862f2968ea differ diff --git a/dot_config/private_fish/dot_git/objects/94/readonly_a3a9102ee69290c0928b12ec5d5df12f3b70d5 b/dot_config/private_fish/dot_git/objects/94/readonly_a3a9102ee69290c0928b12ec5d5df12f3b70d5 new file mode 100644 index 0000000..c73b347 --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/94/readonly_a3a9102ee69290c0928b12ec5d5df12f3b70d5 @@ -0,0 +1 @@ +x+)JMU044c040031QHJK,`h ;(ݯ+Ep}9C}Ͽj3Ks2S!jk#EVVq̴|W.PPs}<.o텧k- \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/9b/readonly_ea4afc83012b6d8f0171b3db81e037d932590b b/dot_config/private_fish/dot_git/objects/9b/readonly_ea4afc83012b6d8f0171b3db81e037d932590b new file mode 100644 index 0000000..8f9dd14 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/9b/readonly_ea4afc83012b6d8f0171b3db81e037d932590b differ diff --git a/dot_config/private_fish/dot_git/objects/9e/readonly_5145378a3ce3b864c9938b1668a82a2f1b83ac b/dot_config/private_fish/dot_git/objects/9e/readonly_5145378a3ce3b864c9938b1668a82a2f1b83ac new file mode 100644 index 0000000..22dadc5 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/9e/readonly_5145378a3ce3b864c9938b1668a82a2f1b83ac differ diff --git a/dot_config/private_fish/dot_git/objects/a1/readonly_3219b26aff2d061ca0a5c57d1e06c0c268cdb2 b/dot_config/private_fish/dot_git/objects/a1/readonly_3219b26aff2d061ca0a5c57d1e06c0c268cdb2 new file mode 100644 index 0000000..e5bc5d3 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a1/readonly_3219b26aff2d061ca0a5c57d1e06c0c268cdb2 differ diff --git a/dot_config/private_fish/dot_git/objects/a1/readonly_5465fdac46aef7635148783ece374d2cc9e6d3 b/dot_config/private_fish/dot_git/objects/a1/readonly_5465fdac46aef7635148783ece374d2cc9e6d3 new file mode 100644 index 0000000..df3d81f Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a1/readonly_5465fdac46aef7635148783ece374d2cc9e6d3 differ diff --git a/dot_config/private_fish/dot_git/objects/a1/readonly_58b02dd48461b63cf1ee569a4a104cb5f0c7e2 b/dot_config/private_fish/dot_git/objects/a1/readonly_58b02dd48461b63cf1ee569a4a104cb5f0c7e2 new file mode 100644 index 0000000..014a887 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a1/readonly_58b02dd48461b63cf1ee569a4a104cb5f0c7e2 differ diff --git a/dot_config/private_fish/dot_git/objects/a3/readonly_9c536d5cdefff22f699736b0cada8d823bdc87 b/dot_config/private_fish/dot_git/objects/a3/readonly_9c536d5cdefff22f699736b0cada8d823bdc87 new file mode 100644 index 0000000..94d2e19 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a3/readonly_9c536d5cdefff22f699736b0cada8d823bdc87 differ diff --git a/dot_config/private_fish/dot_git/objects/a4/readonly_545891a25bc9529f0d7a4eca1cacbf4796aeb5 b/dot_config/private_fish/dot_git/objects/a4/readonly_545891a25bc9529f0d7a4eca1cacbf4796aeb5 new file mode 100644 index 0000000..9ec1298 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a4/readonly_545891a25bc9529f0d7a4eca1cacbf4796aeb5 differ diff --git a/dot_config/private_fish/dot_git/objects/a7/readonly_8fd54ddcc25601a2e4aa8afe2ace07dd3ff781 b/dot_config/private_fish/dot_git/objects/a7/readonly_8fd54ddcc25601a2e4aa8afe2ace07dd3ff781 new file mode 100644 index 0000000..c392dcd --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/a7/readonly_8fd54ddcc25601a2e4aa8afe2ace07dd3ff781 @@ -0,0 +1 @@ +xA E]U^4@L3PzzilF쎐y?} %7 @%ȝ=8:Ƃ%ϒӀ8B{̴ 4eu*:n8f,P%ltQ]Bar4QTUEƫ.WPBJ+F C \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/a8/readonly_c3dc43a2df64e340efc8c4ea6fe1559179644e b/dot_config/private_fish/dot_git/objects/a8/readonly_c3dc43a2df64e340efc8c4ea6fe1559179644e new file mode 100644 index 0000000..f324238 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a8/readonly_c3dc43a2df64e340efc8c4ea6fe1559179644e differ diff --git a/dot_config/private_fish/dot_git/objects/a9/readonly_287016a62d11df427a8fb8d4d5f39e610d2e7f b/dot_config/private_fish/dot_git/objects/a9/readonly_287016a62d11df427a8fb8d4d5f39e610d2e7f new file mode 100644 index 0000000..3e3ffac Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a9/readonly_287016a62d11df427a8fb8d4d5f39e610d2e7f differ diff --git a/dot_config/private_fish/dot_git/objects/a9/readonly_f271f02e104124e4275c9c8699cfefb356c765 b/dot_config/private_fish/dot_git/objects/a9/readonly_f271f02e104124e4275c9c8699cfefb356c765 new file mode 100644 index 0000000..20f63fb Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/a9/readonly_f271f02e104124e4275c9c8699cfefb356c765 differ diff --git a/dot_config/private_fish/dot_git/objects/ac/readonly_30d7ddcfbd415f146de612389eb71e6fdef212 b/dot_config/private_fish/dot_git/objects/ac/readonly_30d7ddcfbd415f146de612389eb71e6fdef212 new file mode 100644 index 0000000..fb21bb3 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ac/readonly_30d7ddcfbd415f146de612389eb71e6fdef212 differ diff --git a/dot_config/private_fish/dot_git/objects/ad/readonly_928dc30d8cb0d865612408edc1e99b466bc92b b/dot_config/private_fish/dot_git/objects/ad/readonly_928dc30d8cb0d865612408edc1e99b466bc92b new file mode 100644 index 0000000..d366185 --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/ad/readonly_928dc30d8cb0d865612408edc1e99b466bc92b @@ -0,0 +1,3 @@ +x5 QKGH2ul|,籁KBHY + wqSqkVMi,S +_x \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/ad/readonly_db55c1fecf9d84d7581c08767b7601bac7ece6 b/dot_config/private_fish/dot_git/objects/ad/readonly_db55c1fecf9d84d7581c08767b7601bac7ece6 new file mode 100644 index 0000000..44c4f14 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ad/readonly_db55c1fecf9d84d7581c08767b7601bac7ece6 differ diff --git a/dot_config/private_fish/dot_git/objects/ba/readonly_6ea63bbeda675e4216951b5dc09ae2f9e9ea8d b/dot_config/private_fish/dot_git/objects/ba/readonly_6ea63bbeda675e4216951b5dc09ae2f9e9ea8d new file mode 100644 index 0000000..527d3b5 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ba/readonly_6ea63bbeda675e4216951b5dc09ae2f9e9ea8d differ diff --git a/dot_config/private_fish/dot_git/objects/c5/readonly_480e6696c4870ea853151c2b3213e4574c8cb3 b/dot_config/private_fish/dot_git/objects/c5/readonly_480e6696c4870ea853151c2b3213e4574c8cb3 new file mode 100644 index 0000000..4f1c0fe Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/c5/readonly_480e6696c4870ea853151c2b3213e4574c8cb3 differ diff --git a/dot_config/private_fish/dot_git/objects/c6/readonly_e8c3d98e803da4682ac81b59107aef9ba95f21 b/dot_config/private_fish/dot_git/objects/c6/readonly_e8c3d98e803da4682ac81b59107aef9ba95f21 new file mode 100644 index 0000000..6660d46 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/c6/readonly_e8c3d98e803da4682ac81b59107aef9ba95f21 differ diff --git a/dot_config/private_fish/dot_git/objects/d7/readonly_95c5c725fea0baaed65b4fd736a35f617c75ff b/dot_config/private_fish/dot_git/objects/d7/readonly_95c5c725fea0baaed65b4fd736a35f617c75ff new file mode 100644 index 0000000..d2dc2ec Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/d7/readonly_95c5c725fea0baaed65b4fd736a35f617c75ff differ diff --git a/dot_config/private_fish/dot_git/objects/d8/readonly_bf06d552c36b7133550d8bd02ae96a2c8c1084 b/dot_config/private_fish/dot_git/objects/d8/readonly_bf06d552c36b7133550d8bd02ae96a2c8c1084 new file mode 100644 index 0000000..0d33ae2 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/d8/readonly_bf06d552c36b7133550d8bd02ae96a2c8c1084 differ diff --git a/dot_config/private_fish/dot_git/objects/dd/readonly_4e9523ad3293e2009b9ea00cb9a3f782775630 b/dot_config/private_fish/dot_git/objects/dd/readonly_4e9523ad3293e2009b9ea00cb9a3f782775630 new file mode 100644 index 0000000..4b9ab98 --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/dd/readonly_4e9523ad3293e2009b9ea00cb9a3f782775630 @@ -0,0 +1 @@ +x_K0}8tA(/ |\Ȓ۔~xo?ZQC {2%n&hHdQwhƢ?‘US섕T䢋$୨P/ DM%-pp ט}a:vkrm?qz Klb+o >"/ҿgt1{v,">`i \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/e3/readonly_ef59fd3e0cb9331b8e0c0a6ce5d17663f0bd03 b/dot_config/private_fish/dot_git/objects/e3/readonly_ef59fd3e0cb9331b8e0c0a6ce5d17663f0bd03 new file mode 100644 index 0000000..19f140f Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/e3/readonly_ef59fd3e0cb9331b8e0c0a6ce5d17663f0bd03 differ diff --git a/dot_config/private_fish/dot_git/objects/e5/readonly_f8e9fee0d547af4d4ef1c080e03111e320f7c6 b/dot_config/private_fish/dot_git/objects/e5/readonly_f8e9fee0d547af4d4ef1c080e03111e320f7c6 new file mode 100644 index 0000000..25be1f6 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/e5/readonly_f8e9fee0d547af4d4ef1c080e03111e320f7c6 differ diff --git a/dot_config/private_fish/dot_git/objects/ea/readonly_a68d053889e50383bbece3bcdf43cc9b23ec2e b/dot_config/private_fish/dot_git/objects/ea/readonly_a68d053889e50383bbece3bcdf43cc9b23ec2e new file mode 100644 index 0000000..ef16b76 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ea/readonly_a68d053889e50383bbece3bcdf43cc9b23ec2e differ diff --git a/dot_config/private_fish/dot_git/objects/ec/readonly_24f73d247ccc545d9dc0dcfc7e805060bada79 b/dot_config/private_fish/dot_git/objects/ec/readonly_24f73d247ccc545d9dc0dcfc7e805060bada79 new file mode 100644 index 0000000..5c64619 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ec/readonly_24f73d247ccc545d9dc0dcfc7e805060bada79 differ diff --git a/dot_config/private_fish/dot_git/objects/ec/readonly_7db935048fa1ec80613262c7bc072af18c7642 b/dot_config/private_fish/dot_git/objects/ec/readonly_7db935048fa1ec80613262c7bc072af18c7642 new file mode 100644 index 0000000..ed74551 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ec/readonly_7db935048fa1ec80613262c7bc072af18c7642 differ diff --git a/dot_config/private_fish/dot_git/objects/ec/readonly_fe68ec80206b0fa55c0a934f5c5ab78d2c7a37 b/dot_config/private_fish/dot_git/objects/ec/readonly_fe68ec80206b0fa55c0a934f5c5ab78d2c7a37 new file mode 100644 index 0000000..26f9705 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ec/readonly_fe68ec80206b0fa55c0a934f5c5ab78d2c7a37 differ diff --git a/dot_config/private_fish/dot_git/objects/ed/readonly_a2453c89124f483e78edfc93fa72503122af1d b/dot_config/private_fish/dot_git/objects/ed/readonly_a2453c89124f483e78edfc93fa72503122af1d new file mode 100644 index 0000000..ea0b5d1 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/ed/readonly_a2453c89124f483e78edfc93fa72503122af1d differ diff --git a/dot_config/private_fish/dot_git/objects/f1/readonly_5a4617f3ddeb656946f6dbf7bfd280a8821a86 b/dot_config/private_fish/dot_git/objects/f1/readonly_5a4617f3ddeb656946f6dbf7bfd280a8821a86 new file mode 100644 index 0000000..4b549b6 --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/f1/readonly_5a4617f3ddeb656946f6dbf7bfd280a8821a86 @@ -0,0 +1,3 @@ +xURAj0 9)C +;Xβ,}|M!x4K#b>=p +g 8 R.,S4a5CY*{@Hsp dPˌ(GC7/EwĞ#O8u`WXJ^f빐0=sk!3oݐ 8W!p1'RiOsk+xwvEu^k.[p^tZzyL(:@mz UggmF`\yjbzM ];YZaޗX]ە#>c*ϣYA3P/ẑ \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/f5/readonly_306476ea72d9688fa66cd538782271979e5dc5 b/dot_config/private_fish/dot_git/objects/f5/readonly_306476ea72d9688fa66cd538782271979e5dc5 new file mode 100644 index 0000000..7a95515 --- /dev/null +++ b/dot_config/private_fish/dot_git/objects/f5/readonly_306476ea72d9688fa66cd538782271979e5dc5 @@ -0,0 +1 @@ +xA @Qלb& Kb -0i"Csj`thϞ,j)l11sѹQmRѩʧD ˰/5UI>=|ўf;^਍Wĩ;17@)1 M# \ No newline at end of file diff --git a/dot_config/private_fish/dot_git/objects/f8/readonly_ae37599bd8f8d961ab0aa1361609d8664621b3 b/dot_config/private_fish/dot_git/objects/f8/readonly_ae37599bd8f8d961ab0aa1361609d8664621b3 new file mode 100644 index 0000000..ceaeb26 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/f8/readonly_ae37599bd8f8d961ab0aa1361609d8664621b3 differ diff --git a/dot_config/private_fish/dot_git/objects/fe/readonly_e63085a64e93240d08f2eac27296f1cd5d92b8 b/dot_config/private_fish/dot_git/objects/fe/readonly_e63085a64e93240d08f2eac27296f1cd5d92b8 new file mode 100644 index 0000000..4613f28 Binary files /dev/null and b/dot_config/private_fish/dot_git/objects/fe/readonly_e63085a64e93240d08f2eac27296f1cd5d92b8 differ diff --git a/dot_config/private_fish/dot_git/objects/info/.keep b/dot_config/private_fish/dot_git/objects/info/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/dot_git/objects/pack/.keep b/dot_config/private_fish/dot_git/objects/pack/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/dot_git/refs/heads/master b/dot_config/private_fish/dot_git/refs/heads/master new file mode 100644 index 0000000..89fe52f --- /dev/null +++ b/dot_config/private_fish/dot_git/refs/heads/master @@ -0,0 +1 @@ +123172a72b60a0f43bf77c22bb7d09bfcbd90cab diff --git a/dot_config/private_fish/dot_git/refs/remotes/origin/master b/dot_config/private_fish/dot_git/refs/remotes/origin/master new file mode 100644 index 0000000..89fe52f --- /dev/null +++ b/dot_config/private_fish/dot_git/refs/remotes/origin/master @@ -0,0 +1 @@ +123172a72b60a0f43bf77c22bb7d09bfcbd90cab diff --git a/dot_config/private_fish/dot_git/refs/tags/.keep b/dot_config/private_fish/dot_git/refs/tags/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/fish_plugins b/dot_config/private_fish/fish_plugins new file mode 100644 index 0000000..d8bf06d --- /dev/null +++ b/dot_config/private_fish/fish_plugins @@ -0,0 +1,4 @@ +decors/fish-colored-man +catppuccin/fish +edc/bass +patrickf1/fzf.fish diff --git a/dot_config/private_fish/fish_variables b/dot_config/private_fish/fish_variables new file mode 100644 index 0000000..a15465f --- /dev/null +++ b/dot_config/private_fish/fish_variables @@ -0,0 +1,66 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR --export BUN_INSTALL:/home/eric/\x2ebun +SETUVAR --export EDITOR:nvim +SETUVAR FZF_COMPLETE:2 +SETUVAR --export FZF_DEFAULT_OPTS:\x20\x20\x20\x20\x2d\x2dheight\x2060\x25\x20\x2d\x2dlayout\x3dreverse\x20\x2d\x2dborder\x20\x20\x20\x20\x20\x2d\x2dcolor\x3dbg\x2b\x3a\x23363a4f\x2cbg\x3a\x2324273a\x2cspinner\x3a\x23f4dbd6\x2chl\x3a\x23ed8796\x20\x20\x20\x20\x20\x2d\x2dcolor\x3dfg\x3a\x23cad3f5\x2cheader\x3a\x23ed8796\x2cinfo\x3a\x23c6a0f6\x2cpointer\x3a\x23f4dbd6\x20\x20\x20\x20\x20\x2d\x2dcolor\x3dmarker\x3a\x23f4dbd6\x2cfg\x2b\x3a\x23cad3f5\x2cprompt\x3a\x23c6a0f6\x2chl\x2b\x3a\x23ed8796 +SETUVAR FZF_DISABLE_KEYBINDINGS:0 +SETUVAR FZF_FIND_FILE_COMMAND:ag\x20\x2dl\x20\x2d\x2dhidden\x20\x2d\x2dignore\x20\x2egit +SETUVAR FZF_LEGACY_KEYBINDINGS:1 +SETUVAR FZF_PREVIEW_DIR_CMD:ls +SETUVAR FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010 +SETUVAR FZF_TMUX_HEIGHT:40\x25 +SETUVAR --export NNN_COLORS:\x2304020301\x3b4231 +SETUVAR --export PNPM_HOME:/home/eric/\x2elocal/share/pnpm +SETUVAR --export TERM:foot +SETUVAR --export TERMINAL:kitty +SETUVAR --export VISUAL:nvim +SETUVAR __fish_initialized:3400 +SETUVAR _fisher_catppuccin_2F_fish_files:\x7e/\x2econfig/fish/themes/Catppuccin\x20Frappe\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Latte\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Macchiato\x2etheme\x1e\x7e/\x2econfig/fish/themes/Catppuccin\x20Mocha\x2etheme +SETUVAR _fisher_decors_2F_fish_2D_colored_2D_man_files:\x7e/\x2econfig/fish/functions/man\x2efish +SETUVAR _fisher_edc_2F_bass_files:\x7e/\x2econfig/fish/functions/__bass\x2epy\x1e\x7e/\x2econfig/fish/functions/bass\x2efish +SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish +SETUVAR _fisher_plugins:decors/fish\x2dcolored\x2dman\x1ecatppuccin/fish\x1eedc/bass\x1epatrickf1/fzf\x2efish +SETUVAR _fisher_upgraded_to_4_4:\x1d +SETUVAR fish_color_autosuggestion:6e738d +SETUVAR fish_color_cancel:ed8796 +SETUVAR fish_color_command:8aadf4 +SETUVAR fish_color_comment:\x1d +SETUVAR fish_color_cwd:eed49f +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:f5a97f +SETUVAR fish_color_error:ed8796 +SETUVAR fish_color_escape:f0c6c6 +SETUVAR fish_color_gray:6e738d +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:8aadf4 +SETUVAR fish_color_host_remote:\x1d +SETUVAR fish_color_keyword:ed8796 +SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue +SETUVAR fish_color_normal:cad3f5 +SETUVAR fish_color_operator:f5bde6 +SETUVAR fish_color_option:\x1d +SETUVAR fish_color_param:f0c6c6 +SETUVAR fish_color_quote:a6da95 +SETUVAR fish_color_redirection:f5bde6 +SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d363a4f +SETUVAR fish_color_selection:\x2d\x2dbackground\x3d363a4f +SETUVAR fish_color_status:red +SETUVAR fish_color_user:8bd5ca +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_greeting: +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_background:\x1d +SETUVAR fish_pager_color_completion:cad3f5 +SETUVAR fish_pager_color_description:6e738d +SETUVAR fish_pager_color_prefix:f5bde6 +SETUVAR fish_pager_color_progress:6e738d +SETUVAR fish_pager_color_secondary_background:\x1d +SETUVAR fish_pager_color_secondary_completion:\x1d +SETUVAR fish_pager_color_secondary_description:\x1d +SETUVAR fish_pager_color_secondary_prefix:\x1d +SETUVAR fish_pager_color_selected_background:\x1d +SETUVAR fish_pager_color_selected_completion:\x1d +SETUVAR fish_pager_color_selected_description:\x1d +SETUVAR fish_pager_color_selected_prefix:\x1d +SETUVAR fish_user_paths:/home/eric/\x2enix\x2dprofile/bin\x1e/home/eric/\x2eemacs\x2ed/bin\x1e/home/eric/\x2elocal/bin\x1e/home/eric/\x2elocal/share/pnpm\x1e/home/eric/\x2espicetify\x1e/opt/rocm/bin\x1e/home/eric/\x2ebun/bin\x1e/usr/bin\x1e/usr/sbin\x1e/usr/local/bin\x1e/usr/local/sbin diff --git a/dot_config/private_fish/fishfile b/dot_config/private_fish/fishfile new file mode 100644 index 0000000..379794f --- /dev/null +++ b/dot_config/private_fish/fishfile @@ -0,0 +1 @@ +edc/bass diff --git a/dot_config/private_fish/functions/__bass.py b/dot_config/private_fish/functions/__bass.py new file mode 100644 index 0000000..3fe17fc --- /dev/null +++ b/dot_config/private_fish/functions/__bass.py @@ -0,0 +1,138 @@ +""" +To be used with a companion fish function like this: + + function refish + set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x + end + +""" + +from __future__ import print_function + +import json +import os +import signal +import subprocess +import sys +import traceback + + +BASH = 'bash' + +FISH_READONLY = [ + 'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version', + 'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode' +] + +IGNORED = [ + 'PS1', 'XPC_SERVICE_NAME' +] + +def ignored(name): + if name == 'PWD': # this is read only, but has special handling + return False + # ignore other read only variables + if name in FISH_READONLY: + return True + if name in IGNORED or name.startswith("BASH_FUNC"): + return True + return False + +def escape(string): + # use json.dumps to reliably escape quotes and backslashes + return json.dumps(string).replace(r'$', r'\$') + +def escape_identifier(word): + return escape(word.replace('?', '\\?')) + +def comment(string): + return '\n'.join(['# ' + line for line in string.split('\n')]) + +def gen_script(): + # Use the following instead of /usr/bin/env to read environment so we can + # deal with multi-line environment variables (and other odd cases). + env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable) + args = [BASH, '-c', env_reader] + output = subprocess.check_output(args, universal_newlines=True) + old_env = output.strip() + + pipe_r, pipe_w = os.pipe() + if sys.version_info >= (3, 4): + os.set_inheritable(pipe_w, True) + command = 'eval $1 && ({}; alias) >&{}'.format( + env_reader, + pipe_w + ) + args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])] + p = subprocess.Popen(args, universal_newlines=True, close_fds=False) + os.close(pipe_w) + with os.fdopen(pipe_r) as f: + new_env = f.readline() + alias_str = f.read() + if p.wait() != 0: + raise subprocess.CalledProcessError( + returncode=p.returncode, + cmd=' '.join(sys.argv[1:]), + output=new_env + alias_str + ) + new_env = new_env.strip() + + old_env = json.loads(old_env) + new_env = json.loads(new_env) + + script_lines = [] + + for k, v in new_env.items(): + if ignored(k): + continue + v1 = old_env.get(k) + if not v1: + script_lines.append(comment('adding %s=%s' % (k, v))) + elif v1 != v: + script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v))) + # process special variables + if k == 'PWD': + script_lines.append('cd %s' % escape(v)) + continue + else: + continue + if k == 'PATH': + value = ' '.join([escape(directory) + for directory in v.split(':')]) + else: + value = escape(v) + script_lines.append('set -g -x %s %s' % (k, value)) + + for var in set(old_env.keys()) - set(new_env.keys()): + script_lines.append(comment('removing %s' % var)) + script_lines.append('set -e %s' % var) + + script = '\n'.join(script_lines) + + alias_lines = [] + for line in alias_str.splitlines(): + _, rest = line.split(None, 1) + k, v = rest.split("=", 1) + alias_lines.append("alias " + escape_identifier(k) + "=" + v) + alias = '\n'.join(alias_lines) + + return script + '\n' + alias + +script_file = os.fdopen(3, 'w') + +if not sys.argv[1:]: + print('__bass_usage', file=script_file, end='') + sys.exit(0) + +try: + script = gen_script() +except subprocess.CalledProcessError as e: + sys.exit(e.returncode) +except Exception: + print('Bass internal error!', file=sys.stderr) + raise # traceback will output to stderr +except KeyboardInterrupt: + signal.signal(signal.SIGINT, signal.SIG_DFL) + os.kill(os.getpid(), signal.SIGINT) +else: + script_file.write(script) diff --git a/dot_config/private_fish/functions/_fzf_configure_bindings_help.fish b/dot_config/private_fish/functions/_fzf_configure_bindings_help.fish new file mode 100644 index 0000000..ecfe68e --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_configure_bindings_help.fish @@ -0,0 +1,43 @@ +function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings." + echo "\ +USAGE: + fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...] + +DESCRIPTION + fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it + previously installed. It installs bindings for both default and insert modes. fzf.fish executes + it without options on fish startup to install the out-of-the-box key bindings. + + By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding + can be configured using a namesake corresponding option: + COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION + Search Directory | Ctrl+Alt+F (F for file) | --directory + Search Git Log | Ctrl+Alt+L (L for log) | --git_log + Search Git Status | Ctrl+Alt+S (S for status) | --git_status + Search History | Ctrl+R (R for reverse) | --history + Search Processes | Ctrl+Alt+P (P for process) | --processes + Search Variables | Ctrl+V (V for variable) | --variables + Override a command's binding by specifying its corresponding option with the desired key + sequence. Disable a command's binding by specifying its corresponding option with no value. + + Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly + executed multiple times. Once the desired fzf_configure_bindings command has been found, add it + to your config.fish in order to persist the customized bindings. + + In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an + equals sign between an option's name and value. However, it does not validate key sequences. + + Pass -h or --help to print this help message and exit. + +EXAMPLES + Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V + \$ fzf_configure_bindings --directory=\cf --variables=\e\cv + Default bindings but disable Search History + \$ fzf_configure_bindings --history= + An agglomeration of different options + \$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes= + +SEE Also + To learn more about fish key bindings, see bind(1) and fish_key_reader(1). +" +end diff --git a/dot_config/private_fish/functions/_fzf_extract_var_info.fish b/dot_config/private_fish/functions/_fzf_extract_var_info.fish new file mode 100644 index 0000000..dd4e952 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_extract_var_info.fish @@ -0,0 +1,15 @@ +# helper function for _fzf_search_variables +function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output." + # Extract only the lines about the variable, all of which begin with either + # $variable_name: ...or... $variable_name[ + string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output | + + # Strip the variable name prefix, including ": " for scope info lines + string replace --regex "^\\\$$variable_name(?:: )?" '' | + + # Distill the lines of values, replacing... + # [1]: |value| + # ...with... + # [1] value + string replace --regex ": \|(.*)\|" ' $1' +end diff --git a/dot_config/private_fish/functions/_fzf_preview_changed_file.fish b/dot_config/private_fish/functions/_fzf_preview_changed_file.fish new file mode 100644 index 0000000..a13219b --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_preview_changed_file.fish @@ -0,0 +1,49 @@ +# helper for _fzf_search_git_status +# arg should be a line from git status --short, e.g. +# MM functions/_fzf_preview_changed_file.fish +# D README.md +# R LICENSE -> "New License" +function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file." + # remove quotes because they'll be interpreted literally by git diff + # no need to requote when referencing $path because fish does not perform word splitting + # https://fishshell.com/docs/current/fish_for_bash_users.html + set -l path (string unescape (string sub --start 4 $path_status)) + # first letter of short format shows index, second letter shows working tree + # https://git-scm.com/docs/git-status/2.35.0#_short_format + set -l index_status (string sub --length 1 $path_status) + set -l working_tree_status (string sub --start 2 --length 1 $path_status) + + set diff_opts --color=always + + if test $index_status = '?' + _fzf_report_diff_type Untracked + _fzf_preview_file $path + else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU + # Unmerged statuses taken directly from git status help's short format table + # Unmerged statuses are mutually exclusive with other statuses, so if we see + # these, then safe to assume the path is unmerged + _fzf_report_diff_type Unmerged + git diff $diff_opts -- $path + else + if test $index_status != ' ' + _fzf_report_diff_type Staged + + # renames are only detected in the index, never working tree, so only need to test for it here + # https://stackoverflow.com/questions/73954214 + if test $index_status = R + # diff the post-rename path with the original path, otherwise the diff will show the entire file as being added + set orig_and_new_path (string split --max 1 -- ' -> ' $path) + git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2] + # path currently has the form of "original -> current", so we need to correct it before it's used below + set path $orig_and_new_path[2] + else + git diff --staged $diff_opts -- $path + end + end + + if test $working_tree_status != ' ' + _fzf_report_diff_type Unstaged + git diff $diff_opts -- $path + end + end +end diff --git a/dot_config/private_fish/functions/_fzf_preview_file.fish b/dot_config/private_fish/functions/_fzf_preview_file.fish new file mode 100644 index 0000000..eaa68d0 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_preview_file.fish @@ -0,0 +1,43 @@ +# helper function for _fzf_search_directory and _fzf_search_git_status +function _fzf_preview_file --description "Print a preview for the given file based on its file type." + # because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file + # as one argument, we collect all the arguments into one single variable and treat that as the path + set file_path $argv + + if test -L "$file_path" # symlink + # notify user and recurse on the target of the symlink, which can be any of these file types + set -l target_path (realpath "$file_path") + + set_color yellow + echo "'$file_path' is a symlink to '$target_path'." + set_color normal + + _fzf_preview_file "$target_path" + else if test -f "$file_path" # regular file + if set --query fzf_preview_file_cmd + # need to escape quotes to make sure eval receives file_path as a single arg + eval "$fzf_preview_file_cmd '$file_path'" + else + bat --style=numbers --color=always "$file_path" + end + else if test -d "$file_path" # directory + if set --query fzf_preview_dir_cmd + # see above + eval "$fzf_preview_dir_cmd '$file_path'" + else + # -A list hidden files as well, except for . and .. + # -F helps classify files by appending symbols after the file name + command ls -A -F "$file_path" + end + else if test -c "$file_path" + _fzf_report_file_type "$file_path" "character device file" + else if test -b "$file_path" + _fzf_report_file_type "$file_path" "block device file" + else if test -S "$file_path" + _fzf_report_file_type "$file_path" socket + else if test -p "$file_path" + _fzf_report_file_type "$file_path" "named pipe" + else + echo "$file_path doesn't exist." >&2 + end +end diff --git a/dot_config/private_fish/functions/_fzf_report_diff_type.fish b/dot_config/private_fish/functions/_fzf_report_diff_type.fish new file mode 100644 index 0000000..3463c3f --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_report_diff_type.fish @@ -0,0 +1,18 @@ +# helper for _fzf_preview_changed_file +# prints out something like +# ╭────────╮ +# │ Staged │ +# ╰────────╯ +function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch." + # number of "-" to draw is the length of the string to box + 2 for padding + set repeat_count (math 2 + (string length $diff_type)) + set line (string repeat --count $repeat_count ─) + set top_border ╭$line╮ + set btm_border ╰$line╯ + + set_color yellow + echo $top_border + echo "│ $diff_type │" + echo $btm_border + set_color normal +end diff --git a/dot_config/private_fish/functions/_fzf_report_file_type.fish b/dot_config/private_fish/functions/_fzf_report_file_type.fish new file mode 100644 index 0000000..49e02e1 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_report_file_type.fish @@ -0,0 +1,6 @@ +# helper function for _fzf_preview_file +function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file." + set_color red + echo "Cannot preview '$file_path': it is a $file_type." + set_color normal +end diff --git a/dot_config/private_fish/functions/_fzf_search_directory.fish b/dot_config/private_fish/functions/_fzf_search_directory.fish new file mode 100644 index 0000000..15085be --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_directory.fish @@ -0,0 +1,34 @@ +function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths." + # Directly use fd binary to avoid output buffering delay caused by a fd alias, if any. + # Debian-based distros install fd as fdfind and the fd package is something else, so + # check for fdfind first. Fall back to "fd" for a clear error message. + set fd_cmd (command -v fdfind || command -v fd || echo "fd") + set --append fd_cmd --color=always $fzf_fd_opts + + # $fzf_dir_opts is the deprecated version of $fzf_directory_opts + set fzf_arguments --multi --ansi $fzf_dir_opts $fzf_directory_opts + set token (commandline --current-token) + # expand any variables or leading tilde (~) in the token + set expanded_token (eval echo -- $token) + # unescape token because it's already quoted so backslashes will mess up the path + set unescaped_exp_token (string unescape -- $expanded_token) + + # If the current token is a directory and has a trailing slash, + # then use it as fd's base directory. + if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token" + set --append fd_cmd --base-directory=$unescaped_exp_token + # use the directory name as fzf's prompt to indicate the search is limited to that directory + set --prepend fzf_arguments --prompt="Search Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}" + set file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) + else + set --prepend fzf_arguments --prompt="Search Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}' + set file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) + end + + + if test $status -eq 0 + commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ') + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_search_git_log.fish b/dot_config/private_fish/functions/_fzf_search_git_log.fish new file mode 100644 index 0000000..a158b02 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_git_log.fish @@ -0,0 +1,30 @@ +function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_log: Not in a git repository.' >&2 + else + if not set --query fzf_git_log_format + # %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below + set fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)' + end + set selected_log_lines ( + git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \ + _fzf_wrapper --ansi \ + --multi \ + --tiebreak=index \ + --prompt="Search Git Log> " \ + --preview='git show --color=always --stat --patch {1}' \ + --query=(commandline --current-token) \ + $fzf_git_log_opts + ) + if test $status -eq 0 + for line in $selected_log_lines + set abbreviated_commit_hash (string split --field 1 " " $line) + set full_commit_hash (git rev-parse $abbreviated_commit_hash) + set --append commit_hashes $full_commit_hash + end + commandline --current-token --replace (string join ' ' $commit_hashes) + end + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_search_git_status.fish b/dot_config/private_fish/functions/_fzf_search_git_status.fish new file mode 100644 index 0000000..9e51453 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_git_status.fish @@ -0,0 +1,36 @@ +function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths." + if not git rev-parse --git-dir >/dev/null 2>&1 + echo '_fzf_search_git_status: Not in a git repository.' >&2 + else + set selected_paths ( + # Pass configuration color.status=always to force status to use colors even though output is sent to a pipe + git -c color.status=always status --short | + _fzf_wrapper --ansi \ + --multi \ + --prompt="Search Git Status> " \ + --query=(commandline --current-token) \ + --preview='_fzf_preview_changed_file {}' \ + --nth="2.." \ + $fzf_git_status_opts + ) + if test $status -eq 0 + # git status --short automatically escapes the paths of most files for us so not going to bother trying to handle + # the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping") + set cleaned_paths + + for path in $selected_paths + if test (string sub --length 1 $path) = R + # path has been renamed and looks like "R LICENSE -> LICENSE.md" + # extract the path to use from after the arrow + set --append cleaned_paths (string split -- "-> " $path)[-1] + else + set --append cleaned_paths (string sub --start=4 $path) + end + end + + commandline --current-token --replace -- (string join ' ' $cleaned_paths) + end + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_search_history.fish b/dot_config/private_fish/functions/_fzf_search_history.fish new file mode 100644 index 0000000..27cf4f1 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_history.fish @@ -0,0 +1,31 @@ +function _fzf_search_history --description "Search command history. Replace the command line with the selected command." + # history merge incorporates history changes from other fish sessions + # it errors out if called in private mode + if test -z "$fish_private_mode" + builtin history merge + end + + # Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line + set commands_selected ( + # Reference https://devhints.io/strftime to understand strftime format symbols + builtin history --null --show-time="%m-%d %H:%M:%S │ " | + _fzf_wrapper --read0 \ + --print0 \ + --multi \ + --tiebreak=index \ + --prompt="Search History> " \ + --query=(commandline) \ + --preview="echo -- {4..} | fish_indent --ansi" \ + --preview-window="bottom:3:wrap" \ + $fzf_history_opts | + string split0 | + # remove timestamps from commands selected + string replace --regex '^\d\d-\d\d \d\d:\d\d:\d\d │ ' '' + ) + + if test $status -eq 0 + commandline --replace -- $commands_selected + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_search_processes.fish b/dot_config/private_fish/functions/_fzf_search_processes.fish new file mode 100644 index 0000000..9424aad --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_processes.fish @@ -0,0 +1,29 @@ +function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process." + # use all caps to be consistent with ps default format + # snake_case because ps doesn't seem to allow spaces in the field names + set ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command') + set processes_selected ( + ps -A -opid,command | \ + _fzf_wrapper --multi \ + --prompt="Search Processes> " \ + --query (commandline --current-token) \ + --ansi \ + # first line outputted by ps is a header, so we need to mark it as so + --header-lines=1 \ + # ps uses exit code 1 if the process was not found, in which case show an message explaining so + --preview="ps -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \ + --preview-window="bottom:4:wrap" \ + $fzf_processes_opts + ) + + if test $status -eq 0 + for process in $processes_selected + set --append pids_selected (string split --no-empty --field=1 -- " " $process) + end + + # string join to replace the newlines outputted by string split with spaces + commandline --current-token --replace -- (string join ' ' $pids_selected) + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_search_variables.fish b/dot_config/private_fish/functions/_fzf_search_variables.fish new file mode 100644 index 0000000..eda2453 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_search_variables.fish @@ -0,0 +1,48 @@ +# This function expects the following two arguments: +# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables +# argument 2 = output of (set --names | psub), i.e. a file with all variable names +function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable." + if test -z "$set_names_output" + printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2 + + commandline --function repaint + return 22 # 22 means invalid argument in POSIX + end + + # Exclude the history variable from being piped into fzf because + # 1. it's not included in $set_names_output + # 2. it tends to be a very large value => increases computation time + # 3._fzf_search_history is a much better way to examine history anyway + set all_variable_names (string match --invert history <$set_names_output) + + set current_token (commandline --current-token) + # Use the current token to pre-populate fzf's query. If the current token begins + # with a $, remove it from the query so that it will better match the variable names + set cleaned_curr_token (string replace -- '$' '' $current_token) + + set variable_names_selected ( + printf '%s\n' $all_variable_names | + _fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \ + --prompt="Search Variables> " \ + --preview-window="wrap" \ + --multi \ + --query=$cleaned_curr_token \ + # $fzf_shell_vars_opts is the deprecated version of $fzf_variables_opts + $fzf_shell_vars_opts $fzf_variables_opts + ) + + if test $status -eq 0 + # If the current token begins with a $, do not overwrite the $ when + # replacing the current token with the selected variable. + # Uses brace expansion to prepend $ to each variable name. + commandline --current-token --replace ( + if string match --quiet -- '$*' $current_token + string join " " \${$variable_names_selected} + else + string join " " $variable_names_selected + end + ) + end + + commandline --function repaint +end diff --git a/dot_config/private_fish/functions/_fzf_wrapper.fish b/dot_config/private_fish/functions/_fzf_wrapper.fish new file mode 100644 index 0000000..a928701 --- /dev/null +++ b/dot_config/private_fish/functions/_fzf_wrapper.fish @@ -0,0 +1,20 @@ +function _fzf_wrapper --description "Prepares some environment variables before executing fzf." + # Make sure fzf uses fish to execute preview commands, some of which + # are autoloaded fish functions so don't exist in other shells. + # Use --local so that it doesn't clobber SHELL outside of this function. + set --local --export SHELL (command --search fish) + + # If FZF_DEFAULT_OPTS is not set, then set some sane defaults. + # See https://github.com/junegunn/fzf#environment-variables + if not set --query FZF_DEFAULT_OPTS + # cycle allows jumping between the first and last results, making scrolling faster + # layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env + # border shows where the fzf window begins and ends + # height=90% leaves space to see the current command and some scrollback, maintaining context of work + # preview-window=wrap wraps long lines in the preview window, making reading easier + # marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >) + set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"' + end + + fzf $argv +end diff --git a/dot_config/private_fish/functions/bass.fish b/dot_config/private_fish/functions/bass.fish new file mode 100644 index 0000000..2b3af16 --- /dev/null +++ b/dot_config/private_fish/functions/bass.fish @@ -0,0 +1,29 @@ +function bass + set -l bash_args $argv + set -l bass_debug + if test "$bash_args[1]_" = '-d_' + set bass_debug true + set -e bash_args[1] + end + + set -l script_file (mktemp) + if command -v python3 >/dev/null 2>&1 + command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + else + command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + end + set -l bass_status $status + if test $bass_status -ne 0 + return $bass_status + end + + if test -n "$bass_debug" + cat $script_file + end + source $script_file + command rm $script_file +end + +function __bass_usage + echo "Usage: bass [-d] " +end diff --git a/dot_config/private_fish/functions/fish_user_key_bindings.fish b/dot_config/private_fish/functions/fish_user_key_bindings.fish new file mode 100644 index 0000000..a454589 --- /dev/null +++ b/dot_config/private_fish/functions/fish_user_key_bindings.fish @@ -0,0 +1,3 @@ +function fish_user_key_bindings + fzf_key_bindings +end \ No newline at end of file diff --git a/dot_config/private_fish/functions/fzf_configure_bindings.fish b/dot_config/private_fish/functions/fzf_configure_bindings.fish new file mode 100644 index 0000000..ec24f73 --- /dev/null +++ b/dot_config/private_fish/functions/fzf_configure_bindings.fish @@ -0,0 +1,46 @@ +# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect +# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1 +function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options." + # no need to install bindings if not in interactive mode or running tests + status is-interactive || test "$CI" = true; or return + + set options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?' + argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null + if test $status -ne 0 + echo "Invalid option or a positional argument was provided." >&2 + _fzf_configure_bindings_help + return 22 + else if set --query _flag_help + _fzf_configure_bindings_help + return + else + # Initialize with default key sequences and then override or disable them based on flags + # index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables + set key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape + set --query _flag_directory && set key_sequences[1] "$_flag_directory" + set --query _flag_git_log && set key_sequences[2] "$_flag_git_log" + set --query _flag_git_status && set key_sequences[3] "$_flag_git_status" + set --query _flag_history && set key_sequences[4] "$_flag_history" + set --query _flag_processes && set key_sequences[5] "$_flag_processes" + set --query _flag_variables && set key_sequences[6] "$_flag_variables" + + # If fzf bindings already exists, uninstall it first for a clean slate + if functions --query _fzf_uninstall_bindings + _fzf_uninstall_bindings + end + + for mode in default insert + test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory + test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log + test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status + test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history + test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes + test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command" + end + + function _fzf_uninstall_bindings --inherit-variable key_sequences + bind --erase -- $key_sequences + bind --erase --mode insert -- $key_sequences + end + end +end diff --git a/dot_config/private_fish/functions/man.fish b/dot_config/private_fish/functions/man.fish new file mode 100644 index 0000000..3fbfa69 --- /dev/null +++ b/dot_config/private_fish/functions/man.fish @@ -0,0 +1,41 @@ +function man --wraps man --description 'Format and display manual pages' + set -q man_blink; and set -l blink (set_color $man_blink); or set -l blink (set_color -o red) + set -q man_bold; and set -l bold (set_color $man_bold); or set -l bold (set_color -o 5fafd7) + set -q man_standout; and set -l standout (set_color $man_standout); or set -l standout (set_color 949494) + set -q man_underline; and set -l underline (set_color $man_underline); or set -l underline (set_color -u afafd7) + + set -l end (printf "\e[0m") + + set -lx LESS_TERMCAP_mb $blink + set -lx LESS_TERMCAP_md $bold + set -lx LESS_TERMCAP_me $end + set -lx LESS_TERMCAP_so $standout + set -lx LESS_TERMCAP_se $end + set -lx LESS_TERMCAP_us $underline + set -lx LESS_TERMCAP_ue $end + set -lx LESS '-R -s' + + set -lx GROFF_NO_SGR yes # fedora + + set -lx MANPATH (string join : $MANPATH) + if test -z "$MANPATH" + type -q manpath + and set MANPATH (command manpath) + end + + # Check data dir for Fish 2.x compatibility + set -l fish_data_dir + if set -q __fish_data_dir + set fish_data_dir $__fish_data_dir + else + set fish_data_dir $__fish_datadir + end + + set -l fish_manpath (dirname $fish_data_dir)/fish/man + if test -d "$fish_manpath" -a -n "$MANPATH" + set MANPATH "$fish_manpath":$MANPATH + command man $argv + return + end + command man $argv +end diff --git a/dot_config/private_fish/functions/n.fish b/dot_config/private_fish/functions/n.fish new file mode 100644 index 0000000..a8c3dc4 --- /dev/null +++ b/dot_config/private_fish/functions/n.fish @@ -0,0 +1,36 @@ +# Rename this file to match the name of the function +# e.g. ~/.config/fish/functions/n.fish +# or, add the lines to the 'config.fish' file. + +function n --wraps nnn --description 'support nnn quit and change directory' + # Block nesting of nnn in subshells + if test -n "$NNNLVL" -a "$NNNLVL" -ge 1 + echo "nnn is already running" + return + end + + # The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set) + # If NNN_TMPFILE is set to a custom path, it must be exported for nnn to + # see. To cd on quit only on ^G, remove the "-x" from both lines below, + # without changing the paths. + if test -n "$XDG_CONFIG_HOME" + set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd" + else + set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd" + end + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + # The command function allows one to alias this function to `nnn` without + # making an infinitely recursive alias + command nnn $argv + + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end +end diff --git a/dot_config/private_fish/functions/nvm.fish b/dot_config/private_fish/functions/nvm.fish new file mode 100644 index 0000000..c5480e6 --- /dev/null +++ b/dot_config/private_fish/functions/nvm.fish @@ -0,0 +1,53 @@ +function nvm-fast + set -q NVM_DIR ; or set -l NVM_DIR ~/.nvm + set -l brigand_nvm_fish_path $NVM_DIR/versions/node + if test (count $argv[1]) -lt 1 + echo 'nvm-fast: at least one argument is required' + end + + set -l command $argv[1] + if test $command = 'use' + set target_version "unknown" + if test (count $argv) -eq 1 + if test -f .nvmrc + set target_version (cat .nvmrc) + else + echo "Error: No version provided and no .nvmrc found" + return + end + else + set target_version $argv[2] + end + set -l target_version $target_version + + set -l matched_version (bash -c "source $NVM_DIR/nvm.sh --no-use; nvm_version $target_version") + + if test -z $matched_version -o $matched_version = 'N/A' + echo "No version installed for $target_version, run nvm install $target_version" + echo "Installed versions: " + for file in $brigand_nvm_fish_path/v* + echo ' -' $file + end + else + set -l new_path (string match -ev "$brigand_nvm_fish_path" $PATH) + if test $matched_version != 'system' + set new_path $brigand_nvm_fish_path/$matched_version/bin $new_path + end + set -gx PATH $new_path + set -gx NVM_BIN (which node) + end + else + bash -c "source $NVM_DIR/nvm.sh --no-use; nvm $argv" + set -gx NVM_BIN (which node) + end +end + +function nvm + switch "$FISH_VERSION" + case 2.0.0 2.1.0 2.1.1 2.1.2 2.2.0 2.2b1 2.3.0 2.3.1 2.3b1 2.3b2 2.4.0 2.4b1 2.5.0 2.5b1 + echo "You need fish 2.6.0 or higher to use fast-nvm-fish." 1>&2 + return 1 + end + nvm-fast $argv +end + diff --git a/dot_config/private_fish/functions/su.fish b/dot_config/private_fish/functions/su.fish new file mode 100644 index 0000000..a9f271f --- /dev/null +++ b/dot_config/private_fish/functions/su.fish @@ -0,0 +1,3 @@ +function su + command su --shell=/usr/bin/fish $argv +end diff --git a/dot_config/private_fish/functions/symlink_fish_prompt.fish b/dot_config/private_fish/functions/symlink_fish_prompt.fish new file mode 100644 index 0000000..3745694 --- /dev/null +++ b/dot_config/private_fish/functions/symlink_fish_prompt.fish @@ -0,0 +1 @@ +/home/eric/.local/share/omf/themes/boxfish/fish_prompt.fish diff --git a/dot_config/private_fish/functions/symlink_fish_prompt.old.fish b/dot_config/private_fish/functions/symlink_fish_prompt.old.fish new file mode 100644 index 0000000..3745694 --- /dev/null +++ b/dot_config/private_fish/functions/symlink_fish_prompt.old.fish @@ -0,0 +1 @@ +/home/eric/.local/share/omf/themes/boxfish/fish_prompt.fish diff --git a/dot_config/private_fish/functions/symlink_triton.fish b/dot_config/private_fish/functions/symlink_triton.fish new file mode 100644 index 0000000..48cd8fb --- /dev/null +++ b/dot_config/private_fish/functions/symlink_triton.fish @@ -0,0 +1 @@ +/home/eric/.config/fish/triton/github.com/dukejones/triton/functions/triton.fish diff --git a/dot_config/private_fish/themes/Catppuccin Frappe.theme b/dot_config/private_fish/themes/Catppuccin Frappe.theme new file mode 100644 index 0000000..3181fe3 --- /dev/null +++ b/dot_config/private_fish/themes/Catppuccin Frappe.theme @@ -0,0 +1,26 @@ +# name: 'Catppuccin frappe' +# url: 'https://github.com/catppuccin/fish' +# preferred_background: 303446 + +fish_color_normal c6d0f5 +fish_color_command 8caaee +fish_color_param eebebe +fish_color_keyword e78284 +fish_color_quote a6d189 +fish_color_redirection f4b8e4 +fish_color_end ef9f76 +fish_color_error e78284 +fish_color_gray 737994 +fish_color_selection --background=414559 +fish_color_search_match --background=414559 +fish_color_operator f4b8e4 +ish_color_escape eebebe +fish_color_autosuggestion 737994 +fish_color_cancel e78284 +fish_color_cwd e5c890 +fish_color_user 81c8be +fish_color_host 8caaee +fish_pager_color_progress 737994 +fish_pager_color_prefix f4b8e4 +fish_pager_color_completion c6d0f5 +fish_pager_color_description 737994 diff --git a/dot_config/private_fish/themes/Catppuccin Latte.theme b/dot_config/private_fish/themes/Catppuccin Latte.theme new file mode 100644 index 0000000..ba6ea63 --- /dev/null +++ b/dot_config/private_fish/themes/Catppuccin Latte.theme @@ -0,0 +1,26 @@ +# name: 'Catppuccin latte' +# url: 'https://github.com/catppuccin/fish' +# preferred_background: eff1f5 + +fish_color_normal 4c4f69 +fish_color_command 1e66f5 +fish_color_param dd7878 +fish_color_keyword d20f39 +fish_color_quote 40a02b +fish_color_redirection ea76cb +fish_color_end fe640b +fish_color_error d20f39 +fish_color_gray 9ca0b0 +fish_color_selection --background=ccd0da +fish_color_search_match --background=ccd0da +fish_color_operator ea76cb +fish_color_escape dd7878 +fish_color_autosuggestion 9ca0b0 +fish_color_cancel d20f39 +fish_color_cwd df8e1d +fish_color_user 179299 +fish_color_host 1e66f5 +fish_pager_color_progress 9ca0b0 +fish_pager_color_prefix ea76cb +fish_pager_color_completion 4c4f69 +fish_pager_color_description 9ca0b0 diff --git a/dot_config/private_fish/themes/Catppuccin Macchiato.theme b/dot_config/private_fish/themes/Catppuccin Macchiato.theme new file mode 100644 index 0000000..890c69a --- /dev/null +++ b/dot_config/private_fish/themes/Catppuccin Macchiato.theme @@ -0,0 +1,26 @@ +# name: 'Catppuccin macchiato' +# url: 'https://github.com/catppuccin/fish' +# preferred_background: 24273a + +fish_color_normal cad3f5 +fish_color_command 8aadf4 +fish_color_param f0c6c6 +fish_color_keyword ed8796 +fish_color_quote a6da95 +fish_color_redirection f5bde6 +fish_color_end f5a97f +fish_color_error ed8796 +fish_color_gray 6e738d +fish_color_selection --background=363a4f +fish_color_search_match --background=363a4f +fish_color_operator f5bde6 +fish_color_escape f0c6c6 +fish_color_autosuggestion 6e738d +fish_color_cancel ed8796 +fish_color_cwd eed49f +fish_color_user 8bd5ca +fish_color_host 8aadf4 +fish_pager_color_progress 6e738d +fish_pager_color_prefix f5bde6 +fish_pager_color_completion cad3f5 +fish_pager_color_description 6e738d diff --git a/dot_config/private_fish/themes/Catppuccin Mocha.theme b/dot_config/private_fish/themes/Catppuccin Mocha.theme new file mode 100644 index 0000000..9bea4af --- /dev/null +++ b/dot_config/private_fish/themes/Catppuccin Mocha.theme @@ -0,0 +1,26 @@ +# name: 'Catppuccin mocha' +# url: 'https://github.com/catppuccin/fish' +# preferred_background: 1e1e2e + +fish_color_normal cdd6f4 +fish_color_command 89b4fa +fish_color_param f2cdcd +fish_color_keyword f38ba8 +fish_color_quote a6e3a1 +fish_color_redirection f5c2e7 +fish_color_end fab387 +fish_color_error f38ba8 +fish_color_gray 6c7086 +fish_color_selection --background=313244 +fish_color_search_match --background=313244 +fish_color_operator f5c2e7 +fish_color_escape f2cdcd +fish_color_autosuggestion 6c7086 +fish_color_cancel f38ba8 +fish_color_cwd f9e2af +fish_color_user 94e2d5 +fish_color_host 89b4fa +fish_pager_color_progress 6c7086 +fish_pager_color_prefix f5c2e7 +fish_pager_color_completion cdd6f4 +fish_pager_color_description 6c7086 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/LICENSE b/dot_config/private_fish/triton/github.com/dukejones/triton/LICENSE new file mode 100644 index 0000000..4d91e60 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Duke Jones + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/README.md b/dot_config/private_fish/triton/github.com/dukejones/triton/README.md new file mode 100644 index 0000000..bf634ce --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/README.md @@ -0,0 +1,82 @@ +# Install # +Installation Script: + +`wget -qO- https://git.io/fp7xA | fish` + +## Quickstart ## + +```bash +wget -qO- https://git.io/fp7xA | fish +triton bootstrap +nano ~/.config/fish/config.fish +``` + +Each package is a single line in config.fish which can be commented or edited. When you fire up your shell it simply loads whatever you tell it to. + +Optionally clean up your config.fish by adding packages in ~/.config/fish/fishfile. + +It supports github libraries only for now. + +e.g. for https://github.com/joehillen/to-fish chop the first part off and write `triton joehillen/to-fish`. + +## Usage ## +`triton` : Initialize Triton. This initializes triton, and loads or installs all of the libraries listed in your fishfile. + +`triton bootstrap` : Copy the included configuration file templates into the config directory. + +`triton [repo/lib]` : Load or install the specified library. e.g. `triton joehillen/to-fish` is at https://github.com/joehillen/to-fish + +`triton fishfile [file]` : Load/install all of the libraries in the given fishfile. + +## What Does It Do? ## + +You give triton just about any repository that is meant to be a fish plugin, and it will install it. If it's already installed in triton's plugin installation directory, it will load it. + +The end result is a nice list of all of installed packages in config.fish and fishfile, not a confusing pile of symlinks or a maze of deeply nested calls across multiple directories. Everything is in `~/.config/fish/`, and everything triton is in the `triton` subdirectory. + +## Great Packages ## + +We suggest putting themes in config.fish to be able to comment them out at will, but reference them later. +Libraries that are must-haves and always givens can go into `Fishfile`. + +```bash +# Some suggestions for your config.fish: + +# triton oh-my-fish/theme-bobthefish +triton oh-my-fish/theme-agnoster +# triton oh-my-fish/theme-es +# triton jorgebucaran/fish-sol +# triton jorgebucaran/fish-sektor + +triton joehillen/to-fish # Fish shell directory bookmarks +triton oh-my-fish/plugin-spark +triton oh-my-fish/plugin-node-binpath + +# this requires the fzf binary installed +triton jethrokuan/fzf +# And this requires The Silver Searcher binary `ag`. +set -U FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git" +set -U FZF_ENABLE_OPEN_PREVIEW 1 +``` + +And here is my fishfile: +```bash +edc/bass +joehillen/to-fish +jethrokuan/z +``` + +### Other Package Lists ### +* [Awesome Fish](https://github.com/jorgebucaran/awesome-fish) + +## Origin Story ## + +One day I was searching for a setting in a Fish plugin that was causing a problem, but when I started looking through my Fish config, I became lost in a dense and impenetrable forest of references. I couldn't find where the actual library files lived. Was it symlinked from fisherman? Was it in one of oh-my-fish's numerous special directories? How was it even being loaded?! What was being loaded?!! Functions, or conf.d.... I had to read through the source code of oh-my-fish to figure out what the heck was going on. It was almost enough to send me back to Zsh, again. + +But recall that Fish has an actual scripting language that makes sense. And so, armed with that and a few design principles I set out to make something discoverable, explicit, and magical enough to surprise and delight. Please enjoy and drop me a line if you like it or have feedback. + +Inspirations include: antigen.zsh, Vim+Pathogen. + + +# Triton # +![Triton](https://greekgodsandgoddesses.net/wp-content/uploads/2017/02/triton-1024x885.jpg "Triton") diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/FETCH_HEAD b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/FETCH_HEAD new file mode 100644 index 0000000..96212e7 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/FETCH_HEAD @@ -0,0 +1 @@ +fc3620321f9c2dbaef0885daafc4aa464ef502d0 branch 'master' of https://github.com/dukejones/triton diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/HEAD b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/branches/.keep b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/branches/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/config b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/config new file mode 100644 index 0000000..749928b --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/config @@ -0,0 +1,11 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = https://github.com/dukejones/triton.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/description b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_applypatch-msg.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_commit-msg.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_fsmonitor-watchman.sample new file mode 100644 index 0000000..23e856f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_post-update.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-applypatch.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-commit.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-commit.sample new file mode 100644 index 0000000..e144712 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-merge-commit.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-push.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-rebase.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-receive.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_push-to-checkout.sample b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/hooks/executable_push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/index b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/index new file mode 100644 index 0000000..cdfba7e Binary files /dev/null and b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/index differ diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/info/exclude b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/HEAD b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/HEAD new file mode 100644 index 0000000..c5f4473 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 fc3620321f9c2dbaef0885daafc4aa464ef502d0 Hydroxycarbamide 1682119744 +0200 clone: from https://github.com/dukejones/triton.git diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/heads/master b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/heads/master new file mode 100644 index 0000000..c5f4473 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 fc3620321f9c2dbaef0885daafc4aa464ef502d0 Hydroxycarbamide 1682119744 +0200 clone: from https://github.com/dukejones/triton.git diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/remotes/origin/HEAD new file mode 100644 index 0000000..c5f4473 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 fc3620321f9c2dbaef0885daafc4aa464ef502d0 Hydroxycarbamide 1682119744 +0200 clone: from https://github.com/dukejones/triton.git diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/info/.keep b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/info/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.idx b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.idx new file mode 100644 index 0000000..d73e1e9 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.idx differ diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.pack b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.pack new file mode 100644 index 0000000..e7d50b1 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/objects/pack/readonly_pack-3fc5d7e7226ca384048adfb4f34689b59079a6cc.pack differ diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/packed-refs b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/packed-refs new file mode 100644 index 0000000..2a86707 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled sorted +fc3620321f9c2dbaef0885daafc4aa464ef502d0 refs/remotes/origin/master diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/heads/master b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/heads/master new file mode 100644 index 0000000..9777094 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/heads/master @@ -0,0 +1 @@ +fc3620321f9c2dbaef0885daafc4aa464ef502d0 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/remotes/origin/HEAD new file mode 100644 index 0000000..6efe28f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/tags/.keep b/dot_config/private_fish/triton/github.com/dukejones/triton/dot_git/refs/tags/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/executable_install b/dot_config/private_fish/triton/github.com/dukejones/triton/executable_install new file mode 100644 index 0000000..3ee7e41 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/executable_install @@ -0,0 +1,25 @@ +#!/usr/bin/env fish + +if [ ! (which git) ] + echo "`git` is required for installation. Please try again after installing an accessible git binary." + exit 1 +end + +set -q XDG_CONFIG_HOME + and set FISH_PATH "$XDG_CONFIG_HOME/fish" + or set FISH_PATH "$HOME/.config/fish" + +[ -d "$FISH_PATH/triton/github.com/dukejones/triton" ] + or git clone https://github.com/dukejones/triton.git "$FISH_PATH/triton/github.com/dukejones/triton" + +mkdir -p "$FISH_PATH/functions" +[ -f "$FISH_PATH/functions/triton.fish" ] + or ln -s "$FISH_PATH/triton/github.com/dukejones/triton/functions/triton.fish" "$FISH_PATH/functions/" + +exec fish + +echo "Welcome to Triton! To bootstrap a nice set of default fish configuration files you may wish to run:" +echo +echo "triton bootstrap" +echo +echo "Triton: calling forth packages from the primordial ocean of the internet for ultimate shell happiness. 👑" diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/functions/triton.fish b/dot_config/private_fish/triton/github.com/dukejones/triton/functions/triton.fish new file mode 100644 index 0000000..2f82b98 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/functions/triton.fish @@ -0,0 +1,161 @@ + +function triton + [ -z "$TRITON_PATH" ]; and set -l do_init true + + set -q XDG_CONFIG_HOME + and set -gx TRITON_PATH "$XDG_CONFIG_HOME/fish/triton" + or set -gx TRITON_PATH "$HOME/.config/fish/triton" + + test -d $TRITON_PATH; or mkdir -p $TRITON_PATH + + if [ -n "$do_init" -a "$argv[1]" != "init" ] + triton init + end + + switch "$argv[1]" + case "" + [ -n "$do_init" ]; and return # if first initialization, don't show usage. + # TODO: all this as completions + echo "Usage: find some libraries. Load 'em up" + echo "triton init" + echo "triton list" + echo "triton update" + echo "triton fishfile " + echo "triton bootstrap" + case "init" + __triton_load_fishfile $TRITON_PATH/../fishfile + case "list" + __triton_list $argv + case "update" + __triton_update $argv + case "fishfile" + __triton_load_fishfile $argv + case "bootstrap" + __triton_bootstrap_template $argv + case "*" + __triton_main $argv + end +end + +function __triton_main -a library + contains $library $__triton_libs + and return + + set lib_path (realpath $TRITON_PATH/github.com/$library 2> /dev/null ) + # TODO: if it includes a domain, use it. [non-github are people too] + + if [ ! -d "$lib_path" ] + __triton_run_cmd \ + "git clone -q https://github.com/$library $TRITON_PATH/github.com/$library" \ + "Triton: Installing '$library'. 💾" + if [ -f "$lib_path/.gitmodules" ] + set -l prev_dir $PWD + cd $lib_path + git rev-parse --show-toplevel + __triton_run_cmd \ + "git submodule update --init" \ + "Installing git submodules." + cd $prev_dir + end + # test -f $lib_path/hooks/install.fish ; and source $lib_path/hooks/install.fish + end + + if [ -f "$lib_path/fishfile" ] + __triton_load_fishfile $lib_path/fishfile + end + [ -f "$lib_path/before.init.fish" ]; and source $lib_path/before.init.fish + [ -d "$lib_path/functions" ] + and not contains "$lib_path/functions" $fish_function_path + and set fish_function_path $fish_function_path[1] \ + $lib_path/functions \ + $fish_function_path[2..-1] + [ -d "$lib_path/completions" ] + and not contains "$lib_path/completions" $fish_complete_path + and set fish_complete_path $fish_complete_path[1] \ + $lib_path/completions \ + $fish_complete_path[2..-1] + if [ (count $lib_path/conf.d/*.fish) -gt 0 ] + for file in $lib_path/conf.d/*.fish + source $file + end + end + if [ (count $lib_path/*.fish) -gt 0 ] + source $lib_path/*.fish + + contains $lib_path $fish_function_path + or set fish_function_path $fish_function_path[1] \ + $lib_path \ + $fish_function_path[2..-1] + end + contains $library $__triton_libs + or set -g __triton_libs $__triton_libs $library +end + +function __triton_load_fishfile -a fishfile + [ -f "$fishfile" ] ; or return + for lib in (cat $fishfile) + triton $lib + end +end + +function __triton_update + set -l triton_lib_path $TRITON_PATH/github.com/dukejones/triton + echo (set_color green)"Updating triton lib in path $triton_lib_path"(set_color normal) + pushd . + cd $triton_lib_path + + git fetch + if git status | grep "is up to date" > /dev/null + echo (set_color green)Your Triton install is already up to date!(set_color normal) + return + end + + + if not git status | grep "working tree clean" > /dev/null + echo (set_color yellow)"Stashing changes, merging latest, and applying stashed changes."(set_color normal) + git stash + git merge origin/master + git stash apply + else + echo (set_color yellow)"Merging the latest code."(set_color normal) + git merge origin/master + end + popd + echo (set_color green)Done!(set_color normal) +end + +function __triton_list + echo (set_color yellow)Installed Fish Plugins(set_color green) 💾 + for l in $__triton_libs + echo " $l" + end + echo (set_color yellow)A few places to look for more(set_color blue) 🛒 + echo " https://github.com/topics/fish-plugin" + echo " https://github.com/topics/fish-plugins" + echo " https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md" + set_color normal +end + +function __triton_run_cmd -a cmd msg -d "Display the message & run the cmd, displaying it in nice colors." + [ -n "$msg" ]; and echo (set_color yellow)$msg + echo (set_color blue)"> $cmd" + eval $cmd +end + +function __triton_bootstrap_template + echo (set_color -r -o green)"Bootstrapping fish config files."(set_color normal) + triton dukejones/triton # so meta + set FISH_PATH (realpath "$TRITON_PATH/..") + for file in {config.fish,fishfile,conf.d/aliases.fish} + if not test -f $FISH_PATH/$file + echo (set_color green)"[adding]"(set_color normal) "$FISH_PATH/$file" + mkdir -p (dirname "$FISH_PATH/$file") + cp $TRITON_PATH/github.com/dukejones/triton/template/$file $FISH_PATH/$file + else + echo (set_color yellow)"[exists]"(set_color normal) "$FISH_PATH/$file" + end + end + exec fish + echo (set_color -o green)Complete!(set_color normal) + # source $FISH_PATH/config.fish +end diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/aliases.fish b/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/aliases.fish new file mode 100644 index 0000000..571fc78 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/aliases.fish @@ -0,0 +1,5 @@ + +# alias g="git" +# alias gpr="git pull -r" + +# alias dns="dscacheutil -flushcache; sudo killall -HUP mDNSResponder" diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/fzf.fish b/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/fzf.fish new file mode 100644 index 0000000..c598d5d --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/template/conf.d/fzf.fish @@ -0,0 +1,11 @@ +# Completion / FZF # +# FZF is the Ctrl+R solution you've been looking for. +# `brew install fzf` or `apt install fzf` +# https://github.com/jethrokuan/fzf + +# triton jethrokuan/fzf +# set -g FZF_COMPLETE 2 +# set -g FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git" +# set -g FZF_DEFAULT_OPTS "--height 40% --layout=reverse --border" +# set -g FZF_LEGACY_KEYBINDINGS 0 +# set -g FZF_ENABLE_OPEN_PREVIEW 1 diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/template/config.fish b/dot_config/private_fish/triton/github.com/dukejones/triton/template/config.fish new file mode 100644 index 0000000..cf4f71a --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/template/config.fish @@ -0,0 +1,31 @@ +### INIT ### +triton init +# fish_vi_key_bindings + +### THEMES ### + +triton oh-my-fish/theme-bobthefish +set -g theme_powerline_fonts no # Go ahead and turn this on when you get a powerline font! +set -g theme_nerd_fonts no # And nerd fonts for the ultimate in nerdy goodness. + +# Powerline Themes # +# triton oh-my-fish/theme-agnoster +# triton oh-my-fish/theme-es +# triton jorgebucaran/fish-sol +# triton jorgebucaran/fish-sektor + +### PACKAGES ### +triton joehillen/to-fish # Fish shell directory bookmarks + +triton oh-my-fish/plugin-node-binpath +triton kennethreitz/fish-pipenv +set -gx VIRTUAL_ENV_DISABLE_PROMPT yes + + +### CUSTOMIZATION ### +# function fish_greeting +# figlet -w 250 Fortune Favors the Bold +# end + +### ENVIRONMENT ### +set -g EDITOR vim diff --git a/dot_config/private_fish/triton/github.com/dukejones/triton/template/fishfile b/dot_config/private_fish/triton/github.com/dukejones/triton/template/fishfile new file mode 100644 index 0000000..379794f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/dukejones/triton/template/fishfile @@ -0,0 +1 @@ +edc/bass diff --git a/dot_config/private_fish/triton/github.com/edc/bass/LICENSE b/dot_config/private_fish/triton/github.com/edc/bass/LICENSE new file mode 100644 index 0000000..bf7a119 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Eddie Cao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dot_config/private_fish/triton/github.com/edc/bass/Makefile b/dot_config/private_fish/triton/github.com/edc/bass/Makefile new file mode 100644 index 0000000..1bb29c2 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/Makefile @@ -0,0 +1,19 @@ +all: + @echo "Run 'make install' to deploy bass to your function directory." + +install: + install -d ~/.config/fish/functions + install functions/__bass.py ~/.config/fish/functions + install functions/bass.fish ~/.config/fish/functions + +uninstall: + rm -f ~/.config/fish/functions/__bass.py + rm -f ~/.config/fish/functions/bass.fish + +test: + fish test/test_bass.fish + fish test/test_dollar_on_output.fish + fish test/test_trailing_semicolon.fish + fish test/test_non_zero_returncode.fish + +.PHONY: test diff --git a/dot_config/private_fish/triton/github.com/edc/bass/README.md b/dot_config/private_fish/triton/github.com/edc/bass/README.md new file mode 100644 index 0000000..d5b7ac6 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/README.md @@ -0,0 +1,108 @@ +# Bass + +![](https://travis-ci.org/edc/bass.svg?branch=master) + +Bass makes it easy to use utilities written for Bash in [fish shell](https://github.com/fish-shell/fish-shell/). + +Regular bash scripts can be used in fish shell just as scripts written in any language with proper shebang or explicitly using the interpreter (i.e. using `bash script.sh`). However, many utilities, such as virtualenv, modify the shell environment and need to be sourced, and therefore cannot be used in fish. Sometimes, counterparts (such as the excellent [virtualfish](http://virtualfish.readthedocs.org/en/latest/)) are created, but that's often not the case. + +Bass is created to make it possible to use bash utilities in fish shell without any modification. It works by capturing what environment variables are modified by the utility of interest, and replay the changes in fish. + +You might not need Bass for simple use cases. A great simple alternative (suggested by @jorgebucaran) is to just use `exec bash -c "source some-bash-setup.sh; exec fish"`. + +# Installation + +Bass is compatible with fish versions 2.6.0 and later. + + +## Manually + +Use the Makefile. + +`make install` will copy two files to `~/.config/fish/functions/`. + +`make uninstall` will remove those two files. + +Relaunch the shell for the change to take effect. + +## With [Oh My Fish](https://github.com/oh-my-fish/oh-my-fish) + +```console +omf install bass +``` + +## With [Fisher](https://github.com/jorgebucaran/fisher) + +```console +fisher install edc/bass +``` + +## With [Fundle](https://github.com/tuvistavie/fundle) + +Add + +```console +fundle plugin 'edc/bass' +``` + +to your fish config, relaunch the shell and run `fundle install`. + +# Example + +Bass is simple to use. Just prefix your bash utility command with `bass`: + +``` +> bass export X=3 +> echo $X +3 +``` + +Notice that `export X=3` is bash syntax. Bass "transported" the new bash +environment variable back to fish. + +Bass has a debug option so you can see what happened: + +``` +> bass -d export X=4 +# updating X=3 -> 4 +set -g -x X 4 +``` + +## nvm + +Here is a more realistic example, using the excellent +[nvm](https://github.com/creationix/nvm): + +``` +> bass source ~/.nvm/nvm.sh --no-use ';' nvm use iojs +Now using io.js v1.1.0 +``` + +Note that semicolon is quoted to avoid being consumed by fish. + +This example takes advantage of the nvm bash utility to switch to iojs. +After the command, iojs is accessible: + +``` +> which iojs +/Users/edc/.nvm/versions/io.js/v1.1.0/bin/iojs +``` + +You can then very easily pack the command as a function and feel more at home: + +``` +> funced nvm +nvm> function nvm + bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv + end + +> nvm list +-> iojs-v1.1.0 + system +> nvm ls-remote + v0.1.14 + v0.1.15 +... +``` + +(`--no-use` is an important option to `nvm.sh`. See [#13](https://github.com/edc/bass/issues/13) for background.) diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/HEAD b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/branches/.keep b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/branches/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/config b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/config new file mode 100644 index 0000000..d9a2a57 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/config @@ -0,0 +1,11 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = https://github.com/edc/bass + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/description b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_applypatch-msg.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_commit-msg.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_fsmonitor-watchman.sample new file mode 100644 index 0000000..23e856f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_post-update.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-applypatch.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-commit.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-commit.sample new file mode 100644 index 0000000..e144712 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-merge-commit.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-push.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-rebase.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-receive.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_push-to-checkout.sample b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/hooks/executable_push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/index b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/index new file mode 100644 index 0000000..8848073 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/index differ diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/info/exclude b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/HEAD b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/HEAD new file mode 100644 index 0000000..7a8294b --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 2fd3d2157d5271ca3575b13daec975ca4c10577a Hydroxycarbamide 1682119838 +0200 clone: from https://github.com/edc/bass diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/heads/master b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/heads/master new file mode 100644 index 0000000..7a8294b --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 2fd3d2157d5271ca3575b13daec975ca4c10577a Hydroxycarbamide 1682119838 +0200 clone: from https://github.com/edc/bass diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/remotes/origin/HEAD new file mode 100644 index 0000000..7a8294b --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 2fd3d2157d5271ca3575b13daec975ca4c10577a Hydroxycarbamide 1682119838 +0200 clone: from https://github.com/edc/bass diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/info/.keep b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/info/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.idx b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.idx new file mode 100644 index 0000000..fdf1aa2 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.idx differ diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.pack b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.pack new file mode 100644 index 0000000..52e5577 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/objects/pack/readonly_pack-2238ec9db8275c33a457d7fca6ce6968cc404b3e.pack differ diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/packed-refs b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/packed-refs new file mode 100644 index 0000000..1cde345 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/packed-refs @@ -0,0 +1,3 @@ +# pack-refs with: peeled fully-peeled sorted +2fd3d2157d5271ca3575b13daec975ca4c10577a refs/remotes/origin/master +7aae6a85c24660422ea3f3f4629bb4a8d30df3ba refs/tags/v1.0 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/heads/master b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/heads/master new file mode 100644 index 0000000..24c0f89 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/heads/master @@ -0,0 +1 @@ +2fd3d2157d5271ca3575b13daec975ca4c10577a diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/remotes/origin/HEAD new file mode 100644 index 0000000..6efe28f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/tags/.keep b/dot_config/private_fish/triton/github.com/edc/bass/dot_git/refs/tags/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/edc/bass/dot_travis.yml b/dot_config/private_fish/triton/github.com/edc/bass/dot_travis.yml new file mode 100644 index 0000000..bf002a1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/dot_travis.yml @@ -0,0 +1,13 @@ +language: python +python: + - "2.7" + - "3.5" + - "3.6" + - "3.7" + +before_install: + - sudo add-apt-repository -y ppa:fish-shell/release-2 + - sudo apt-get update + - sudo apt-get -y install fish + +script: make test diff --git a/dot_config/private_fish/triton/github.com/edc/bass/functions/__bass.py b/dot_config/private_fish/triton/github.com/edc/bass/functions/__bass.py new file mode 100644 index 0000000..3fe17fc --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/functions/__bass.py @@ -0,0 +1,138 @@ +""" +To be used with a companion fish function like this: + + function refish + set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x + end + +""" + +from __future__ import print_function + +import json +import os +import signal +import subprocess +import sys +import traceback + + +BASH = 'bash' + +FISH_READONLY = [ + 'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version', + 'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode' +] + +IGNORED = [ + 'PS1', 'XPC_SERVICE_NAME' +] + +def ignored(name): + if name == 'PWD': # this is read only, but has special handling + return False + # ignore other read only variables + if name in FISH_READONLY: + return True + if name in IGNORED or name.startswith("BASH_FUNC"): + return True + return False + +def escape(string): + # use json.dumps to reliably escape quotes and backslashes + return json.dumps(string).replace(r'$', r'\$') + +def escape_identifier(word): + return escape(word.replace('?', '\\?')) + +def comment(string): + return '\n'.join(['# ' + line for line in string.split('\n')]) + +def gen_script(): + # Use the following instead of /usr/bin/env to read environment so we can + # deal with multi-line environment variables (and other odd cases). + env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable) + args = [BASH, '-c', env_reader] + output = subprocess.check_output(args, universal_newlines=True) + old_env = output.strip() + + pipe_r, pipe_w = os.pipe() + if sys.version_info >= (3, 4): + os.set_inheritable(pipe_w, True) + command = 'eval $1 && ({}; alias) >&{}'.format( + env_reader, + pipe_w + ) + args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])] + p = subprocess.Popen(args, universal_newlines=True, close_fds=False) + os.close(pipe_w) + with os.fdopen(pipe_r) as f: + new_env = f.readline() + alias_str = f.read() + if p.wait() != 0: + raise subprocess.CalledProcessError( + returncode=p.returncode, + cmd=' '.join(sys.argv[1:]), + output=new_env + alias_str + ) + new_env = new_env.strip() + + old_env = json.loads(old_env) + new_env = json.loads(new_env) + + script_lines = [] + + for k, v in new_env.items(): + if ignored(k): + continue + v1 = old_env.get(k) + if not v1: + script_lines.append(comment('adding %s=%s' % (k, v))) + elif v1 != v: + script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v))) + # process special variables + if k == 'PWD': + script_lines.append('cd %s' % escape(v)) + continue + else: + continue + if k == 'PATH': + value = ' '.join([escape(directory) + for directory in v.split(':')]) + else: + value = escape(v) + script_lines.append('set -g -x %s %s' % (k, value)) + + for var in set(old_env.keys()) - set(new_env.keys()): + script_lines.append(comment('removing %s' % var)) + script_lines.append('set -e %s' % var) + + script = '\n'.join(script_lines) + + alias_lines = [] + for line in alias_str.splitlines(): + _, rest = line.split(None, 1) + k, v = rest.split("=", 1) + alias_lines.append("alias " + escape_identifier(k) + "=" + v) + alias = '\n'.join(alias_lines) + + return script + '\n' + alias + +script_file = os.fdopen(3, 'w') + +if not sys.argv[1:]: + print('__bass_usage', file=script_file, end='') + sys.exit(0) + +try: + script = gen_script() +except subprocess.CalledProcessError as e: + sys.exit(e.returncode) +except Exception: + print('Bass internal error!', file=sys.stderr) + raise # traceback will output to stderr +except KeyboardInterrupt: + signal.signal(signal.SIGINT, signal.SIG_DFL) + os.kill(os.getpid(), signal.SIGINT) +else: + script_file.write(script) diff --git a/dot_config/private_fish/triton/github.com/edc/bass/functions/bass.fish b/dot_config/private_fish/triton/github.com/edc/bass/functions/bass.fish new file mode 100644 index 0000000..2b3af16 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/functions/bass.fish @@ -0,0 +1,29 @@ +function bass + set -l bash_args $argv + set -l bass_debug + if test "$bash_args[1]_" = '-d_' + set bass_debug true + set -e bash_args[1] + end + + set -l script_file (mktemp) + if command -v python3 >/dev/null 2>&1 + command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + else + command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file + end + set -l bass_status $status + if test $bass_status -ne 0 + return $bass_status + end + + if test -n "$bass_debug" + cat $script_file + end + source $script_file + command rm $script_file +end + +function __bass_usage + echo "Usage: bass [-d] " +end diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/alias.sh b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/alias.sh new file mode 100644 index 0000000..f3e280c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/alias.sh @@ -0,0 +1 @@ +alias k?="echo hello" diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/dollar_output.sh b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/dollar_output.sh new file mode 100644 index 0000000..e988315 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/dollar_output.sh @@ -0,0 +1,5 @@ +function dollar_output { + echo 'some program output with the $ symbol in it' +} + +dollar_output \ No newline at end of file diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/trailing_semicolon.sh b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/trailing_semicolon.sh new file mode 100644 index 0000000..5c5a0e0 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/fixtures/trailing_semicolon.sh @@ -0,0 +1,5 @@ +function trailing_semicolon() { + echo 'export SEMICOLON_RSTRIPPED=1;' +} + +trailing_semicolon diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/test_alias.fish b/dot_config/private_fish/triton/github.com/edc/bass/test/test_alias.fish new file mode 100644 index 0000000..1c86a80 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/test_alias.fish @@ -0,0 +1,10 @@ +set root (dirname (dirname (status -f))) +source $root/functions/bass.fish + +bass source $root/test/fixtures/alias.sh +set OUT (k\?) +if [ $OUT = "hello" ] + echo 'Success' +else + exit 1 +end diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/test_bass.fish b/dot_config/private_fish/triton/github.com/edc/bass/test/test_bass.fish new file mode 100644 index 0000000..31f81c2 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/test_bass.fish @@ -0,0 +1,18 @@ +source (dirname (status -f))/../functions/bass.fish + +bass +bass -d +bass -d export X=3 +bass export X=3 + +if test $status -ne 0 + echo 'failed: bass exited with status' $status + exit 1 +end + +if test -z "$X" + echo 'failed: $X should be set' + exit 1 +end + +echo 'Success' diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/test_dollar_on_output.fish b/dot_config/private_fish/triton/github.com/edc/bass/test/test_dollar_on_output.fish new file mode 100644 index 0000000..35f605d --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/test_dollar_on_output.fish @@ -0,0 +1,6 @@ +set root (dirname (status -f))/.. +source $root/functions/bass.fish + +bass source $root/test/fixtures/dollar_output.sh | grep -q 'some program output with the $ symbol in it' + +echo 'Success' diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/test_non_zero_returncode.fish b/dot_config/private_fish/triton/github.com/edc/bass/test/test_non_zero_returncode.fish new file mode 100644 index 0000000..36470dc --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/test_non_zero_returncode.fish @@ -0,0 +1,11 @@ +set root (dirname (dirname (status -f))) +source $root/functions/bass.fish + +bass false + +if test $status -ne 1 + echo 'failed: bass exited with status' $status 'when 1 is expected' + exit 1 +end + +echo 'Success' diff --git a/dot_config/private_fish/triton/github.com/edc/bass/test/test_trailing_semicolon.fish b/dot_config/private_fish/triton/github.com/edc/bass/test/test_trailing_semicolon.fish new file mode 100644 index 0000000..095b847 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/edc/bass/test/test_trailing_semicolon.fish @@ -0,0 +1,7 @@ +set root (dirname (dirname (status -f))) +source $root/functions/bass.fish + +bass (sh $root/test/fixtures/trailing_semicolon.sh) +and if [ "$SEMICOLON_RSTRIPPED" = "1" ] + echo 'Success' +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/LICENSE.md b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/LICENSE.md new file mode 100644 index 0000000..a0e5551 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright 2016 Jethro Kuan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/README.md b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/README.md new file mode 100644 index 0000000..eb6c8a1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/README.md @@ -0,0 +1,93 @@ +# Fzf + +Integrate [fzf](https://github.com/junegunn/fzf) (command-line fuzzy finder) functionality into [Fish](https://github.com/fish-shell/fish-shell). Includes handy functions to: + +- complete commands via Tab +- search command history +- find and `cd` into sub-directories +- find and open files + +All functions: + +- are lazily-loaded to keep shell startup time down +- have configurable key bindings + +## Installation + +### System Requirements + +- [fzf](https://github.com/junegunn/fzf) >= `0.11.3` +- [Fish](https://github.com/fish-shell/fish-shell) >= `2.4.0` + +Install with [Fisher](https://github.com/jorgebucaran/fisher): + +```console +fisher install jethrokuan/fzf +``` + +## Quickstart + +| Legacy | New Keybindings | Remarks | +| ----------- | --------------- | ----------------------------------------------- | +| Ctrl-t | Ctrl-o | Find a file. | +| Ctrl-r | Ctrl-r | Search through command history. | +| Alt-c | Alt-c | cd into sub-directories (recursively searched). | +| Alt-Shift-c | Alt-Shift-c | cd into sub-directories, including hidden ones. | +| Ctrl-o | Alt-o | Open a file/dir using default editor ($EDITOR) | +| Ctrl-g | Alt-Shift-o | Open a file/dir using xdg-open or open command | + +Legacy keybindings are kept by default, but these have conflict with key bindings in Fish 2.4.0. If you want to use the new keybindings, ƒenter the following into your terminal: + +```fish +set -U FZF_LEGACY_KEYBINDINGS 0 +``` + +You can disable default keybindings altogether by running: + +```fish +set -U FZF_DISABLE_KEYBINDINGS 1 +``` + +> **Note:** On OS X, Alt+C (Option-C) types ç by default. In iTerm2, you can send the right escape sequence with Esc+C. If you configure the option key to act as +Esc (iTerm2 Preferences > Profiles > Default > Keys > Left option (⌥) acts as: > +Esc), then Alt+C will work for `fzf` as documented. + +## Commands + +| Variable | Remarks | Example | +| ---------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `FZF_FIND_FILE_COMMAND` | Modify the command used to generate the list of files | `set -U FZF_FIND_FILE_COMMAND "ag -l --hidden --ignore .git . \$dir 2> /dev/null"` or `set -U FZF_FIND_FILE_COMMAND "fd --type f . \$dir"` (`$dir` represents the directory being completed) | +| `FZF_CD_COMMAND` | Similar to ^ | Similar to ^ | +| `FZF_CD_WITH_HIDDEN_COMMAND` | Similar to ^ | Similar to ^ | +| `FZF_OPEN_COMMAND` | Similar to ^ | Similar to ^ | +| `FZF_PREVIEW_FILE_CMD` | Modify the command used to generate preview of files. | `set -U FZF_PREVIEW_FILE_CMD "head -n 10"` | +| `FZF_PREVIEW_DIR_CMD` | Modify the command used to generate preview of directories. | `set -U FZF_PREVIEW_DIR_CMD "ls"` | + +## Variables + +| Variable | Remarks | Example | +| -------------------------- | ------------------------------------------------------------- | ----------------------------------------------------- | +| `FZF_DEFAULT_OPTS` | Default options passed to every fzf command | `set -U FZF_DEFAULT_OPTS "--height 40"` | +| `FZF_FIND_FILE_OPTS` | Pass in additional arguments to the fzf command for find file | `set -U FZF_FIND_FILE_OPTS "--reverse --inline-info"` | +| `FZF_CD_OPTS` | Similar to ^ | Similar to ^ | +| `FZF_CD_WITH_HIDDEN_OPTS` | Similar to ^ | Similar to ^ | +| `FZF_REVERSE_ISEARCH_OPTS` | Similar to ^ | Similar to ^ | +| `FZF_OPEN_OPTS` | Similar to ^ | Similar to ^ | +| `FZF_COMPLETE_OPTS` | Similar to ^ | Similar to ^ | +| `FZF_TMUX` | Runs a tmux-friendly version of fzf instead. | `set -U FZF_TMUX 1` | +| `FZF_ENABLE_OPEN_PREVIEW` | Enable preview window open command. | `set -U FZF_ENABLE_OPEN_PREVIEW 1` | + +## `fzf` Tab Completions + +This package ships with a `fzf` widget for fancy tab completions. + +Please see [the wiki page](https://github.com/jethrokuan/fzf/wiki/FZF-Tab-Completions) for details. + +## Alternatives + +- [fzf.fish](https://github.com/patrickf3139/fzf.fish) is a newer fzf plugin with very similar features. It lacks fzf tab completion but includes functions for searching git log, git status, and browsing shell variables using fzf. Additionally, it is more likely to be maintained going forward. You can read more about the differences between it and this plugin on this `fzf.fish` [Wiki page](https://github.com/PatrickF1/fzf.fish/wiki/Prior-Art). +- The `fzf` utility ships with its [own out-of-the-box Fish integration](https://github.com/junegunn/fzf/blob/master/shell/key-bindings.fish). What sets this package apart is that it has better shell integration, most notably tab completions. They are not compatible so use one or the other. + +[tmux]: https://tmux.github.io/ + +## License + +[MIT](LICENSE.md) diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/conf.d/fzf.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/conf.d/fzf.fish new file mode 100644 index 0000000..d22f583 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/conf.d/fzf.fish @@ -0,0 +1,63 @@ +set -q FZF_TMUX_HEIGHT; or set -U FZF_TMUX_HEIGHT "40%" +set -q FZF_DEFAULT_OPTS; or set -U FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT" +set -q FZF_LEGACY_KEYBINDINGS; or set -U FZF_LEGACY_KEYBINDINGS 1 +set -q FZF_DISABLE_KEYBINDINGS; or set -U FZF_DISABLE_KEYBINDINGS 0 +set -q FZF_PREVIEW_FILE_CMD; or set -U FZF_PREVIEW_FILE_CMD "head -n 10" +set -q FZF_PREVIEW_DIR_CMD; or set -U FZF_PREVIEW_DIR_CMD "ls" + +if test "$FZF_DISABLE_KEYBINDINGS" -ne 1 + if test "$FZF_LEGACY_KEYBINDINGS" -eq 1 + bind \ct '__fzf_find_file' + bind \cr '__fzf_reverse_isearch' + bind \ec '__fzf_cd' + bind \eC '__fzf_cd --hidden' + bind \cg '__fzf_open' + bind \co '__fzf_open --editor' + + if ! test "$fish_key_bindings" = fish_default_key_bindings + bind -M insert \ct '__fzf_find_file' + bind -M insert \cr '__fzf_reverse_isearch' + bind -M insert \ec '__fzf_cd' + bind -M insert \eC '__fzf_cd --hidden' + bind -M insert \cg '__fzf_open' + bind -M insert \co '__fzf_open --editor' + end + else + bind \co '__fzf_find_file' + bind \cr '__fzf_reverse_isearch' + bind \ec '__fzf_cd' + bind \eC '__fzf_cd --hidden' + bind \eO '__fzf_open' + bind \eo '__fzf_open --editor' + + if ! test "$fish_key_bindings" = fish_default_key_bindings + bind -M insert \co '__fzf_find_file' + bind -M insert \cr '__fzf_reverse_isearch' + bind -M insert \ec '__fzf_cd' + bind -M insert \eC '__fzf_cd --hidden' + bind -M insert \eO '__fzf_open' + bind -M insert \eo '__fzf_open --editor' + end + end + + if not bind --user \t >/dev/null 2>/dev/null + if set -q FZF_COMPLETE + bind \t '__fzf_complete' + if ! test "$fish_key_bindings" = fish_default_key_bindings + bind -M insert \t '__fzf_complete' + end + end + end +end + +function _fzf_uninstall -e fzf_uninstall + bind --user \ + | string replace --filter --regex -- "bind (.+)( '?__fzf.*)" 'bind -e $1' \ + | source + + set --names \ + | string replace --filter --regex '(^FZF)' 'set --erase $1' \ + | source + + functions --erase _fzf_uninstall +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/HEAD b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/branches/.keep b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/branches/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/config b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/config new file mode 100644 index 0000000..cb174ba --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/config @@ -0,0 +1,11 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true +[remote "origin"] + url = https://github.com/jethrokuan/fzf + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/description b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_applypatch-msg.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_commit-msg.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_fsmonitor-watchman.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_fsmonitor-watchman.sample new file mode 100644 index 0000000..23e856f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_post-update.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-applypatch.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-commit.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-commit.sample new file mode 100644 index 0000000..e144712 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-merge-commit.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-push.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-rebase.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-receive.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_prepare-commit-msg.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_push-to-checkout.sample b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/hooks/executable_push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/index b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/index new file mode 100644 index 0000000..ff212f4 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/index differ diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/info/exclude b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/HEAD b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/HEAD new file mode 100644 index 0000000..aa2a393 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 479fa67d7439b23095e01b64987ae79a91a4e283 Hydroxycarbamide 1682119803 +0200 clone: from https://github.com/jethrokuan/fzf diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/heads/master b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/heads/master new file mode 100644 index 0000000..aa2a393 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 479fa67d7439b23095e01b64987ae79a91a4e283 Hydroxycarbamide 1682119803 +0200 clone: from https://github.com/jethrokuan/fzf diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/remotes/origin/HEAD new file mode 100644 index 0000000..aa2a393 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 479fa67d7439b23095e01b64987ae79a91a4e283 Hydroxycarbamide 1682119803 +0200 clone: from https://github.com/jethrokuan/fzf diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/info/.keep b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/info/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.idx b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.idx new file mode 100644 index 0000000..bb39a96 Binary files /dev/null and b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.idx differ diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.pack b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.pack new file mode 100644 index 0000000..7ace81d Binary files /dev/null and b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/objects/pack/readonly_pack-179b27e22004791ebe272b2a53aad15c8605db62.pack differ diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/packed-refs b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/packed-refs new file mode 100644 index 0000000..57867e3 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/packed-refs @@ -0,0 +1,8 @@ +# pack-refs with: peeled fully-peeled sorted +12557ee6359c6d4d25dd1e64945e31e18c8198d7 refs/remotes/origin/feat/remove-hardcoded-sort +479fa67d7439b23095e01b64987ae79a91a4e283 refs/remotes/origin/master +8e694416e4fc413731117724b2bfb616326ecb99 refs/tags/0.12.1-beta +31c1e193bc8fa6acf126c0595d320de25fa1fe4d refs/tags/0.13.3 +d165e1f7cbf068b3508cf7c78719e28a11d27995 refs/tags/0.15.1 +67b52003b4509d06140eb82fa6be801079f62937 refs/tags/0.16.5 +c3defd4a922e97120503b45e26efa775bc672b50 refs/tags/0.16.6 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/heads/master b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/heads/master new file mode 100644 index 0000000..86421c7 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/heads/master @@ -0,0 +1 @@ +479fa67d7439b23095e01b64987ae79a91a4e283 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/remotes/origin/HEAD b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/remotes/origin/HEAD new file mode 100644 index 0000000..6efe28f --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/tags/.keep b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_git/refs/tags/.keep new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_github/workflows/ci.yml b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_github/workflows/ci.yml new file mode 100644 index 0000000..e120ed9 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/dot_github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: push + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install Fish + run: | + sudo apt-add-repository -yn ppa:fish-shell/release-3 + sudo apt-get update + sudo apt-get install -y fish + + - name: Install Tools + run: | + curl -sL https://git.io/fisher | source + fisher install $GITHUB_WORKSPACE + bind --user | string match --entire __fzf + shell: fish {0} diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_cd.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_cd.fish new file mode 100644 index 0000000..c79a725 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_cd.fish @@ -0,0 +1,49 @@ +function __fzf_cd -d "Change directory" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + + if not type -q argparse + # Fallback for fish shell version < 2.7 + function argparse + functions -e argparse # deletes itself + end + if contains -- --hidden $argv; or contains -- -h $argv + set _flag_hidden "yes" + end + end + + # Fish shell version >= v2.7, use argparse + set -l options "h/hidden" + argparse $options -- $argv + + set -l COMMAND + + set -q FZF_CD_COMMAND + or set -l FZF_CD_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@^\./@@'" + + set -q FZF_CD_WITH_HIDDEN_COMMAND + or set -l FZF_CD_WITH_HIDDEN_COMMAND " + command find -L \$dir \ + \\( -path '*/\\.git*' -o -fstype 'dev' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | sed 1d | cut -b3-" + + if set -q _flag_hidden + set COMMAND $FZF_CD_WITH_HIDDEN_COMMAND + else + set COMMAND $FZF_CD_COMMAND + end + + eval "$COMMAND | "(__fzfcmd)" +m $FZF_DEFAULT_OPTS $FZF_CD_OPTS --query \"$fzf_query\"" | read -l select + + if not test -z "$select" + builtin cd "$select" + + # Remove last token from commandline. + commandline -t "" + end + + commandline -f repaint +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete.fish new file mode 100644 index 0000000..e8848fa --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete.fish @@ -0,0 +1,168 @@ +## +# Use fzf as fish completion widget. +# +# +# When FZF_COMPLETE variable is set, fzf is used as completion +# widget for the fish shell by binding the TAB key. +# +# FZF_COMPLETE can have some special numeric values: +# +# `set FZF_COMPLETE 0` basic widget accepts with TAB key +# `set FZF_COMPLETE 1` extends 0 with candidate preview window +# `set FZF_COMPLETE 2` same as 1 but TAB walks on candidates +# `set FZF_COMPLETE 3` multi TAB selection, RETURN accepts selected ones. +# +# Any other value of FZF_COMPLETE is given directly as options to fzf. +# +# If you prefer to set more advanced options, take a look at the +# `__fzf_complete_opts` function and override that in your environment. + + +# modified from https://github.com/junegunn/fzf/wiki/Examples-(fish)#completion +function __fzf_complete -d 'fzf completion and print selection back to commandline' + # As of 2.6, fish's "complete" function does not understand + # subcommands. Instead, we use the same hack as __fish_complete_subcommand and + # extract the subcommand manually. + set -l cmd (commandline -co) (commandline -ct) + + switch $cmd[1] + case env sudo + for i in (seq 2 (count $cmd)) + switch $cmd[$i] + case '-*' + case '*=*' + case '*' + set cmd $cmd[$i..-1] + break + end + end + end + + set -l cmd_lastw $cmd[-1] + set cmd (string join -- ' ' $cmd) + + set -l initial_query '' + test -n "$cmd_lastw"; and set initial_query --query="$cmd_lastw" + + set -l complist (complete -C$cmd) + set -l result + + # do nothing if there is nothing to select from + test -z "$complist"; and return + + set -l compwc (echo $complist | wc -w) + if test $compwc -eq 1 + # if there is only one option dont open fzf + set result "$complist" + else + + set -l query + string join -- \n $complist \ + | eval (__fzfcmd) (string escape --no-quoted -- $initial_query) --print-query (__fzf_complete_opts) \ + | cut -f1 \ + | while read -l r + # first line is the user entered query + if test -z "$query" + set query $r + # rest of lines are selected candidates + else + set result $result $r + end + end + + # exit if user canceled + if test -z "$query" ;and test -z "$result" + commandline -f repaint + return + end + + # if user accepted but no candidate matches, use the input as result + if test -z "$result" + set result $query + end + end + + set prefix (string sub -s 1 -l 1 -- (commandline -t)) + for i in (seq (count $result)) + set -l r $result[$i] + switch $prefix + case "'" + commandline -t -- (string escape -- $r) + case '"' + if string match '*"*' -- $r >/dev/null + commandline -t -- (string escape -- $r) + else + commandline -t -- '"'$r'"' + end + case '~' + commandline -t -- (string sub -s 2 (string escape -n -- $r)) + case '*' + commandline -t -- $r + end + [ $i -lt (count $result) ]; and commandline -i ' ' + end + + commandline -f repaint +end + +function __fzf_complete_opts_common + if set -q FZF_DEFAULT_OPTS + echo $FZF_DEFAULT_OPTS + end + echo --cycle --reverse --inline-info +end + +function __fzf_complete_opts_tab_accepts + echo --bind tab:accept,btab:cancel +end + +function __fzf_complete_opts_tab_walks + echo --bind tab:down,btab:up +end + +function __fzf_complete_opts_preview + set -l file (status -f) + echo --with-nth=1 --preview-window=right:wrap --preview="fish\ '$file'\ __fzf_complete_preview\ '{1}'\ '{2..}'" +end + +test "$argv[1]" = "__fzf_complete_preview"; and __fzf_complete_preview $argv[2..3] + +function __fzf_complete_opts_0 -d 'basic single selection with tab accept' + __fzf_complete_opts_common + echo --no-multi + __fzf_complete_opts_tab_accepts +end + +function __fzf_complete_opts_1 -d 'single selection with preview and tab accept' + __fzf_complete_opts_0 + __fzf_complete_opts_preview +end + +function __fzf_complete_opts_2 -d 'single selection with preview and tab walks' + __fzf_complete_opts_1 + __fzf_complete_opts_tab_walks +end + +function __fzf_complete_opts_3 -d 'multi selection with preview' + __fzf_complete_opts_common + echo --multi + __fzf_complete_opts_preview +end + +function __fzf_complete_opts -d 'fzf options for fish tab completion' + switch $FZF_COMPLETE + case 0 + __fzf_complete_opts_0 + case 1 + __fzf_complete_opts_1 + case 2 + __fzf_complete_opts_2 + case 3 + __fzf_complete_opts_3 + case '*' + echo $FZF_COMPLETE + end + if set -q FZF_COMPLETE_OPTS + echo $FZF_COMPLETE_OPTS + end +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete_preview.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete_preview.fish new file mode 100644 index 0000000..585ab92 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_complete_preview.fish @@ -0,0 +1,31 @@ +function __fzf_complete_preview -d 'generate preview for completion widget. + argv[1] is the currently selected candidate in fzf + argv[2] is a string containing the rest of the output produced by `complete -Ccmd` + ' + + if test "$argv[2]" = "Redefine variable" + # show environment variables current value + set -l evar (echo $argv[1] | cut -d= -f1) + echo $argv[1]$$evar + else + echo $argv[1] + end + + set -l path (string replace "~" $HOME -- $argv[1]) + + # list directories on preview + if test -d "$path" + eval $FZF_PREVIEW_DIR_CMD (string escape $path) + end + + # show ten lines of non-binary files preview + if test -f "$path"; and grep -qI . "$path" + eval $FZF_PREVIEW_FILE_CMD (string escape $path) + end + + # if fish knows about it, let it show info + type -q "$path" 2>/dev/null; and type -a "$path" + + # show aditional data + echo $argv[2] +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_find_file.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_find_file.fish new file mode 100644 index 0000000..1900006 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_find_file.fish @@ -0,0 +1,29 @@ +function __fzf_find_file -d "List files and folders" + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + + set -q FZF_FIND_FILE_COMMAND + or set -l FZF_FIND_FILE_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@^\./@@'" + + begin + eval "$FZF_FIND_FILE_COMMAND | "(__fzfcmd) "-m $FZF_DEFAULT_OPTS $FZF_FIND_FILE_OPTS --query \"$fzf_query\"" | while read -l s; set results $results $s; end + end + + if test -z "$results" + commandline -f repaint + return + else + commandline -t "" + end + + for result in $results + commandline -it -- (string escape $result) + commandline -it -- " " + end + commandline -f repaint +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_get_dir.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_get_dir.fish new file mode 100644 index 0000000..77c873c --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_get_dir.fish @@ -0,0 +1,17 @@ +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 test (string length $dir) -gt 1 + set dir (string replace -r '/*$' '' $dir) + end + + # Iteratively check if dir exists and strip tail end of path + while test ! -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 diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_open.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_open.fish new file mode 100644 index 0000000..aa5ca61 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_open.fish @@ -0,0 +1,63 @@ +function __fzf_open -d "Open files and directories." + function __fzf_open_get_open_cmd -d "Find appropriate open command." + if type -q xdg-open + echo "xdg-open" + else if type -q open + echo "open" + end + end + + set -l commandline (__fzf_parse_commandline) + set -l dir $commandline[1] + set -l fzf_query $commandline[2] + + if not type -q argparse + set created_argparse + function argparse + functions -e argparse # deletes itself + end + if contains -- --editor $argv; or contains -- -e $argv + set _flag_editor "yes" + end + if contains -- --preview $argv; or contains -- -p $argv + set _flag_preview "yes" + end + end + + set -l options "e/editor" "p/preview=?" + argparse $options -- $argv + + set -l preview_cmd + if set -q FZF_ENABLE_OPEN_PREVIEW + set preview_cmd "--preview-window=right:wrap --preview='fish -c \"__fzf_complete_preview {}\"'" + end + + set -q FZF_OPEN_COMMAND + or set -l FZF_OPEN_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@^\./@@'" + + set -l select (eval "$FZF_OPEN_COMMAND | "(__fzfcmd) $preview_cmd "-m $FZF_DEFAULT_OPTS $FZF_OPEN_OPTS --query \"$fzf_query\"" | string escape) + + # set how to open + set -l open_cmd + if set -q _flag_editor + set open_cmd "$EDITOR" + else + set open_cmd (__fzf_open_get_open_cmd) + if test -z "$open_cmd" + echo "Couldn't find appropriate open command to use. Do you have 'xdg-open' or 'open' installed?"; and return 1 + end + end + + set -l open_status 0 + if not test -z "$select" + commandline "$open_cmd $select"; and commandline -f execute + set open_status $status + end + + commandline -f repaint + return $open_status +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_parse_commandline.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_parse_commandline.fish new file mode 100644 index 0000000..2cc9dfb --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_parse_commandline.fish @@ -0,0 +1,23 @@ +function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath and rest of token' + # eval is used to do shell expansion on paths + set -l commandline (eval "printf '%s' "(commandline -t)) + + if test -z $commandline + # Default to current directory with no --query + set dir '.' + set fzf_query '' + else + set dir (__fzf_get_dir $commandline) + + if test "$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 +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_reverse_isearch.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_reverse_isearch.fish new file mode 100644 index 0000000..2ebbe20 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzf_reverse_isearch.fish @@ -0,0 +1,6 @@ +function __fzf_reverse_isearch + history merge + history -z | eval (__fzfcmd) --read0 --print0 --tiebreak=index --toggle-sort=ctrl-r $FZF_DEFAULT_OPTS $FZF_REVERSE_ISEARCH_OPTS -q '(commandline)' | read -lz result + and commandline -- $result + commandline -f repaint +end diff --git a/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzfcmd.fish b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzfcmd.fish new file mode 100644 index 0000000..821c650 --- /dev/null +++ b/dot_config/private_fish/triton/github.com/jethrokuan/fzf/functions/__fzfcmd.fish @@ -0,0 +1,9 @@ +function __fzfcmd + set -q FZF_TMUX; or set FZF_TMUX 0 + set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40% + if test $FZF_TMUX -eq 1 + echo "fzf-tmux -d$FZF_TMUX_HEIGHT" + else + echo "fzf" + end +end diff --git a/dot_config/rofi/config.rasi b/dot_config/rofi/config.rasi new file mode 100644 index 0000000..9cb7461 --- /dev/null +++ b/dot_config/rofi/config.rasi @@ -0,0 +1,18 @@ +configuration{ + modi: "run,drun,window"; + icon-theme: "Oranchelo"; + show-icons: true; + terminal: "alacritty"; + drun-display-format: "{icon} {name}"; + location: 0; + disable-history: false; + hide-scrollbar: true; + display-drun: " 󰵆 Apps "; + display-run: "  Run "; + display-window: " 﩯 Window"; + display-Network: " 󰤨 Network"; + sidebar-mode: true; +} + +@theme "catppuccin-macchiato" + diff --git a/dot_config/rofi/userconfig/config.rasi b/dot_config/rofi/userconfig/config.rasi new file mode 100644 index 0000000..fb503d3 --- /dev/null +++ b/dot_config/rofi/userconfig/config.rasi @@ -0,0 +1,18 @@ +configuration{ + modi: "run,drun,window"; + icon-theme: "Oranchelo"; + show-icons: true; + terminal: "alacritty"; + drun-display-format: "{icon} {name}"; + location: 0; + disable-history: false; + hide-scrollbar: true; + display-drun: "  Apps "; + display-run: "  Run "; + display-window: " 﩯 Window"; + display-Network: " 󰤨 Network"; + sidebar-mode: true; +} + +@theme "catppuccin-mocha" + diff --git a/dot_config/rofi/userconfig/rofi.rasi b/dot_config/rofi/userconfig/rofi.rasi new file mode 100644 index 0000000..2c8bca6 --- /dev/null +++ b/dot_config/rofi/userconfig/rofi.rasi @@ -0,0 +1,113 @@ +configuration { + font: "JetBrainsMono NF 12"; + show-icons: true; + icon-theme: "Papirus-Dark"; + display-drun: ""; + drun-display-format: "{name}"; + disable-history: false; + sidebar-mode: false; +} + +* { + background: #00000060; + background-alt: #00000000; + background-bar: #f2f2f215; + foreground: #f2f2f2EE; + accent: #ffffff66; +} + +window { + transparency: "real"; + background-color: @background; + text-color: @foreground; + border: 0px; + border-radius: 0px; + width: 100%; + height: 100%; + fullscreen: true; +} + +prompt { + enabled: true; + padding: 0.30% -0.5% 0% 0.5%; + background-color: @background-alt; + text-color: @foreground; + font: "JetBrainsMono Nerd Font 12"; +} + +entry { + background-color: @background-alt; + text-color: @foreground; + placeholder-color: @foreground; + expand: true; + horizontal-align: 0; + placeholder: "Search"; + padding: 0% 0% 0% 0%; + blink: true; +} + +inputbar { + children: [ prompt, entry ]; + background-color: @background-bar; + text-color: @foreground; + expand: false; + border: 0.1%; + border-radius: 8px; + border-color: @accent; + margin: 0% 25% 0% 25%; + padding: 1%; +} + +listview { + background-color: @background-alt; + columns: 7; + lines: 4; + spacing: 2%; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + background-color: @background-alt; + border: 0% 0% 0% 0%; + border-radius: 0% 0% 0% 0%; + border-color: @accent; + children: [ inputbar, listview ]; + spacing: 8%; + padding: 10% 8.5% 10% 8.5%; +} + +element { + background-color: @background-alt; + text-color: @foreground; + orientation: vertical; + border-radius: 0%; + padding: 2.5% 0% 2.5% 0%; +} + +element-icon { + background-color: @background-alt; + text-color: inherit; + horizontal-align: 0.5; + vertical-align: 0.5; + size: 81px; + border: 0px; +} + +element-text { + background-color: @background-alt; + text-color: inherit; + expand: true; + horizontal-align: 0.5; + vertical-align: 0.5; + margin: 0.5% 0.5% -0.5% 0.5%; +} + +element selected { + background-color: @background-bar; + text-color: @foreground; + border: 0% 0% 0% 0%; + border-radius: 12px; + border-color: @accent; +} diff --git a/dot_config/rofi/userconfig/window.rasi b/dot_config/rofi/userconfig/window.rasi new file mode 100644 index 0000000..58d6ce6 --- /dev/null +++ b/dot_config/rofi/userconfig/window.rasi @@ -0,0 +1,85 @@ +configuration { + font: "JetBrainsMono NF 12"; + show-icons: true; + icon-theme: "Papirus-Dark"; + display-drun: ""; + drun-display-format: "{name}"; + disable-history: false; + sidebar-mode: false; +} + + +* { + background: #00000000; + background-alt: #00000000; + background-bar: #f2f2f215; + foreground: #f2f2f2EE; + accent: #3DAEE966; +} + +window { + transparency: "real"; + background-color: #21212188; + text-color: @foreground; + border: 1px; + border-radius: 25px; + //width: 26%; + location: center; + x-offset: 0; + y-offset: 0; +} + +prompt, entry, inputbar { + enabled: false; +} + +listview { + background-color: @background-alt; + columns: 100; + lines: 1; + spacing: 1%; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + background-color: @background-alt; + border: 0% 0% 0% 0%; + border-color: @accent; + children: [ inputbar, listview ]; + spacing: 2%; + padding: 2% 1% 2% 1%; +} + +element { + background-color: @background-alt; + text-color: @foreground; + orientation: vertical; + padding: 2.5% 0% 2.5% 0%; +} + +element-icon { + background-color: @background-alt; + text-color: inherit; + horizontal-align: 0.5; + vertical-align: 0.5; + size: 6%; +} + +element-text { + background-color: @background-alt; + text-color: inherit; + expand: false; + horizontal-align: 0.5; + vertical-align: 0.5; + margin: 0.5% 0.5% -0.5% 0.5%; +} + +element selected { + background-color: #40404088; + text-color: @foreground; + border: 0% 0% 0% 0%; + border-radius: 12px; + border-color: @accent; +} diff --git a/dot_local/share/rofi/themes/catppuccin-frappe.rasi b/dot_local/share/rofi/themes/catppuccin-frappe.rasi new file mode 100644 index 0000000..e6e8783 --- /dev/null +++ b/dot_local/share/rofi/themes/catppuccin-frappe.rasi @@ -0,0 +1,111 @@ +* { + bg-col: #303446; + bg-col-light: #303446; + border-col: #303446; + selected-col: #303446; + blue: #8caaee; + fg-col: #c6d0f5; + fg-col2: #e78284; + grey: #737994; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 360px; + border: 3px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 0px 0px 20px; + columns: 2; + lines: 5; + background-color: @bg-col; +} + +element { + padding: 5px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} diff --git a/dot_local/share/rofi/themes/catppuccin-latte.rasi b/dot_local/share/rofi/themes/catppuccin-latte.rasi new file mode 100644 index 0000000..6826db6 --- /dev/null +++ b/dot_local/share/rofi/themes/catppuccin-latte.rasi @@ -0,0 +1,111 @@ +* { + bg-col: #eff1f5; + bg-col-light: #eff1f5; + border-col: #eff1f5; + selected-col: #eff1f5; + blue: #1e66f5; + fg-col: #4c4f69; + fg-col2: #d20f39; + grey: #9ca0b0; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 360px; + border: 3px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 0px 0px 20px; + columns: 2; + lines: 5; + background-color: @bg-col; +} + +element { + padding: 5px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} diff --git a/dot_local/share/rofi/themes/catppuccin-macchiato.rasi b/dot_local/share/rofi/themes/catppuccin-macchiato.rasi new file mode 100644 index 0000000..8a6eb81 --- /dev/null +++ b/dot_local/share/rofi/themes/catppuccin-macchiato.rasi @@ -0,0 +1,122 @@ +* { + bg-col: #24273a; + bg-col-light: #24273a; + border-col: #f4dbd6; + selected-col: #363a4f; + blue: #f4dbd6; + fg-col: #cad3f5; + fg-col2: #cad3f5; + grey: #6e738d; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 420px; + border: 3px; + border-radius: 10px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 20px 0px 20px; + scrollbar: true; + columns: 1; + lines: 5; + background-color: @bg-col; +} + +scrollbar { + handle-width: 5px; + handle-color: @border-col; + border-radius: 20px; + background-color: @selected-col; + margin: 0 10px; +} + +element { + padding: 8px; + border-radius: 10px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} diff --git a/dot_local/share/rofi/themes/catppuccin-mocha.rasi b/dot_local/share/rofi/themes/catppuccin-mocha.rasi new file mode 100644 index 0000000..38c0b80 --- /dev/null +++ b/dot_local/share/rofi/themes/catppuccin-mocha.rasi @@ -0,0 +1,111 @@ +* { + bg-col: #1e1e2e; + bg-col-light: #1e1e2e; + border-col: #1e1e2e; + selected-col: #1e1e2e; + blue: #89b4fa; + fg-col: #cdd6f4; + fg-col2: #f38ba8; + grey: #6c7086; + + width: 600; + font: "JetBrainsMono Nerd Font 14"; +} + +element-text, element-icon , mode-switcher { + background-color: inherit; + text-color: inherit; +} + +window { + height: 360px; + border: 3px; + border-color: @border-col; + background-color: @bg-col; +} + +mainbox { + background-color: @bg-col; +} + +inputbar { + children: [prompt,entry]; + background-color: @bg-col; + border-radius: 5px; + padding: 2px; +} + +prompt { + background-color: @blue; + padding: 6px; + text-color: @bg-col; + border-radius: 3px; + margin: 20px 0px 0px 20px; +} + +textbox-prompt-colon { + expand: false; + str: ":"; +} + +entry { + padding: 6px; + margin: 20px 0px 0px 10px; + text-color: @fg-col; + background-color: @bg-col; +} + +listview { + border: 0px 0px 0px; + padding: 6px 0px 0px; + margin: 10px 0px 0px 20px; + columns: 2; + lines: 5; + background-color: @bg-col; +} + +element { + padding: 5px; + background-color: @bg-col; + text-color: @fg-col ; +} + +element-icon { + size: 25px; +} + +element selected { + background-color: @selected-col ; + text-color: @fg-col2 ; +} + +mode-switcher { + spacing: 0; + } + +button { + padding: 10px; + background-color: @bg-col-light; + text-color: @grey; + vertical-align: 0.5; + horizontal-align: 0.5; +} + +button selected { + background-color: @bg-col; + text-color: @blue; +} + +message { + background-color: @bg-col-light; + margin: 2px; + padding: 2px; + border-radius: 5px; +} + +textbox { + padding: 6px; + margin: 20px 0px 0px 20px; + text-color: @blue; + background-color: @bg-col-light; +} diff --git a/dot_local/share/rofi/themes/colors-rofi-dark.rasi b/dot_local/share/rofi/themes/colors-rofi-dark.rasi new file mode 100644 index 0000000..9cb512e --- /dev/null +++ b/dot_local/share/rofi/themes/colors-rofi-dark.rasi @@ -0,0 +1,161 @@ +* { + active-background: #7D827E; + active-foreground: @foreground; + normal-background: @background; + normal-foreground: @foreground; + urgent-background: #936E5B; + urgent-foreground: @foreground; + + alternate-active-background: @background; + alternate-active-foreground: @foreground; + alternate-normal-background: @background; + alternate-normal-foreground: @foreground; + alternate-urgent-background: @background; + alternate-urgent-foreground: @foreground; + + selected-active-background: #936E5B; + selected-active-foreground: @foreground; + selected-normal-background: #7D827E; + selected-normal-foreground: @foreground; + selected-urgent-background: #A28F6B; + selected-urgent-foreground: @foreground; + + background-color: @background; + background: #1c1b19; + foreground: #cacbc7; + border-color: @background; + spacing: 2; +} + +#window { + background-color: @background; + border: 0; + padding: 2.5ch; +} + +#mainbox { + border: 0; + padding: 0; +} + +#message { + border: 2px 0px 0px; + border-color: @border-color; + padding: 1px; +} + +#textbox { + text-color: @foreground; +} + +#inputbar { + children: [ prompt,textbox-prompt-colon,entry,case-indicator ]; +} + +#textbox-prompt-colon { + expand: false; + str: ":"; + margin: 0px 0.3em 0em 0em; + text-color: @normal-foreground; +} + +#listview { + fixed-height: 0; + border: 2px 0px 0px; + border-color: @border-color; + spacing: 2px; + scrollbar: true; + padding: 2px 0px 0px; +} + +#element { + border: 0; + padding: 1px; +} + +#element.normal.normal { + background-color: @normal-background; + text-color: @normal-foreground; +} + +#element.normal.urgent { + background-color: @urgent-background; + text-color: @urgent-foreground; +} + +#element.normal.active { + background-color: @active-background; + text-color: @active-foreground; +} + +#element.selected.normal { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +#element.selected.urgent { + background-color: @selected-urgent-background; + text-color: @selected-urgent-foreground; +} + +#element.selected.active { + background-color: @selected-active-background; + text-color: @selected-active-foreground; +} + +#element.alternate.normal { + background-color: @alternate-normal-background; + text-color: @alternate-normal-foreground; +} + +#element.alternate.urgent { + background-color: @alternate-urgent-background; + text-color: @alternate-urgent-foreground; +} + +#element.alternate.active { + background-color: @alternate-active-background; + text-color: @alternate-active-foreground; +} + +#scrollbar { + width: 4px; + border: 0; + handle-width: 8px; + padding: 0; +} + +#sidebar { + border: 2px 0px 0px; + border-color: @border-color; +} + +#button { + text-color: @normal-foreground; +} + +#button.selected { + background-color: @selected-normal-background; + text-color: @selected-normal-foreground; +} + +#inputbar { + spacing: 0; + text-color: @normal-foreground; + padding: 1px; +} + +#case-indicator { + spacing: 0; + text-color: @normal-foreground; +} + +#entry { + spacing: 0; + text-color: @normal-foreground; +} + +#prompt { + spacing: 0; + text-color: @normal-foreground; +} diff --git a/dot_local/share/rofi/themes/default.rasi b/dot_local/share/rofi/themes/default.rasi new file mode 100644 index 0000000..15374b1 --- /dev/null +++ b/dot_local/share/rofi/themes/default.rasi @@ -0,0 +1,93 @@ +configuration { + modi: "drun"; + font: "JetBrainsMono Nerd Font 12"; + show-icons: true; + icon-theme: "oomox-Everblush"; + display-drun: ""; + drun-display-format: "{name}"; + sidebar-mode: false; +} + +@theme "/dev/null" + +* { + bg: #181f21; + fg: #dadada; + fg-alt: #181f21; + accent: #8ccf7e; + button: #ef7d7d; + + background-color: @bg; + text-color: @fg; +} + +window { + border-radius: 15px; + width: 45%; + padding: 32px; +} + +prompt { + background-color: @accent; + enabled: true; + padding: 0.5% 32px 0% -0.5%; + font: "JetBrainsMono Nerd Font 12"; +} + +entry { + placeholder: " 󰍉 Search "; + background-color: @accent; + placeholder-color: @fg-alt; + expand: true; + padding: 0.25% 100% 0% 0%; +} + +inputbar { + children: [ prompt, entry ]; + background-color: @accent; + expand: false; + border-radius: 6px; + margin: 0%; + padding: 10px; +} + +listview { + columns: 4; + lines: 3; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + children: [ inputbar, listview ]; + spacing: 2%; + padding: 2% 1% 2% 1%; +} + +element { + orientation: vertical; + padding: 2% 0% 2% 0%; +} + +element-icon { + size: 48px; + horizontal-align: 0.5; +} + +element-text { + expand: true; + horizontal-align: 0.5; + vertical-align: 0.5; + margin: 0.5% 0.5% -0.5% 0.5%; +} + +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} + +element selected { + background-color: @button; + border-radius: 6px; +} diff --git a/dot_local/share/rofi/themes/everblush.rasi b/dot_local/share/rofi/themes/everblush.rasi new file mode 100644 index 0000000..3168c45 --- /dev/null +++ b/dot_local/share/rofi/themes/everblush.rasi @@ -0,0 +1,114 @@ +configuration { + modi: "drun"; + font: "Proxima Nova Bold 15"; + show-icons: true; + icon-theme: "Reversal-black-dark"; + display-drun: "󰍉"; + drun-display-format: "{name}"; + sidebar-mode: false; +} + +@theme "/dev/null" + +* { + bg: #181f21; + fg: #dadada; + fg-alt: #181f21; + button: #ef7d7d; + accent: #8ccf7e; + accent-alt: #e5c76b; + border: #67b0e8; + another-color: #c47fd5; + + background-color: @bg; + text-color: @fg; +} + +window { + transparency: "real"; + border-radius: 15px; + width: 50%; + padding: 30px; + border: 4px; + border-color: @border; +} + +prompt { + enabled: true; + horizontal-align: 0.5; + vertical-align: 0.5; + background-color: @bg; + border: 4px; + border-color: @accent; + border-radius: 15px; + font: "Material Design Icons Desktop Bold 17"; + padding: 0 1% 0; + text-color: @button; +} + +entry { + placeholder: "Search"; + expand: true; + padding: 2%; + background-color: @bg; + placeholder-color: @another-color; + border: 4px; + border-color: @accent; + border-radius: 15px; + cursor: text; + text-color: @another-color; +} + +inputbar { + children: [ prompt, entry ]; + expand: false; + spacing: 1%; + text-color: @another-color; +} + +listview { + columns: 4; + lines: 3; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + children: [ inputbar, listview ]; + spacing: 2%; + padding: 2% 1% 2% 1%; +} + +element { + orientation: vertical; + padding: 2% 0% 2% 0%; +} + +element-icon { + size: 48px; + horizontal-align: 0.5; +} + +element-text { + expand: true; + horizontal-align: 0.5; + vertical-align: 0.5; + margin: 0.5% 0.5% -0.5% 0.5%; + font: "Proxima Nova 15"; +} + +element selected { + background-color: @accent-alt; + text-color: @bg; + border-radius: 10px; +} + +element-text, element-icon { + background-color: inherit; + text-color: inherit; +} + +listview, element, element selected, element-icon, element-text { + cursor: pointer; +} \ No newline at end of file diff --git a/dot_local/share/rofi/themes/rounded-common.rasi b/dot_local/share/rofi/themes/rounded-common.rasi new file mode 100644 index 0000000..cea02bf --- /dev/null +++ b/dot_local/share/rofi/themes/rounded-common.rasi @@ -0,0 +1,94 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + font: "Roboto 12"; + + background-color: transparent; + text-color: @fg0; + + margin: 0px; + padding: 0px; + spacing: 0px; +} + +window { + location: center; + width: 480; + y-offset: -200; + border-radius: 15px; + + background-color: @bg0; +} + +mainbox { + padding: 12px; +} + +inputbar { + background-color: @bg1; + border-color: @bg3; + + border: 2px; + border-radius: 16px; + + padding: 8px 16px; + spacing: 8px; + children: [ prompt, entry ]; +} + +prompt { + text-color: @fg2; +} + +entry { + placeholder: "Search"; + placeholder-color: @fg3; +} + +message { + margin: 12px 0 0; + border-radius: 16px; + border-color: @bg2; + background-color: @bg2; +} + +textbox { + padding: 8px 24px; +} + +listview { + background-color: transparent; + + margin: 12px 0 0; + lines: 8; + columns: 1; + + fixed-height: false; +} + +element { + padding: 8px 16px; + spacing: 8px; + border-radius: 16px; +} + +element normal active { + text-color: @bg3; +} + +element selected normal, element selected active { + background-color: @bg3; +} + +element-icon { + size: 1em; + vertical-align: 0.5; +} + +element-text { + text-color: inherit; +} diff --git a/dot_local/share/rofi/themes/rounded-everblush-dark.rasi b/dot_local/share/rofi/themes/rounded-everblush-dark.rasi new file mode 100644 index 0000000..a27943f --- /dev/null +++ b/dot_local/share/rofi/themes/rounded-everblush-dark.rasi @@ -0,0 +1,18 @@ +/******************************************************************************* + * ROUNDED THEME FOR ROFI + * User : LR-Tech + * Theme Repo : https://github.com/lr-tech/rofi-themes-collection + *******************************************************************************/ + +* { + bg0: #1c1b19F2; + bg1: #1c1b19; + bg2: #A28F6B80; + bg3: #7D827EF2; + fg0: #E6E6E6; + fg1: #FFFFFF; + fg2: #969696; + fg3: #936E5B; +} + +@import "rounded-common.rasi"