conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "fix: Move darwin specific pathing to case\n"
},
{
"from": "human",
"value": "fish_vi_key_bindings\n\nfor word in \"$HOME/\"{bin,.local/bin,Library/Python/2.7/bin,go/bin}\n if not contains $word $PATH\n set PATH $word $PATH\n end\nend\n\nset -x GOPATH \"... | fish | chosen |
[
{
"from": "system",
"value": "Return error when mv fails\n"
},
{
"from": "human",
"value": "function fonts.install -a name\n\n if not contains $name (__fonts.repo.list)\n echo \"Font $name not available for installing\"\n return 1\n end\n\n if test -e \"$FONTS_CONFIG/$name\"\n echo \... | fish | chosen |
[
{
"from": "system",
"value": "fix: Use $HOME in OMF variables\n"
},
{
"from": "human",
"value": "# Path to Oh My Fish install.\nset -gx OMF_PATH \"/home/e4r7hbug/.local/share/omf\"\n\n# Customize Oh My Fish configuration path.\n#set -gx OMF_CONFIG \"/home/e4r7hbug/.config/omf\"\n\n# Load oh-my-f... | fish | chosen |
[
{
"from": "system",
"value": "[fish] Add alias for `find . -iname`\n"
},
{
"from": "human",
"value": "alias axel=\"axel -a\"\nalias dotfiles=\"git --git-dir=$HOME/dev/.files.git/ --work-tree=$HOME\"\nalias dl=\"wget -r -l 1 -np -nd\"\nalias g=git\nalias killaudio=\"sudo kill `ps -ax | grep 'core... | fish | chosen |
[
{
"from": "system",
"value": "Use fish-standard way of checking if an environment variable is set\n"
},
{
"from": "human",
"value": "# Colorized ls output\nset --export CLICOLOR 1\nset --export LSCOLORS Exfxcxdxbxegedabagacad\n\n# Ensure the HOSTNAME environment variable is set so that `rcm` wor... | fish | chosen |
[
{
"from": "human",
"value": "Rewrite sway autotiling script in fish\n"
},
{
"from": "gpt",
"value": "function sway_autotiling\n swaymsg --type subscribe \"['window']\" --monitor | while read --local line\n string length --quiet \"$line\"\n or continue\n\n set focused_container (swaymsg... | fish | chosen |
[
{
"from": "system",
"value": "Add alias gcb='git checkout -b'\n"
},
{
"from": "human",
"value": "# pyenv fish\nset -gx PYENV_ROOT \"$HOME/.pyenv\"\nset -x PATH $PATH \"$PYENV_ROOT/bin\"\nstatus --is-interactive; and . (pyenv init - | psub)\n\n# peco\nfunction peco_select_history\n if set -q $... | fish | chosen |
[
{
"from": "human",
"value": "Create custom fish prompt based on fish_config template\n"
},
{
"from": "gpt",
"value": "function fish_prompt --description 'Write out the prompt'\n\tset -l last_status $status\n\n # User\n set_color $fish_color_user\n echo -n (whoami)\n set_color normal\... | fish | chosen |
[
{
"from": "human",
"value": "Add function to check if data is secret\n"
},
{
"from": "gpt",
"value": "function is-secret --argument key\n trace (status --current-filename) $argv\n\n if has (basename $key) (dirname $key)\n set secret_header '-----BEGIN PGP MESSAGE-----'\n set ... | fish | chosen |
[
{
"from": "system",
"value": "Enable true colors on neovim\n"
},
{
"from": "human",
"value": "set --export EDITOR vim\nset --export PATH /usr/local/bin $PATH\nset --export PATH /usr/local/sbin $PATH\n\nset fish_color_command white\nset fish_color_autosuggestion yellow\nset fish_pager_color_descr... | fish | chosen |
[
{
"from": "system",
"value": "Add sbin to fish path\n\nbrew doctor says so\n"
},
{
"from": "human",
"value": "# Source asdf\nsource ~/.asdf/asdf.fish\nset -x ERL_AFLAGS \"-kernel shell_history enabled\"\n"
},
{
"from": "gpt",
"value": "source ~/.asdf/asdf.fish\nset -x ERL_AFLAGS \"-k... | fish | chosen |
[
{
"from": "system",
"value": "Make staged state char a delta\n"
},
{
"from": "human",
"value": "# show info about repo status\nset -g __fish_git_prompt_show_informative_status true\n\n# git status chars\nset -g __fish_git_prompt_char_stateseparator \"\"\nset -g __fish_git_prompt_char_dirtystate ... | fish | chosen |
[
{
"from": "system",
"value": "Update `trash` arguments for version 0.9.2\n\n"
},
{
"from": "human",
"value": "function d -d 'Trash'\n if type -q trash-put > /dev/null\n set_color $yellow\n printf 'Trashing file \\\"%s\\\"\\n' $argv\n set_color normal\n trash-put $argv\n else if typ... | fish | chosen |
[
{
"from": "system",
"value": "Add support for filtering available expansions\n"
},
{
"from": "human",
"value": "function expand:execute -d \"Executes word expansion on the current token\"\n # Iterate available expansions for one that matches the current token.\n for expansion in $__word_expans... | fish | chosen |
[
{
"from": "system",
"value": "Add Slack to Fish PATH\n"
},
{
"from": "human",
"value": "# Uncomment this if the modal indicator becomes annoying\n#function fish_mode_prompt; end\n\n# Path to dotfiles repo\nset -x DOTFILES (dirname (readlink \"$HOME/.config\"))\n\n# Target stuff\nset -x DRONE_SER... | fish | chosen |
[
{
"from": "human",
"value": "Add fish completions for the brew binary\n\nSee Library/Contributions\n"
},
{
"from": "gpt",
"value": "# This script contains basic completion of brew commands for\n# fish (http://fishshell.org). To install it either put it\n# in <your-fish-install-location>/share/fi... | fish | chosen |
[
{
"from": "system",
"value": "Sort results before sending to comm\n"
},
{
"from": "human",
"value": "function users-not-in-group --argument group\n if empty \"$group\"\n usage users-not-in-group '<group>'\n return (false)\n end\n\n comm -13 (users-in-group $group | psub) (... | fish | chosen |
[
{
"from": "system",
"value": "Add switch to function template\n"
},
{
"from": "human",
"value": "# Create a new function.\nfunction fn --argument-names function_name\n if functions --query $function_name\n yn $function_name\" already exists. Edit?\"\n and fe $function_name\n... | fish | chosen |
[
{
"from": "system",
"value": "Add not about 1Password extension\n"
},
{
"from": "human",
"value": "# Launch Google Chrome.\nfunction chrome\n open -a \"Google Chrome\" --args --new-window $argv\nend\n"
},
{
"from": "gpt",
"value": "# Launch Google Chrome.\n#\n# When Chrome is laun... | fish | chosen |
[
{
"from": "human",
"value": "Add function to assign an IP to an instance\n"
},
{
"from": "gpt",
"value": "function assign-ip --argument vpc instance\n print-status assign-ip \"$argv\"\n if empty \"$vpc\" \"$instance\"\n usage assign-ip '<vpc>' '<instance>'\n return (false)\n ... | fish | chosen |
[
{
"from": "system",
"value": "Use fish_add_path to manage $PATH\n\nThis is available on `master` and will be part of 3.2.0.\n\nhttps://github.com/fish-shell/fish-shell/pull/7028\n"
},
{
"from": "human",
"value": "if status --is-login\n eval (brew shellenv)\n for py_version in 3.9 3.8 3.7\n... | fish | chosen |
[
{
"from": "system",
"value": "Fix bug where `which go` output printed to terminal\n"
},
{
"from": "human",
"value": "# A workaround for Fish re-reading config for non-interactive execution:\n# https://git.io/yj4KoA\nif not status --is-interactive\n exit\nend\n\n# fundle\nfundle plugin 'edc/bass... | fish | chosen |
[
{
"from": "human",
"value": "Add function to enable MFA devices\n"
},
{
"from": "gpt",
"value": "function enable-mfa --argument user code1 code2\n trace (status --current-filename) $argv\n\n if empty \"$user\" \"$code1\" \"$code2\"\n usage enable-mfa '<user>' '<code-1>' '<code-2>'\n... | fish | chosen |
[
{
"from": "system",
"value": "Fix regular SSH regular expression\n"
},
{
"from": "human",
"value": "function __clone_exec --argument-names {project}\n set --local result (string match --regex \"https://github.com/([^/]+)/([^./]+)\" $project)\n or set --local result (string match --regex \"git@... | fish | chosen |
[
{
"from": "system",
"value": "Fix some colors in the scheme\n"
},
{
"from": "human",
"value": "function shift_scheme\n set fish_color_autosuggestion 3a3a3a brblack\n set fish_color_cancel -r\n set fish_color_command ffbf00\n set fish_color_comment 7f7f7f\n # These colors are not used in the... | fish | chosen |
[
{
"from": "system",
"value": "Print new remotes after one is added\n"
},
{
"from": "human",
"value": "function ra --description 'Adds a git remote' --argument name url\n git remote add $name $url\nend\n"
},
{
"from": "gpt",
"value": "function ra --description 'Adds a git remote' -... | fish | chosen |
[
{
"from": "system",
"value": "Fix prompt so it shows the red pipe even when in the home directory"
},
{
"from": "human",
"value": "function _git_branch_name\n echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')\nend\n\nfunction _is_git_dirty\n echo (git status -s --ignore-submo... | fish | chosen |
[
{
"from": "system",
"value": "Add alias of bundle command\n"
},
{
"from": "human",
"value": "set -gx LANGUAGE en_US.UTF-8\nset -gx LANG $LANGUAGE\nset -gx LC_ALL $LANGUAGE\nset -gx LC_CTYPE $LANGUAGE\n\nset -gx PATH $HOME/bin $PATH $GOPATH/bin\n\nset -gx EDITOR vim\nset -gx PAGER less\n\nset -gx... | fish | chosen |
[
{
"from": "system",
"value": "Replace `available` usage with `type -q`\n"
},
{
"from": "human",
"value": "function init --on-event init_grc\n set -l execs cat cvs df diff dig gcc g++ ls ifconfig \\\n make mount mtr netstat ping ps tail traceroute \\\n wdiff \n\n if ... | fish | chosen |
[
{
"from": "system",
"value": "Use g for Go env var setup, running n again won't replace it\n"
},
{
"from": "human",
"value": "set -gx PATH $PATH $HOME/bin\n\nset -gx N_PREFIX $HOME/n\nset -gx PATH $PATH $N_PREFIX/bin\n\nset -gx fish_prompt_pwd_dir_length 3\n\nset -gx GOENV_ROOT $HOME/.goenv\nset... | fish | chosen |
[
{
"from": "human",
"value": "Add function to add a tag to a VPC\n"
},
{
"from": "gpt",
"value": "function add-tag-to-vpc --argument-names resource key value\n print-status vpc/add-tag \"$argv\"\n for argument in resource key value\n if test -z \"$$argument\"\n print-statu... | fish | chosen |
[
{
"from": "system",
"value": "Set global flag on environment variables\n"
},
{
"from": "human",
"value": "set -x VIRTUAL_ENV_DISABLE_PROMPT 1\nset -x PIP_REQUIRE_VIRTUALENV 1\nset -x HOMEBREW_NO_ANALYTICS 1\nset -x HOMEBREW_NO_AUTO_UPDATE 1\n\nstatus --is-interactive; and source (pyenv init - | ... | fish | chosen |
[
{
"from": "human",
"value": "Add function to deactivate MFA for a user\n"
},
{
"from": "gpt",
"value": "function deactivate-mfa --argument user\n if empty \"$user\"\n usage deactivate-mfa '<user>'\n return (false)\n end\n\n aws iam deactivate-mfa-device --user-name \"$user... | fish | chosen |
[
{
"from": "system",
"value": "Update path for newer Homebrew installs.\n"
},
{
"from": "human",
"value": "\n# Wrap hub in `git`\neval (hub alias -s)\n\n# Path party\nset PATH \"/usr/local/sbin\" $PATH\n\n"
},
{
"from": "gpt",
"value": "\n# Wrap hub in `git`\neval (hub alias -s)\n\n# ... | fish | chosen |
[
{
"from": "system",
"value": "Add another abbreviation for fish\n"
},
{
"from": "human",
"value": "set normal (set_color normal)\nset magenta (set_color magenta)\nset yellow (set_color yellow)\nset green (set_color green)\nset red (set_color red)\nset gray (set_color -o black)\n\n# Interactive/l... | fish | chosen |
[
{
"from": "system",
"value": "Initialize immediately, rather than waiting for an event.\n"
},
{
"from": "human",
"value": "function init --on-event init_weather\n # Set the default temperature units to use. Options are:\n # default\n # celsius\n # fahrenheit\n # kelvin\n #\n # \"d... | fish | chosen |
[
{
"from": "system",
"value": "Add Rust libs to ldlibrary path\n"
},
{
"from": "human",
"value": "set -x PATH $PATH ~/.config/mybin\nset -x PATH $PATH $BRAZIL_CLI_BIN\n"
},
{
"from": "gpt",
"value": "set -x PATH $PATH ~/.config/mybin\nset -x PATH $PATH /apollo/env/SDETools/bin/\nset -... | fish | chosen |
[
{
"from": "system",
"value": "meta: Add git tag information to fish prompt\n\nNow that I understand how tags work in git, keeping track of the current\nrevision number with the shell prompt is actually very useful.\n"
},
{
"from": "human",
"value": "# New Start: A modern Arch workflow built with... | fish | chosen |
[
{
"from": "system",
"value": "Fix flag order for BSD md5 command\n"
},
{
"from": "human",
"value": "function weather.fetch -d \"Fetches data from a URL backed by a cache\"\n set md5 (__md5 \"$argv\")\n\n if test (count $argv) -gt 1\n for param in $argv[2..-1]\n set flags $flags --data-... | fish | chosen |
[
{
"from": "system",
"value": "Comment out the Terraform alias\n"
},
{
"from": "human",
"value": "# Atom\nset -x ATOM_REPOS_HOME /Projects/2014/ryansobol\n\n# exa\nif command --search exa >/dev/null\n alias ls exa\n alias tree \"exa -T\"\nend\n\n# terraform\nif command --search docker >/dev/nul... | fish | chosen |
[
{
"from": "system",
"value": "Fish: Use fish emojis as prompt\n"
},
{
"from": "human",
"value": "function fish_prompt\n\techo\n\tswitch $IN_NIX_SHELL\n\t\tcase pure\n\t\t\tset_color green\n\t\t\techo -n \">>> \"\n\t\tcase impure\n\t\t\tset_color yellow\n\t\t\techo -n \">> \"\n\t\tcase '*'\n\t\t\... | fish | chosen |
[
{
"from": "human",
"value": "Add function for renaming a tarball to its md5sum\n"
},
{
"from": "gpt",
"value": "function ruby2md5sum\n for arg in $argv\n set -lx hash (md5sum $arg | cut -d ' ' -f 1)\n set -lx ruby (md5sum $arg | cut -d ' ' -f 3)\n mv $ruby $hash\n end\nend\n"
}
] | fish | chosen |
[
{
"from": "system",
"value": "SIGSTATUS: Update for OSX, show the SIGNAME in UPPERCASE as `kill -l $SIG` return SIGNAME in lowercase\n"
},
{
"from": "human",
"value": "#!/usr/bin/env fish\n# -*- mode:fish; tab-width:4 -*-\n\nfunction FLSEG_SIGSTATUS\n\n\tif [ $FLINT_STATUS -gt 128 ]; and [ $FL... | fish | chosen |
[
{
"from": "system",
"value": "Fish: Use test instead of [\n"
},
{
"from": "human",
"value": "# Neovim\nset --local neovim_guis \\\n\t/Applications/FVim.app/Contents/MacOS/FVim \\\n\t/Applications/goneovim.app/Contents/MacOS/goneovim\nset --export EDITOR $neovim_guis[(random 1 2)]\n\n# Nix\nset N... | fish | chosen |
[
{
"from": "system",
"value": "Add goneovim as available editor\n"
},
{
"from": "human",
"value": "set fvim /Applications/FVim.app/Contents/MacOS/FVim\nif [ -e $fvim ]\n\tset --export EDITOR $fvim\nelse\n\tset --export EDITOR nvim\nend\n\n# XDG\nset --export XDG_CONFIG_HOME $HOME/.config\nset --e... | fish | chosen |
[
{
"from": "system",
"value": "Use -gx for fish variables\n"
},
{
"from": "human",
"value": "mkdir -p ~/bin ~/npm/bin ~/.cargo/bin ~/.gem/ruby/2.5.0/bin\n\nset fish_greeting \"\"\nset LANG en_GB.UTF-8\nset PATH ~/bin ~/npm/bin ~/.cargo/bin ~/.gem/ruby/2.5.0/bin $PATH\nset BROWSER chromium\nset ED... | fish | chosen |
[
{
"from": "system",
"value": "Add sudo emacs -nw alias as sue\n"
},
{
"from": "human",
"value": "# pyenv fish\nset -gx PYENV_ROOT \"$HOME/.pyenv\"\nset -x PATH $PATH \"$PYENV_ROOT/bin\"\nstatus --is-interactive; and . (pyenv init - | psub)\n\n# emacs alias\nalias e=\"emacs -nw\"\n\n# peco\nfunct... | fish | chosen |
[
{
"from": "human",
"value": "Add a `git commit --verbose` wrapper\n"
},
{
"from": "gpt",
"value": "function gcv --description=\"git commit verbose\"\n if test (count (command git status --porcelain | command grep \"^[^ ?]\")) -eq 0\n set_color yellow\n echo \"Nothing to commit...\"\n s... | fish | chosen |
[
{
"from": "human",
"value": "Add a function to prepend a string to the front of the current command\n\nTaken from https://github.com/fish-shell/fish-shell/issues/288#issuecomment-158704275\n"
},
{
"from": "gpt",
"value": "# Taken from \n# https://github.com/fish-shell/fish-shell/issues/288#issue... | fish | chosen |
[
{
"from": "system",
"value": "Allow manual toggle of simple glyphs\n"
},
{
"from": "human",
"value": "# FIXME: This doesn't play nice with tmux/screen\n# I looked into it, but no solution seems readily\n# available. Going into a vt is a rare occurence\n# and I do not need tmux there, but it woul... | fish | chosen |
[
{
"from": "system",
"value": "Add `dddd` as the alias for `rm -rf`\n\n"
},
{
"from": "human",
"value": "function d -d 'Trash'\n if type -q trash-put > /dev/null\n set_color $yellow\n printf 'Trashing file \\\"%s\\\"\\n' $argv\n set_color normal\n trash-put $argv\n else if type -q t... | fish | chosen |
[
{
"from": "human",
"value": "Set fish prompt to Classic + Git"
},
{
"from": "gpt",
"value": "function fish_prompt --description 'Write out the prompt'\n\t\n\tset -l last_status $status\n\n\t# Just calculate these once, to save a few cycles when displaying the prompt\n\tif not set -q __fish_promp... | fish | chosen |
[
{
"from": "system",
"value": "Move the GOPRIVATE variable to the individual .envrc files\n"
},
{
"from": "human",
"value": "set -x LANGUAGE \"en_US.UTF-8\"\nset -x LC_ALL \"en_US.UTF-8\"\n\n# set the default editor to vim\nset -x EDITOR 'vim'\n\n# use fdfind as the file list for fzf\nset -x FZF_... | fish | chosen |
[
{
"from": "system",
"value": "Use readlink to determine the path"
},
{
"from": "human",
"value": "function jump\n if test (count $argv) -ne 1\n echo \"Usage: jump <MARK_NAME>\"\n else\n if test -d $MARKPATH/$argv[1] -a -L $MARKPATH/$argv[1]\n cd $MARKPATH/$argv[1]\n cd (pwd -P)... | fish | chosen |
[
{
"from": "system",
"value": "Use normal diff command instead of colordiff\n"
},
{
"from": "human",
"value": "## Aliases\nalias vi=\"nvim\"\nalias vim=\"nvim\"\nalias git=\"hub\"\nalias diff=\"colordiff -u\"\nalias ctags=\"/usr/local/bin/ctags\"\nalias deckset=\"open -a Deckset\"\nalias rm=\"rm ... | fish | chosen |
[
{
"from": "human",
"value": "Add VIMODE segment to use insted of the default fish_mode_prompt\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env fish\n# -*- mode:fish; tab-width:4 -*-\nset FLSYM_VIMODE_DEFAULT \"NORMAL\"\nset FLSYM_VIMODE_INSERT \"INSERT\"\nset FLSYM_VIMODE_REPLACE \"REPLACE\"\n... | fish | chosen |
[
{
"from": "human",
"value": "Add function to reset password\n"
},
{
"from": "gpt",
"value": "function reset-password --argument user password\n if empty \"$user\" \"$password\"\n usage reset-password '<user>' '<password>'\n return (false)\n end\n\n aws iam update-login-pro... | fish | chosen |
[
{
"from": "system",
"value": ":white_check_mark: Test clone navigation for user/repo\n"
},
{
"from": "human",
"value": "set -l repo_path $HOME/github.com/gh_user/gh_repo\n\nfunction teardown -S\n rm -rf (dirname $repo_path)\nend\n\ntest \"navigates to cloned project when given user repo\"\n \"... | fish | chosen |
[
{
"from": "system",
"value": "Return early, as soon as the IP is retrieved\n"
},
{
"from": "human",
"value": "function weather.location -d \"Get the current geographic location\"\n # Attempt to get our external IP address.\n if not set ip (__weather_get_ip)\n echo \"No Internet connection o... | fish | chosen |
[
{
"from": "system",
"value": "Fix my man pages showing errors when opened in nvim\n"
},
{
"from": "human",
"value": "set -gx NPM_DIR \"$HOME/.npm-data\"\nset -gx NODE_PATH \"$NPM_DIR/lib/node_modules:$NODE_PATH\"\nset -gx PATH ~/bin $NPM_DIR/bin $HOME/.local/bin $PATH\n\nmkdir -p ~/bin $NPM_DIR/... | fish | chosen |
[
{
"from": "system",
"value": "Simplify the `g` (cd replacement) function"
},
{
"from": "human",
"value": "# Go\nfunction g -d 'Change directory and look up'\n set is_okay true\n if test -z $argv # if no argument\n cd -\n else\n if test -e $argv # if the file exists\n cd $argv\n ... | fish | chosen |
[
{
"from": "system",
"value": "Remove /, + from output\n"
},
{
"from": "human",
"value": "function randombase64 -d \"Generate random base64 string\"\n set -l n $argv[1]; test -z $n; and set n 12\n # https://en.wikipedia.org/wiki/Birthday_problem#Probability_table\n dd if=/dev/urandom bs=1 coun... | fish | chosen |
[
{
"from": "system",
"value": "Make FZF_COMPLETE use a proper if statement"
},
{
"from": "human",
"value": "if test \"$FZF_LEGACY_KEYBINDINGS\" -eq 1\n bind \\ct '__fzf_find_file'\n bind \\cr '__fzf_reverse_isearch'\n bind \\ec '__fzf_cd'\n bind \\eC '__fzf_cd_with_hidden'\n\n if b... | fish | chosen |
[
{
"from": "system",
"value": "Increase minimum command duration to 200ms\n"
},
{
"from": "human",
"value": "function fish_right_prompt\n set -l status_color yellow\n set -l status_char \"😄 \"\n\n if test $status -ne 0\n set status_color red\n set status_char \"😡 \"\n ... | fish | chosen |
[
{
"from": "human",
"value": "Add right prompt to show git status\n"
},
{
"from": "gpt",
"value": "function fish_right_prompt --description 'Write out the prompt'\n\tset -l last_status $status\n\n if not set -q __fish_git_prompt_show_informative_status\n set -g __fish_git_prompt_show_inform... | fish | chosen |
[
{
"from": "human",
"value": "Add function to check if bucket exists\n"
},
{
"from": "gpt",
"value": "function bucket-exists --argument-names name\n print-status s3/bucket-exists $name\n aws s3api list-buckets | jq -e \".Buckets[] | select(.Name == \\\"$name\\\")\" >/dev/null ^/dev/null\nend\n"... | fish | chosen |
[
{
"from": "human",
"value": "Add function to detach a policy from a thing\n"
},
{
"from": "gpt",
"value": "function detach-policy --argument type name policy\n if empty \"$type\" \"$name\" \"$policy\"\n usage detach-policy '<type>' '<name>' '<policy>'\n return (false)\n end\n... | fish | chosen |
[
{
"from": "system",
"value": "Add special 'trunk' version value so that days can be specified\n"
},
{
"from": "human",
"value": "function swift_releases \\\n --description='Check for Swift releases' \\\n --argument-names swift_version days\n\n set -l branch_name development\n\n ... | fish | chosen |
[
{
"from": "system",
"value": "Use command -s instead of which\n"
},
{
"from": "human",
"value": "function git_exists -d 'Checks if git is present'\n # Use which instead of type. We always use command to execute\n # git and this is much, much cheaper\n which git 2> /dev/null >/dev/null\nend\n"... | fish | chosen |
[
{
"from": "system",
"value": "Add support for ubuntu lesspipe\n"
},
{
"from": "human",
"value": "function src-hilite-lesspipe\n test -f $source_highlight_style_file; and set stylefile $source_highlight_style_file; or set stylefile esc.style\n for source in $argv\n switch \"$source\"... | fish | chosen |
[
{
"from": "human",
"value": "[Fish] Add function to compare the same file between dirs\n"
},
{
"from": "gpt",
"value": "function vdiff -d \"Vim diff the same file between directories\"\n set --local lhs (realpath $argv[2])\n set --local rhs (realpath $argv[1]/$argv[2])\n echo \"Diffing '$lhs'... | fish | chosen |
[
{
"from": "human",
"value": "Add function to add a user to a group\n"
},
{
"from": "gpt",
"value": "function add-user-to-group --argument-names user group\n print-status iam/add-user-to-group \"$user $group\"\n aws iam add-user-to-group --user-name $user --group-name $group\nend\n"
}
] | fish | chosen |
[
{
"from": "system",
"value": "Remove unused function in right prompt\n"
},
{
"from": "human",
"value": "function _do_prompt_git\n git_exists; and git_is_git_repo\nend\n\nfunction fish_right_prompt\n if set -q VIRTUAL_ENV\n # Let's hope python won't break this way to read the version\n se... | fish | chosen |
[
{
"from": "system",
"value": "Use defined env vars for colors\n"
},
{
"from": "human",
"value": "# simotek prompt theme, by Simon Lees <http://github.com/simotek/>\nfunction fish_greeting --description 'Print the shell greeting'\n colors\n\n set -l c_n '\\x1b[94m'\n set -l c_w '\\x1b[93... | fish | chosen |
[
{
"from": "system",
"value": "Fish: Fix broken right status prompt\n"
},
{
"from": "human",
"value": "function fish_right_prompt -d \"Show right prompt\"\n set last_status \"$status\"\n if math \"$last_status > 0\" >/dev/null\n set_color red\n else\n set_color green\n e... | fish | chosen |
[
{
"from": "system",
"value": "Fish: Make brew cleanup more intense\n"
},
{
"from": "human",
"value": "function config_brew\n if contains $argv \"clean\"\n brew bundle cleanup --global --force\n end\n if not type brew >/dev/null ^&1\n echo \"Install brew\"\n return 1... | fish | chosen |
[
{
"from": "system",
"value": "Improve last command status indicator\n"
},
{
"from": "human",
"value": "# name: eclm\nfunction _git_branch_name\n echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')\nend\n\nfunction _is_git_dirty\n echo (command git status -s --ignore-sub... | fish | chosen |
[
{
"from": "system",
"value": "Add workaround for emacs terminals\n"
},
{
"from": "human",
"value": "set fish_greeting \"\"\nset LANG en_GB.UTF-8\nset PATH ~/bin ~/npm/bin $PATH\nset BROWSER chromium\nset EDITOR nvim\nset VISUAL nvim\n\n# Kill all running containers.\nalias dockerkill='docker kil... | fish | chosen |
[
{
"from": "system",
"value": "Abort if no arguments given\n"
},
{
"from": "human",
"value": "function parent --argument-names key limit\n if test -z \"$key\"\n print-status usage 'parent <key> [limit]'\n end\n\n if test -z \"$limit\"\n set limit 1\n end\n\n if test $... | fish | chosen |
[
{
"from": "system",
"value": "Support OS X user font path\n"
},
{
"from": "human",
"value": "function init -a path --on-event init_fonts\n set -g FONT_MOCK_INDEX \"$path/mock_index.json\"\n set -g FONT_MOCK_SHOW \"$path/mock_show.json\"\n\n set -q XDG_DATA_HOME;\n or set -l XDG_DATA_HOME... | fish | chosen |
[
{
"from": "system",
"value": "Include Homebrew’s executables path in $PATH\n"
},
{
"from": "human",
"value": "# Aliases\n\nalias cat=\"bat\"\nalias flushdns=\"sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder\"\nalias ll=\"ls -lAh\"\nalias ls=\"gls --color\"\nalias v=\"nvim\"\n\n# - ... | fish | chosen |
[
{
"from": "system",
"value": "Fix the complete error when file not exist\n"
},
{
"from": "human",
"value": "function __fish_complete_plugin_cd -d \"Completions for the plugin-cd command\"\n\tset -l token (commandline -ct)\n set -l last_two_char (echo $token | sed 's/.*\\(..\\)/\\1/')\n if test... | fish | chosen |
[
{
"from": "human",
"value": "Implement shell functions for fish.\n"
},
{
"from": "gpt",
"value": "function shell::termcolor\n if not string match --quiet \"256color\" $TERM\n set --export --global TERM $argv[1]\n end\nend\n\nfunction shell::color\n if test -f \"$HOME/.config/shell/$argv[1]... | fish | chosen |
[
{
"from": "system",
"value": "Fix setting PATH to work with fish 2.2\n"
},
{
"from": "human",
"value": "#!/usr/bin/env fish\n\nset -x ASDF_DIR (dirname (status -f))\nset -l asdf_data_dir (\n if test -n \"$ASDF_DATA_DIR\"; echo $ASDF_DATA_DIR;\n else; echo $HOME/.asdf; end)\n\n# Add asdf to PAT... | fish | chosen |
[
{
"from": "human",
"value": "Add function to find real users in a group\n"
},
{
"from": "gpt",
"value": "function real-users-in-group --argument group\n if empty \"$group\"\n usage real-users-in-group '<group>'\n return (false)\n end\n\n print-status real-users-in-group \"... | fish | chosen |
[
{
"from": "human",
"value": "Add command to set fish color scheme to monokai\n"
},
{
"from": "gpt",
"value": "function set_colors_monokai\n\t# Colors:\n\tset fish_color_normal normal # the default color\n\tset fish_color_command F92672 # the color for commands\n\tset fish_color_quote E6DB74 # th... | fish | chosen |
[
{
"from": "system",
"value": "Increase to last 50 items\n"
},
{
"from": "human",
"value": "function pacman-recent --description=\"Show last 25 upgraded/installed packages\"\n command tac /var/log/pacman.log | head -n 1000 | grep --ignore-case --extended-regexp 'installed|upgraded' | tail --line... | fish | chosen |
[
{
"from": "system",
"value": "Speed up fish launch (remove command-not-found)\n"
},
{
"from": "human",
"value": "function fish_prompt\n\t# save exit status so it's not clobbered by successful commands below\n\tset -l exit_code $status\n\tset -l hostname_prefix \"\"\n\tset -l directory_prefix \"\... | fish | chosen |
[
{
"from": "system",
"value": "Read escape sequences from color variables for backwards compatibility\n"
},
{
"from": "human",
"value": "function _pure_set_color \\\n --description 'Set color' \\\n --argument-names var\n\n set --local color $var\n if set -q $var\n set color $$v... | fish | chosen |
[
{
"from": "system",
"value": "Use Docker composer if there is a file with the given port"
},
{
"from": "human",
"value": "function up --description \"Starts a php:apache Docker container using the current path on a random port\"\n set -l port (shuf -i 8000-8099 -n 1)\n set -l cdir (pwd | s... | fish | chosen |
[
{
"from": "system",
"value": "feat: Add npm installed bin directory\n"
},
{
"from": "human",
"value": "fish_vi_key_bindings\n\nfor word in \"$HOME/\"{bin,.local/bin,go/bin}\n if not contains $word $PATH\n set PATH $word $PATH\n end\nend\n\nset -x GOPATH \"$HOME/go\"\n\nset fish_comp... | fish | chosen |
[
{
"from": "system",
"value": "Add commit hash to right prompt when deattached\n"
},
{
"from": "human",
"value": "\nfunction get_git_status -d \"Gets the current git status\"\n if command git rev-parse --is-inside-work-tree >/dev/null 2>&1\n set -l dirty (command git status -s --ignore-submod... | fish | chosen |
[
{
"from": "system",
"value": "Switch to main by default\n"
},
{
"from": "human",
"value": "function review_end\n set current_branch (git branch | ag -Q \\* | cut -f 2 -d ' ')\n\n if [ $current_branch = \"master\" ]\n echo \"Already on master\"\n else\n git co master\n git branch -D $... | fish | chosen |
[
{
"from": "system",
"value": "Add space between the arrow and current directory name in robbyrussell theme\n"
},
{
"from": "human",
"value": "# name: RobbyRussel\nfunction _git_branch_name\n echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')\nend\n\nfunction _is_git_dir... | fish | chosen |
[
{
"from": "human",
"value": "Add a function to show the contents of various compressed file formats\n"
},
{
"from": "gpt",
"value": "function show_archive --description \"List contents of compressed files\"\n for file in $argv\n if test -f $file\n echo -s \"Listing: \" (set_color --bold... | fish | chosen |
[
{
"from": "system",
"value": "Use exa for list current directory is possible\n"
},
{
"from": "human",
"value": "# Go\nfunction g -d 'Change directory and look up'\n set is_okay true\n if test -z $argv\n cd -\n else\n if test -e $argv\n cd $argv\n else\n set is_okay false\n ... | fish | chosen |
[
{
"from": "system",
"value": "Print reminders for tasks easier done manually\n"
},
{
"from": "human",
"value": "function setup-mac --description \"Setup script for OS X\"\n\n function _setup_homebrew\n if not type brew >/dev/null\n ruby -e (curl -fsSL https://raw.githubusercontent.com/H... | fish | chosen |
[
{
"from": "human",
"value": "Add tests for fry install\n"
},
{
"from": "gpt",
"value": ". helper.fish\n\nfunction setup_tank\n function ruby-build\n switch $argv[1]\n case '--definitions'\n echo 'known'\n case '*'\n echo \"ruby-build $argv\"\n end\n end\nend\n\nfu... | fish | chosen |
[
{
"from": "system",
"value": "Kill GPG agent before starting a new one\n"
},
{
"from": "human",
"value": "# Initializes GPG agent on OSX, for signing Git commits, etc.\nfunction gpg-init\n if not begin\n # Is the agent running already? Does the agent-info file exist, and if so,\n ... | fish | chosen |
[
{
"from": "human",
"value": "Add function to find corresponding key for secrets\n"
},
{
"from": "gpt",
"value": "function keys-for-secret --argument key\n trace (status --current-filename) $argv\n\n if empty $key\n usage keys-for-secret '<key>'\n return 23\n end\n\n if ... | fish | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.