conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add Postgres.app to the fish path\n" }, { "from": "human", "value": "echo \" *** Loading env ***\"\nset -gx EDITOR /usr/local/bin/vim\nset -gx BUNDLER_EDITOR $EDITOR\nset -gx TERM \"screen-256color\"\n\n# Manpage settings {{{\nset -gx MANPAGER \"less -X\"\n# }}}\n\n...
fish
chosen
[ { "from": "system", "value": "Use Emacs in daemon mode\n" }, { "from": "human", "value": "\nif which emacs > /dev/null\n set --global --export EDITOR emacs\nelse if which subl > /dev/null\n set --global --export EDITOR 'subl --wait'\nelse\n set --global --export EDITOR vim\nend\n" }, ...
fish
chosen
[ { "from": "system", "value": "Add aliases to open files/dirs in Atom and Sublime using fasd\n" }, { "from": "human", "value": "#\n# Maintains a frequently used file and directory list for fast access.\n#\n\n# Avoid config if requirements are not found.\nif not type -q fasd\n exit\nend\n\n#\n# T...
fish
chosen
[ { "from": "system", "value": "Add support to virtualenv.\nDisplay the name of the current virtualenv on the right side of\nprompt between brackets.\n\nRelated to #2.\n" }, { "from": "human", "value": "\n\nfunction fish_right_prompt -d \"Right side prompt message\"\n\n # A dark grey\n set -...
fish
chosen
[ { "from": "human", "value": "Add function to delete a group\n" }, { "from": "gpt", "value": "function delete-group --argument group\n if empty \"$group\"\n usage delete-group '<group>'\n return (false)\n end\n\n print-status delete-group \"$argv\"\n\n for policy in (att...
fish
chosen
[ { "from": "system", "value": "Fish: Make 'update dotfiles' output a bit nicer to read\n" }, { "from": "human", "value": "function update-dotfiles --description \"Updates the dotfiles\"\n# cd ~/dotfiles; git stash && git reup && git submodule update --init && git stash pop; printf \"\\n\" && gem ...
fish
chosen
[ { "from": "system", "value": "Revert \"fish/env: change the default editor to `helix`\"\n\nThis reverts commit 0583e4a57a248fa147ef87434531f3f4fc10f8e0.\n" }, { "from": "human", "value": "# set Helix as the default editor\nset --global --export EDITOR helix\nset --global --export VISUAL helix\n\...
fish
chosen
[ { "from": "system", "value": "Check for ownership of brew home instead of admin status\n" }, { "from": "human", "value": "# Short alias for installing gems using Bundler.\nfunction brew_update\n # This can only be run by an admin user\n if not user_is_admin\n exit 1\n end\n\n ...
fish
chosen
[ { "from": "system", "value": "Use global config --file for git config checks\n" }, { "from": "human", "value": "# Sets git user.name and user.email\n#\n# ~/.gitconfig is tracked and shared. Sensitive or machine-specific data is\n# stored in the alternate global config file.\n# > If $XDG_CONFIG_H...
fish
chosen
[ { "from": "system", "value": "bitbar: Add separator after update item\n" }, { "from": "human", "value": "#!/usr/local/bin/fish\n# <bitbar.title>Homebrew updates</bitbar.title>\n# <bitbar.author>Sebastian Klatt</bitbar.author>\n# <bitbar.author.github>sebastianmarkow</bitbar.author.github>\n# <bi...
fish
chosen
[ { "from": "system", "value": "Make stderr redirection compatible with Fish 3.0.\n" }, { "from": "human", "value": "which abs ^ /dev/null > /dev/null\nif test $status -ne 1\n function pacupd -d \"Update and refresh the local package and ABS databases against repositories\"\n sudo pacman -Sy; ...
fish
chosen
[ { "from": "system", "value": "Add wrapper for ammonite to use from brew; add rbenv\n" }, { "from": "human", "value": "function mkdir --wraps mkdir\n command mkdir -p $argv;\nend\n\nfunction jl --description 'colorized pretty-printed JSON in less'\n jq -C . | less -R $argv;\nend\n\nif status --...
fish
chosen
[ { "from": "system", "value": "Completions: Use more descriptive function name\n" }, { "from": "human", "value": "function __fish_kdb_no_subcommand \\\n-d 'Check if the current commandline buffer does not contain a subcommand'\n set subcommands (__fish_kdb_complete)\n for input in (commandl...
fish
chosen
[ { "from": "system", "value": "Add relative node binary path to PATH\n" }, { "from": "human", "value": "set -x PATH $PATH $HOME/.dotfiles/scripts\n\n# tmux\nif status --is-interactive\n if test -z (echo $TMUX)\n tmux-status\n if test $status -eq 0\n exec tmux\n end\n end\nend\n\n# ...
fish
chosen
[ { "from": "system", "value": "Correct path for npm bin\n" }, { "from": "human", "value": "set -gx NPM_PACKAGES \"$HOME/.npm-packages\"\nset -gx JANET_PATH ~/.cache/janet\nset -gx NODE_PATH \"$NPM_PACKAGES/lib/node_modules:$NODE_PATH\"\nset -gx PATH ~/bin ~/npm-packages/bin ~/.cargo/bin ~/.luaroc...
fish
chosen
[ { "from": "system", "value": "Use wider min-width tab titles\n" }, { "from": "human", "value": "function fish_title\n\n\tset -l process $_\n\tset -l god \"\"\n\tset -l on_project \"\"\n\tset -l title \"\"\n\n\tif [ (whoami) = \"root\" -o $process = \"sudo\" ]\n\t\tset god \"⚑ \"\n\tend\n\n\tif s...
fish
chosen
[ { "from": "system", "value": "Remove git branch indicator from the fish prompt: it takes too long to\nreturn and is making the prompt slow.\n" }, { "from": "human", "value": "# Copyright 2017 Renato Utsch \n#\n# This project is released under the Apache 2 license.\n# Licensed under the Apache Li...
fish
chosen
[ { "from": "system", "value": "Fix fish prompt after upgrade\n" }, { "from": "human", "value": "function fish_prompt --description 'Write out the prompt'\n set -l cyan (set_color cyan)\n set -l prefix '$'\n\n printf '\\n'\n set_color cyan\n printf '%s' (prompt_pwd)\n set_color n...
fish
chosen
[ { "from": "system", "value": "Add commands.py as command for fish completions\n" }, { "from": "human", "value": "complete \\\n --no-files \\\n -c run -c runcommand -c runcommands \\\n -a '(runcommands-complete -- \\\n (commandline) \\\n (commandline --current-tok...
fish
chosen
[ { "from": "human", "value": "Add an initialization script for the fish shell.\n" }, { "from": "gpt", "value": "# configure git settings\nif test ! -f ~/.gitconfig\n git config --global user.name \"Alexandru Barbur\"\n git config --global user.email \"root.ctrlc@gmail.com\"\n git config ...
fish
chosen
[ { "from": "system", "value": "Set go alias if latest go rc exists\n" }, { "from": "human", "value": "# global encoding\nset -gx LANG en_US.UTF-8\n\n# global path\nmkdir -p $HOME/bin $HOME/.local/bin\nset PATH $HOME/bin $HOME/.local/bin /usr/local/bin $PATH\n\n# homebrew settings\nfunction check_...
fish
chosen
[ { "from": "system", "value": "Initialize immediately, rather than waiting for an event.\n" }, { "from": "human", "value": "function init --on-event init_rvm\n rvm current 1>/dev/null 2>&1\n\n function __check_rvm --on-variable PWD -d 'Setup rvm on directory change'\n status --is-command-sub...
fish
chosen
[ { "from": "system", "value": "Initialize immediately, rather than waiting for an event.\n" }, { "from": "human", "value": "function init -a path --on-event init_jump\n if not set -q MARKPATH\n set -gx MARKPATH $HOME/.marks\n command mkdir -p $MARKPATH\n end\nend\n" }, { "from": "...
fish
chosen
[ { "from": "human", "value": "Add a plugin for finding a string in files, find + grep\n" }, { "from": "gpt", "value": "# The MIT License\n#\n# Copyright (c) Simon Lees <http://simotek.net/> and contributors\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of ...
fish
chosen
[ { "from": "human", "value": "Add command to tail Laravel logs\n" }, { "from": "gpt", "value": "function laravel-logs\n tail -f -n 450 storage/logs/laravel/*.log | \\\n rg -i \"^\\[\\d{4}\\-\\d{2}\\-\\d{2} \\d{2}:\\d{2}:\\d{2}\\]|Next [\\w]+?\\:\"\nend\n" } ]
fish
chosen
[ { "from": "system", "value": "Fix handling that checkout a remote branch\n" }, { "from": "human", "value": "function peco_checkout_git_branch\n if git_is_repo\n git branch -a | peco | tr -d ' ' | read branch\n echo $branch\n if [ $branch ]\n if contains $branch \"remotes/\"\n ...
fish
chosen
[ { "from": "system", "value": "Set GOPATH/RUSTPATH with global option\n" }, { "from": "human", "value": "# autojump\n[ -f /usr/local/share/autojump/autojump.fish ]; and source /usr/local/share/autojump/autojump.fish\n[ -f /usr/share/autojump/autojump.fish ]; and source /usr/share/autojump/autojum...
fish
chosen
[ { "from": "system", "value": "Add support for ST and ST3 installations inside `~/Applications` on OS X\n" }, { "from": "human", "value": "function subl --description 'Open Sublime Text'\n if test -d \"/Applications/Sublime Text.app\"\n \"/Applications/Sublime Text.app/Contents/SharedSupport/...
fish
chosen
[ { "from": "system", "value": "Print fish logo when fish starts\n" }, { "from": "human", "value": "#\n# ~/.config/fish/config.fish\n# Dotfiles\n#\n\nfish_vi_key_bindings\n\n# Variables\nsource ~/.config/fish/variables.fish\n\n# Termial colors\nset fish_color_autosuggestion 555\\x1eyellow\nset fis...
fish
chosen
[ { "from": "human", "value": "Add function to remove a path from fish_user_paths\n" }, { "from": "gpt", "value": "function remove_from_user_path --description \"Removes the given path from fish_user_paths\"\n set -Ux fish_user_paths (echo $fish_user_paths | sed 's| '$argv[1]'||g')\nend\n" } ]
fish
chosen
[ { "from": "system", "value": "Update output format for status bar\n" }, { "from": "human", "value": "function check_kernel --description='Output message if installed and running kernels are different.'\n set installed (string match --regex '\\d\\d?.\\d\\d?.\\d\\d?' (pacman --query linux))\n # ...
fish
chosen
[ { "from": "human", "value": "Create simplei md5 check utility\n" }, { "from": "gpt", "value": "function md5_file_verify\n if test (md5 $argv[1] | cut -f 2 -d \"=\" | sed 's/ *//') != $argv[2];\n echo \"md5 NOT VERIFIED\"; and return 1;\n end\nend\n" } ]
fish
chosen
[ { "from": "system", "value": "fish: Fix switching from insert mode to normal mode.\n\nFor some reason, force-repaint didn't previously work, but now it does.\n" }, { "from": "human", "value": "function my_vi_key_bindings --description \"Mikel's vi-like key bindings for fish\"\n if contains --...
fish
chosen
[ { "from": "system", "value": "[fish] Add alias to open command in same dir but new tmux pane" }, { "from": "human", "value": "#!/usr/bin/env fish\n\nalias rm=\"trash\"\nalias t=\"todo.sh -d ~/.config/todo/config\"\nalias bk=bookkeeping\nalias activate=\"source ~/.local/venv/bin/activate.fish\"\n...
fish
chosen
[ { "from": "system", "value": "Add source for how to download Chrome extensions from CLI\n" }, { "from": "human", "value": "function chrome-dl --description \"Download Chrome extensions, given their IDs\"\n for extension_id in $argv\n curl --output \"$extension_id.zip\" \\\n --locatio...
fish
chosen
[ { "from": "system", "value": "Add local bins for cabal installed user binaries\n" }, { "from": "human", "value": "# Make sure ssh-agent can be reached\nset -xg SSH_AUTH_SOCK \"$XDG_RUNTIME_DIR/ssh-agent.socket\"\n\n# Use vim for git\nset -xg VISUAL \"vim\"\n\n# T(he )tmux session\nalias ttmux \"...
fish
chosen
[ { "from": "system", "value": "Remove emoji from timestamp and update math for 3\n\nRemove the emoji from the timestamp; was causing word-wrap issues due to\ncharacter width problems\n\nUpdate the math calls to be fish 3 compatible\n" }, { "from": "human", "value": "function __paradox_command_dur...
fish
chosen
[ { "from": "system", "value": "Improve OS detection, adding Windows Subsystem for Linux\n" }, { "from": "human", "value": "function check_system -d 'Display short system name (OSX, Linux, Win, NA)'\n set -l osname (uname 2>/dev/null); or set -l osname (/usr/bin/uname 2>/dev/null) # fix for ...
fish
chosen
[ { "from": "system", "value": "Set a browser in my terminal\n" }, { "from": "human", "value": "set PATH ~/npm/bin $PATH\nset EDITOR vim\nset VISUAL vim\nset fish_greeting \"\"\n\n# Kill all running containers.\nalias dockerkill='docker kill (docker ps -q)'\n\n# Delete all docker images and contai...
fish
chosen
[ { "from": "system", "value": "Switch to non-deprecated redirection syntax\n" }, { "from": "human", "value": "function randombase64 -d \"Generate random base64 string\"\n set -l n $argv[1]; test -z $n; and set n 16\n # https://en.wikipedia.org/wiki/Birthday_problem#Probability_table\n dd if=/d...
fish
chosen
[ { "from": "system", "value": "Replace `available` usage with `type -q`\n" }, { "from": "human", "value": "function __is_a_bundled_executable\n if available bundle\n set -l bindir (command bundle exec ruby -e \"puts Gem.bindir\")\n test -f \"$bindir/$argv\"\n else\n return 1\n end\nen...
fish
chosen
[ { "from": "system", "value": "[fish] Allow Ctrl-d to exit a shell\n\n- Haven't been pressing it accidentally of late and it's a convenient\n way to quit the shell\n" }, { "from": "human", "value": "function fish_user_key_bindings\n\tbind --erase \\cd\n\tbind \\e\\[A 'history --merge ; up-or-sea...
fish
chosen
[ { "from": "system", "value": "Make fzf use --ansi by default (for colored input & whatnot)\n" }, { "from": "human", "value": "# environment variables\nset -gx GOPATH ~/.go\nset -gx fish_user_paths $GOPATH/bin\nset -gx EDITOR nvim\nset -gx FZF_DEFAULT_COMMAND 'ag --hidden --ignore .git -l -g \"\"...
fish
chosen
[ { "from": "system", "value": "Add a fish function to test psci\n" }, { "from": "human", "value": "set -x PATH $PATH $HOME/.dotfiles/scripts\n\n# aliases\nalias vim 'nvim'\nalias tmux-reload 'tmux source-file ~/.tmux.conf'\nalias git 'hub'\nalias bnode 'babel-node'\nalias em 'emacs'\nalias psp 'p...
fish
chosen
[ { "from": "system", "value": "Support colon separated environmental variables\n" }, { "from": "human", "value": "function dotfile::append_env\n if not contains $argv[1] $argv[2]\n set --append $argv[1] $argv[2]\n end\nend\n\nfunction dotfile::prepend_env\n if not contains $argv[1...
fish
chosen
[ { "from": "system", "value": "Add support for bucket regions\n" }, { "from": "human", "value": "function create-bucket --argument-names name\n print-status s3/create-bucket $name\n aws s3api create-bucket --bucket $name\nend\n" }, { "from": "gpt", "value": "function create-buck...
fish
chosen
[ { "from": "system", "value": "Add python pip dir to path\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 $PATH\n\nmkdir -p ~/bin $NPM_DIR/bin\n\nset -gx fish_greeting \"\"\n\ntest ...
fish
chosen
[ { "from": "system", "value": "[nix/fish] Set fish_greeting in k8s shells\n" }, { "from": "human", "value": "command -sq fluidsynth; and function playmidi\n fluidsynth -i ~/lib/arachno-soundfont/Arachno\\ SoundFont\\ -\\ Version\\ 1.0.sf2 $argv\nend\n\n\ncommand -sq kitty; and function icat\n ...
fish
chosen
[ { "from": "human", "value": "Add cool pip save helper\n" }, { "from": "gpt", "value": "function pip_save\n set -l reqs \"requirements.txt\"\n pip install $argv[1]\n set freeze (pip freeze | grep $argv[1])\n set tfile (mktemp)\n cp $reqs $tfile\n echo $freeze >> $tfile\n uniq...
fish
chosen
[ { "from": "system", "value": "Add npm to the path again\n" }, { "from": "human", "value": "set fish_greeting \"\"\nset LANG en_GB.UTF-8\nset PATH ~/bin $PATH\nset EDITOR nvim\nset VISUAL nvim\n\n# Kill all running containers.\nalias dockerkill='docker kill (docker ps -q)'\n\n# Delete all docker ...
fish
chosen
[ { "from": "system", "value": "Add command to create folder for fasd during its setup\n" }, { "from": "human", "value": "#\n# Maintains a frequently used file and directory list for fast access.\n#\n\n# Avoid config if requirements are not found.\nif not type -q fasd\n exit\nend\n\n#\n# Tweaks\n...
fish
chosen
[ { "from": "system", "value": "Make sure the ruby gem bin dir exists\n" }, { "from": "human", "value": "mkdir -p ~/bin ~/npm/bin ~/.cargo/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 EDITOR nvim\n...
fish
chosen
[ { "from": "system", "value": "Add an alias vimdiff -> nvim -d\n" }, { "from": "human", "value": "set PATH ~/bin ~/npm/bin $PATH\nset EDITOR nvim\nset VISUAL nvim\nset fish_greeting \"\"\n\n# Kill all running containers.\nalias dockerkill='docker kill (docker ps -q)'\n\n# Delete all docker images...
fish
chosen
[ { "from": "system", "value": "Add `open-file-info` alias to show the number of current open files descriptors\n" }, { "from": "human", "value": "function system-info -d 'Print the system information'\n\tfree -m | awk 'NR==2{printf \"Memory Usage: %s/%sMB (%.2f%)\\n\", $3,$2,$3*100/$2 }'\n\tdf -h...
fish
chosen
[ { "from": "system", "value": "Set FZF_DEFAULT_COMMAND to use rg.\n" }, { "from": "human", "value": "set fish_greeting ''\n\n# PATH\nset PATH '/usr/local/sbin' $PATH\nset PATH '/usr/local/bin' $PATH\nset PATH \"$HOME/.cargo/bin\" $PATH\nset PATH \"$HOME/bin\" $PATH\n\n# Environment variables - ht...
fish
chosen
[ { "from": "system", "value": "Add a couple of git aliases\n" }, { "from": "human", "value": "# gvm\n# https://github.com/moovweb/gvm\nbass [[ -s \"$HOME/.gvm/scripts/gvm\" ]]\nbass source \"$HOME/.gvm/scripts/gvm\"\n\n# remove greeting\nset fish_greeting\n\n# Set aliases\nalias k \"kubectl\"\nal...
fish
chosen
[ { "from": "system", "value": "Make sed syntax bsd compatible\n" }, { "from": "human", "value": "function psource -d 'Execute POSIX shell script in the current shell context'\n /bin/sh -c '. \"$@\"; XDG_CONFIG_HOME=\"${0%/*/*}/etc\" \"$0\" -c \"set -gxL\" | sed -e \"/^\\(HOME\\|LC_CTYPE\\|PATH\\...
fish
chosen
[ { "from": "system", "value": "Improve `itune`'s `--help` output with usage info\n" }, { "from": "human", "value": "function itunes -d \"Control iTunes. Use -h or --help for a more detailed description.\"\n if [ (count $argv) -gt 0 ]\n set -l opt $argv[1]\n switch $opt\n case launch p...
fish
chosen
[ { "from": "system", "value": "Fish: Set locale to British English\n\nWith this commands like ls show dates in the correct format (i.e. day\nbefore month)\n" }, { "from": "human", "value": "# Neovim\nset --local neovim_guis \\\n\t/Applications/FVim.app/Contents/MacOS/FVim \\\n\t/Applications/gone...
fish
chosen
[ { "from": "system", "value": "Use wheel for global requirements if it's enabled.\n" }, { "from": "human", "value": "function __vfext_global_requirements --on-event virtualenv_did_create\n if test -f $VIRTUALFISH_HOME/global_requirements.txt\n pip install -r $VIRTUALFISH_HOME/global_req...
fish
chosen
[ { "from": "system", "value": "Remove grep colors. Its is obsolete\n" }, { "from": "human", "value": "# Language settings\nset -x LC_ALL en_US.UTF-8\nset -x LC_CTYPE en_US.UTF-8\n\n# respect local bins\nset -x PATH \"./bin\" $PATH\n\n# editor\nset -x EDITOR \"nvim\"\n\n# LESS with colors\n# from ...
fish
chosen
[ { "from": "system", "value": "Initialize rbenv when starting a fish shell\n" }, { "from": "human", "value": "set --export EDITOR vim\nset --export PATH /usr/local/bin $PATH\n\nset fish_color_command white\nset fish_color_autosuggestion yellow\nset fish_pager_color_description yellow\nset fish_co...
fish
chosen
[ { "from": "system", "value": "Add alias for the thefuck\n" }, { "from": "human", "value": "direnv hook fish | source\nopam config env | source\n\nset brew_rbenv \"/usr/local/var/rbenv/shims\"\n\nset -gx EDITOR vim\nset -gx GIT_EDITOR vim\nset -gx RBENV_ROOT /usr/local/var/rbenv\nset -gx PYENV_RO...
fish
chosen
[ { "from": "system", "value": "Add local executables to PATH\n" }, { "from": "human", "value": "# gvm\n# https://github.com/moovweb/gvm\nbass [[ -s \"$HOME/.gvm/scripts/gvm\" ]]\nbass source \"$HOME/.gvm/scripts/gvm\"\n\n# remove greeting\nset fish_greeting\n\n# Set aliases\nalias k \"kubectl\"\n...
fish
chosen
[ { "from": "human", "value": "Add prompt function for fish shell\n\nPrompt is green if last command exit code was 0; red othewrwise\nPrompt displays branch name if in a git repository\n" }, { "from": "gpt", "value": "function fish_prompt --description 'Write out the prompt'\n\tset exit_code $stat...
fish
chosen
[ { "from": "system", "value": "Add hub alias to fish config\n" }, { "from": "human", "value": ". ~/.config/fish/aliases.fish\n. ~/.config/fish/abbr.fish\n\neval (python -m virtualfish compat_aliases)\n\nset -x PATH /usr/local/bin $PATH\nset -x EDITOR vim\n\n# GIT PROMPT CONFIG\nset -g __fish_git_...
fish
chosen
[ { "from": "system", "value": "Use colors in grep (dunno how it was working previously)\n" }, { "from": "human", "value": "# Set path\nset -x PATH $PATH /Users/sahil/Documents/dev/android/adt/sdk/platform-tools /Users/sahil/Documents/dev/android/adt/sdk/tools /usr/local/heroku/bin /usr/local/bin ...
fish
chosen
[ { "from": "system", "value": "Use \"2>\" to redirect stderr instead of the deprecated \"^\"\n\nSee this GH issue for more information:\n\nhttps://github.com/fish-shell/fish-shell/issues/4394\n" }, { "from": "human", "value": "bind \\cg '__ghq_crtl_g'\nif bind -M insert >/dev/null ^/dev/null\n ...
fish
chosen
[ { "from": "system", "value": "Remove unnecessary trailing slash from a PATH item\n" }, { "from": "human", "value": "set PATH /usr/local/sbin $PATH\n\n# Perl\nset -x PERL_MM_OPT \"INSTALL_BASE=$HOME/perl5\"\neval (perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)\n\n# Android tools\nset PATH ~/Library/A...
fish
chosen
[ { "from": "human", "value": "Add fish function to scp commits\n\nI often need to scp a commit from one machine to another. This helper\nshould streamline that process.\n" }, { "from": "gpt", "value": "function gscp -d \"Create patch for head and scp it\"\n git show HEAD -U999999 > /tmp/head.pat...
fish
chosen
[ { "from": "system", "value": "conf: Fix setting of environment variables\n" }, { "from": "human", "value": "set -l rbenv_root (rbenv root)\nset -U fish_user_paths $fish_user_paths $rbenv_root/shims\nset -xg RBENV_SHELL fish\ncommand mkdir -p $rbenv_root/{shims,versions}\ncommand rbenv rehash 2>/...
fish
chosen
[ { "from": "human", "value": "Set fish terminal title and tmux window name\n" }, { "from": "gpt", "value": "function fish_title\n # $argv is always the last command, but fish_title is called before and after\n # the command executes, so this conditional uses just the pwd\n if test $_ = \"fish\...
fish
chosen
[ { "from": "system", "value": "Remove debug flag from the default EDITOR\n" }, { "from": "human", "value": "# Atom\nset -gx EDITOR 'atom -wd'\nset -gx ATOM_REPOS_HOME /Projects/2014/ryansobol\n\n# chruby\nsource /usr/local/share/chruby/chruby.fish\nsource /usr/local/share/chruby/auto.fish\n\n# vi...
fish
chosen
[ { "from": "system", "value": "Switch \"dir\" from alias to function\n" }, { "from": "human", "value": "alias dir=\"ls -l\"\n\n# https://github.com/fish-shell/fish-shell/blob/master/share/functions/__fish_git_prompt.fish\nset -g __fish_git_prompt_showupstream \"auto\"\nset -g __fish_git_prompt_sh...
fish
chosen
[ { "from": "system", "value": "Make stderr redirection compatible with Fish 3.0.\n" }, { "from": "human", "value": "# name: Gianu\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...
fish
chosen
[ { "from": "system", "value": "fish: Reformat none zero exit status\n" }, { "from": "human", "value": "function fish_prompt --description 'Compose fish prompt'\n\n set -l last_status $status\n\n set -l status_string ''\n if test $status -ne 0\n set status_string (set_color red --b...
fish
chosen
[ { "from": "human", "value": "Add function to check if a user has MFA enabled\n" }, { "from": "gpt", "value": "function mfa-enabled --argument user\n trace (status --current-filename) $argv\n\n if empty \"$user\"\n usage mfa-enabled '<user>'\n return (false)\n end\n\n co...
fish
chosen
[ { "from": "system", "value": "Fix fish greeting when autosuggest is bold.\n\nSee also #39" }, { "from": "human", "value": "function fish_greeting -d \"what's up, fish?\"\n set_color $fish_color_autosuggestion[1]\n uname -npsr\n uptime\n set_color normal\nend\n" }, { "from": "gpt", ...
fish
chosen
[ { "from": "human", "value": "Add a git reset wrapper\n" }, { "from": "gpt", "value": "function grs --description=\"git reset\"\n set -l arguments\n\n set -l cmd \"command git diff --cached --name-only\"\n\n if test (count $argv) -gt 0\n set arguments (gish find -c $cmd $argv)\n\n if tes...
fish
chosen
[ { "from": "system", "value": "Update fish configs and functions.\n" }, { "from": "human", "value": "function update-all -d \"Update macOS software, Homebrew brews & casks, gems, packages (apms, npms), repos\"\n # macOS software updates\n update-os\n # Homebrew brews updates\n update-brews\n ...
fish
chosen
[ { "from": "human", "value": "Add script for bumping project version\n" }, { "from": "gpt", "value": "#! /usr/bin/env fish\n\n# Load utility functions\nset utilsFilePath (dirname (status -f))\"/utils.fish\"\nsource \"$utilsFilePath\"\n\nset newVersion \"$argv[1]\"\n\nif test -z \"$newVersion\"\n ...
fish
chosen
[ { "from": "system", "value": "Use `available` to test if python2 is available\n" }, { "from": "human", "value": "# Use python2 if found, otherwise fallback to python.\nfunction _python\n if which python2\n python2 $argv\n else\n python $argv\n end\nend\n" }, { "from": "gpt", ...
fish
chosen
[ { "from": "system", "value": "Make stderr redirection compatible with Fish 3.0.\n" }, { "from": "human", "value": "# Display git branch and dirty bit and current time on the right \n\nfunction _git_branch_name\n echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')\nend\n\...
fish
chosen
[ { "from": "system", "value": "Use topgrade to update everything\n" }, { "from": "human", "value": "function sync\n # Early sudo because it's needed later.\n sudo echo \"Updating everything!\"\n\n yay\n\n cd ~/.config/nvim\n git pull --rebase --autostash\n ./sync.sh\n cd -\nend\n" }, {...
fish
chosen
[ { "from": "human", "value": "Add fish prompt to source control.\n" }, { "from": "gpt", "value": "function fish_prompt\n set stat $status\n if test $stat -ne 0\n printf \"%s[%s]%s\" (set_color red) \"$stat\" (set_color normal)\n end\n\n set_color yellow\n printf '%s' (whoami)\n set...
fish
chosen
[ { "from": "system", "value": "Change fzf marker to bold checkmark\n" }, { "from": "human", "value": "# fzf and fzf.fish\nif command --query fzf\n # fzf.fish\n fzf_configure_bindings --directory=\\cf --git_log=\\cl --git_status=\\cs\n set --global fzf_fd_opts --follow --hidden --exclude=Docume...
fish
chosen
[ { "from": "system", "value": "Fix output directory for recording\n" }, { "from": "human", "value": "function videograb --description=\"Records video of screen selection in sway\"\n # TODO: stop recording when recv SIGINT\n\n set --local record true\n function record_stop_handler --on-signal I...
fish
chosen
[ { "from": "human", "value": "Add a fold string utility\n" }, { "from": "gpt", "value": "function fold_string\n set -l fold_replace $argv[1]\n set -l fold_length $argv[2]\n if [ (string length $argv[3]) -le $fold_length ]\n echo $argv[3]\n else\n set -l prefix_length (math $fold_length ...
fish
chosen
[ { "from": "system", "value": "Make all chans moderated, as acess is cross-chan\n" }, { "from": "human", "value": "function sudoer -d 'Check if user is admin'\n # channels are only moderated if they have a file in sudoers.d\n if test -f etc/sudoers.d/$CHAN\n # check global moderator ...
fish
chosen
[ { "from": "system", "value": "Add sbin path and newrelic alias\n" }, { "from": "human", "value": "set -x COLOR_THEME dark\nset -x EDITOR vim\nset -x GOPATH $HOME/Projects/go\nset -x LANG en_US.UTF-8\nset -x LC_ALL en_US.UTF-8\nset fish_greeting\nset fish_key_bindings fish_vi_key_bindings\n\nset ...
fish
chosen
[ { "from": "system", "value": "[alias] Add shortcut to local copy of the RPL" }, { "from": "human", "value": "#!/usr/bin/env fish\n\nalias rm=\"trash\"\nalias t=\"todo.sh -d ~/.config/todo/config\"\nalias bk=bookkeeping\nalias activate=\"source ~/.local/venv/bin/activate.fish\"\n\n# Navigation\na...
fish
chosen
[ { "from": "human", "value": "Add a fish function to add a patch\n" }, { "from": "gpt", "value": "function gap --description=\"git add patch\"\n set -l arguments\n\n set -l cmd \"command git diff --name-only\"\n\n if test (count $argv) -gt 0\n set arguments (gish find -c $cmd $argv)\n\n ...
fish
chosen
[ { "from": "human", "value": "Add a `git commit -m` wrapper\n" }, { "from": "gpt", "value": "function gcm --description=\"git commit with message\"\n if test (count (command git status --porcelain | command grep \"^[^ ?]\")) -eq 0\n set_color yellow\n echo \"Nothing to commit...\"\n set...
fish
chosen
[ { "from": "system", "value": "Update postgres bin for 9.6\n" }, { "from": "human", "value": "append-to-path ~/projects/git-toolbelt\n\nset -gx WORKON_HOME ~/.virtualenvs\nset -gx PYTHONPATH ~/.local/bin\n\nappend-to-path ~/.local/bin\nappend-to-path /Applications/Postgres.app/Contents/Versions/9...
fish
chosen
[ { "from": "system", "value": "Test if config file is missing\n" }, { "from": "human", "value": "#\n# __bh_check_bashhub_installation.fish\n# Should only be sourced once following installation.\n#\n\n# Small function to check our Bashhub installation.\nfunction __bh_check_bashhub_installation\n ...
fish
chosen
[ { "from": "human", "value": "Add a session mangement script for my password manager\n" }, { "from": "gpt", "value": "set SESSION_FILE ~/.bws-session\n\nfunction bws\n if test -e $SESSION_FILE\n set -x BW_SESSION (cat $SESSION_FILE)\n end\n\n if ! bw status | grep unlocked > /dev/null\n ...
fish
chosen
[ { "from": "system", "value": "Use long options, move helper functions from fish_greeting\n" }, { "from": "human", "value": "function fish_prompt\n # Start ohmyfish-batman theme default prompt\n test $status -ne 0;\n and set -l colors 600 900 c00\n or set -l colors 333 666 aaa\n\n set -l...
fish
chosen
[ { "from": "system", "value": "Use $process instead of $_ to make it easier to read\n" }, { "from": "human", "value": "function fish_title\n\n\tset -l process $_\n\tset -l god \"\"\n\tset -l on_project \"\"\n\tset -l title \"\"\n\n\tif [ (whoami) = \"root\" -o $_ = \"sudo\" ]\n\t\tset god \"⚑ \"\...
fish
chosen
[ { "from": "system", "value": "Configure fish to export explicit PATH" }, { "from": "human", "value": "set -x TERM screen-256color\nset -x EDITOR nano\n\nset PATH $HOME/.rbenv/shims $PATH\nrbenv rehash >/dev/null ^&1\n\nset PATH /usr/local/share/npm/bin $PATH\n\nalias p project\n\nset fish_greeti...
fish
chosen
[ { "from": "human", "value": "Add fish function to terminate a stuck terminating k8s namespace\n" }, { "from": "gpt", "value": "function terminateNS --argument-names ns --description \"Delete a stuck k8s terminating namespace\"\n set NAMESPACE $ns\n kubectl proxy &\n kubectl get namespac...
fish
chosen