• Stars
    star
    125
  • Rank 280,646 (Top 6 %)
  • Language
    Shell
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Brett's Fish Files

A collection of configuration files and functions for the Fish shell. These would be installed in ~/.config/fish/, though I don't recommend overwriting your current setup wholesale. Pick and choose, use this repo as examples for your own exploration.

The folders

  • bash_scripts: some utilities that were too much trouble to port from Bash and work just as well run with hashbangs. They just need to be in the $PATH (some commands reference my local path, ~/scripts/fish, which will need updating).

  • completions: various completion configurations for custom commands.

  • custom: some files I source at login (from config.fish), mostly shared functions I think I need to have in memory (as opposed to autoloaded), and some aliases that don't make great functions.

  • functions: the mother lode. All of my favorite commands (and some experimental ones). Most have a description on the function declaration, so you can see it in source or by running the describe command that you'll find in this folder (which essentially runs functions -Dv, but prettier).

COMPLETIONS NOTE: for the file extension completion function to work, it needs to be able to find the filecomplete.rb script located in the bash_scripts directory. Edit functions/__complete_extension.fish to point to that file on your system.

All the functions

  • 64enc: encode a given image file as base64 and output css background property to clipboard
  • 64font: encode a given font file as base64 and output css background property to clipboard
  • 64svg: encode a given svg file as base64 and output css background-image property to clipboard
  • __auto_dir: if command fails see if it's a directory or local executable
  • __best_pager: Choose the best available pager (opinionated)
  • __complete_extension:
  • __exec_available: test if command is available
  • __expand_path: commandline function to expand str/str using fasd and fzf
  • __f_dir_regex:
  • __fuzzy_cd: n/a
  • __human_time: Humanize a time interval for display
  • __is_text: Test if a file is plain text
  • __ls_text_files: List all text files in current directory
  • __prev_token: Get the previous token on the command line
  • __re_extension: remove extension from word under/before cursor
  • __regex_from_args: Helper to create greedy regular expression from multiple arguments
  • __unfuck_previous_command:
  • _tide_item_doing_active:
  • _tide_item_doing_now:
  • _tide_item_message:
  • _tide_item_ssh_badge:
  • abbrs: Search abbreviations
  • ack: ack defaults, ~/.ackrc for more
  • acorn: Open Acorn.app with optional file(completion available)
  • add_user_path: Shortcut to add a user path
  • affd: Open Affinity Designer with optional file (completion available)
  • afff: Open Affinity Photo with optional file (completion available)
  • ag: Silver Surfer defaults, smart case, ignore VCS
  • alpha: Open ImageAlpha with optional file (completion available)
  • ax: Make file executable
  • badge: Set iTerm session badge
  • bak: Back up a file by moving or copying to FILE.bak
  • be:
  • bid: Get bundle id for app name
  • bld: Run howzit build system
  • box: Draw a box around text.
  • browser: Write output to a temp HTML file and open in default browser
  • bunches: Edit Bunches in Sublime
  • c: n/a
  • calc: CLI calculator
  • cat: Use bat instead of cat unless it's a Markdown file, then use mdless
  • cbp: ClipBoard Preview
  • cd_fuzz: n/a
  • cdb: Open broot with folders only
  • cdd: Choose cd dir from menu (fzf)
  • cdr: cd to a recently visited directory
  • cdt: Change dir based on TagFiler tags
  • chrome: Open Google Chrome with optional file (completion available)
  • cl: copy output of last command to clipboard
  • clip: Copy file to clipboard
  • code: n/a
  • copy:
  • corner_print:
  • cpu:
  • cpwd: Copy the current directory path to the clipboard
  • cr: Open CodeRunner
  • crush: pngcrush
  • cursor: Show or hide the terminal cursor
  • dadjoke: Get a dad joke from icanhazdadjoke.com
  • dash: Open argument in Dash
  • days_in: get the number of days in a given month/year
  • ddg: search duckduckgo
  • degit: Remove all traces of git from a folder
  • desc: Print the description of a Fish function.
  • describe: Show description for function
  • dhelp: alias dhelp open "dash://fish:"(urlenc $argv)
  • dirfor: get origin directory for running process
  • dman: Open man page in Dash
  • dockcomm: commit a docker image
  • docx2mmd: Convert docx to markdown: docx2md [source] [target]
  • eds: Shortcut for editscript
  • er: edit recent file using fasd and fzf
  • esc: Ruby cgi escape
  • eschtml: Ruby cgi HTML escape
  • extract: unarchive any file type
  • f: Open directory in Finder with jump shortcuts
  • fallback: allow a fallback value for variable
  • farch: Test Architecture of Framework
  • fasdfzf: Helper function to return a file via fasd and fzf
  • ffdir: fuzzy find a directory, pass root dir and sequential search strings
  • fffile: fuzzy find a file, pass root dir and sequential search strings
  • ffmark: fuzzy find a jump mark
  • filetype: Returns the kMDItemContentTypeTree for a file
  • findgist: select gist from list and display contents
  • findgistid: select gist from list and display contents
  • finish: Finish last unfinished task by search
  • fire: Open Firefox with optional file (completion available)
  • fish_prompt: Write out the prompt
  • fix: Fix up last command with search/replace
  • flush: Flush DNS cache
  • fo: Open file using jump shortcuts and fuzzy matching
  • fp: Find and list processes matching a case-insensitive fuzzy-match string
  • ft: A shortcut for mdfinding tagged items system-wide
  • fuck: Correct your previous console command
  • g2: Fish "jump" replacement with fuzzy subdirectory matching
  • gc: n/a
  • geminfo: Get info for a gem with partial name matching
  • geminstall: install a gem with fuzzy search
  • gemuninstall: Uninstall a gem with partial name matching
  • get_ext: Get the file extension from the argument
  • get: alias get=git clone
  • getignore: Get ignore file from gitignore.io and save to .gitignore
  • getignores: Pull gitignore.io list of available .gitignore files
  • gg: Commit pending changes and quote all args as message
  • gitar: Automatically add new and remove deleted files from the git index
  • gitrelease: Create a git release
  • gmine: Resolve git conflicts with mine
  • gsearch: Grep git commit history
  • gt: jump to top level of git repo
  • gtheirs: Resolve git conflicts with theirs
  • halp: Get help for any builtin, alias, or function
  • hook: n/a
  • hooks: Return a list of files hooked to target (Hook.app)
  • howlong: alias howlong=echo $CMD_DURATION
  • hs: Search, select, and exec from history
  • idea: Record an idea with doing
  • imdown: Test for internet connection and notify when it comes up
  • imgsize: Quickly get image dimensions from the command line
  • index_of: return the 1-based index of the first argument in remaining arguments
  • ip: Get external IP address
  • ips: Display all ip addresses for this host
  • is: test if given file is of a file type. is TYPE FILE
  • istext: test if given file is plain text
  • jfind: jtag: search for tags
  • jothers: jtag: List tags of other posts containing (all) tags
  • js: lint with jslint
  • jump_fasd: n/a
  • jump: Fish "jump" replacement with subdirectory matching
  • lb: Select file in LaunchBar, fall back to the current directory
  • lbash: launch bash login shell
  • license:
  • lld: n/a
  • lno: Print file with line numbers
  • lsgrep: Wildcard folder/file search
  • lsregister:
  • lsz: ls for inside of compressed archives
  • lt: List directory from oldest to newest
  • ltr: List directory from newest to oldest
  • m.: Check if the current directory is bookmarked
  • mack: ack for markdown
  • md: n/a
  • mdgrep: alias mdgrep=rg -S --type markdown
  • mem:
  • mkdir: mkdir with subdirs, option to cd after creating
  • mmdc: Open MultiMarkdown Composer with optional file (completion available)
  • nope: echo "nope"
  • o: Shortcut to open an app from the command line
  • optim: Open ImageOptim with optional file (completion available)
  • pbgist: private gist from clipboard
  • pbgistp: private gist from clipboard
  • pbp: Pasteboard Preview
  • pbpmd: Pasteboard Markdown Preview
  • percentof: Quick calculation for sale discounts
  • percentoff: Quick calculation for sale discounts
  • pg: alias pg=ps -ax | grep -i
  • pless: cat a file with pygments highlighting
  • pman: Display a man page as a PostScript PDF in Preview.app
  • prev: Open Preview with optional file (completion available)
  • preview: Preview text files using fzf and bat
  • prioritize: set a numeric prefix on a file for sorting
  • prompt_message:
  • r: Run Reiki via bash
  • raise: Like ruby raise, but for fish
  • rule: Print a horizontal rule
  • rulem: Print a horizontal rule with message
  • rvm: n/a
  • serve: Start a local server for the current directory, open in browser
  • shellesc: Ruby shellwords escape
  • shellunesc: Ruby shellwords unescape
  • shellwords: Split a string like a shell would
  • shorten: Truncate every line of input to specified width
  • shortest: Return the shortest string in array
  • showalias: Show an alias
  • sign: alias sign=codesign --force --verbose --sign 'Developer ID Application' -o runtime
  • skylight: alias skylight=skylighting -n -t ~/styles/kde/breeze-dark.theme
  • spell: Get spelling options from aspell
  • spellcheck: Check all Markdown files in git repo (recursive)
  • spellf: Get spelling options from aspell
  • src: reload config file
  • sublp: Open a Sublime Text project (completion available)
  • sum: Take a list of numbers and return the sum
  • td: [Create and] open project todo
  • tmj: For use with my tmux utility (bash_scripts/tm)
  • todos: alias todos=ack --nobreak --nocolor "(TODO|FIXME):"|sed -E "s/(.:[[:digit:]]+):.((TODO|FIXME):.)/\2 :>> \1/"|grep -E --color=always ":>>.:\d+"
  • tower: Open Tower for directory (default CWD)
  • tp: Open TaskPaper with optional file (completion available)
  • unbak: remove bak extension
  • uncolor: Remove color codes from string
  • unesc: Ruby cgi unescape
  • up: cd to a parent folder with fuzzy matching
  • updown: cd to a directory and then fuzzy search its tree
  • urlenc: url encode the passed string
  • v: vim via fasd and fzf
  • verify: alias verify=codesign --deep -vv --verify
  • warn: Echo to STDERR
  • watchthis: Watch for changes in the current directory and execute command
  • xc: Open Xcode with optional file (completion available)
  • yep: echo "yep"
  • yn: Simple pass/fail test for given command
  • z: Custom fasd cd with fzf
  • zipup: exports a clean copy of the current git repo (master) to a zip file

Utility functions

  • __by_length:
  • __ff_dir_regex:
  • __ff_dir_to_regex:
  • __should_na:
  • __sort_by_length:
  • append_slash: append a slash to each line/argument if needed
  • map:
  • remove_empty: removes empty elements from an array
  • return_array: Echo out an array one line at a time
  • shorten_home: substitutes $HOME with ~
  • shortest_common:
  • slash_if_dir: Add trailing slash if directory
  • slugify:
  • to_slug:
  • trim_pwd: removes the current working directory from an array of paths

I'll update these every once in a while. If you're digging through and spot a problem, a stupid mistake, or something that could just plain be done better, please add an issue and let me know!

More Repositories

1

doing

Ruby
1,036
star
2

mdless

Ruby
787
star
3

Slogger

Social logging script for Day One
Ruby
762
star
4

KeyBindings

DefaultKeybindings.dict for Mac OS X
HTML
689
star
5

cheaters

Customizable cheat sheet system for OS X
HTML
461
star
6

popclipextensions

Brett's PopClip Extensions
Python
431
star
7

MarkedCustomStyles

Custom Style Repository for Marked2.app
CSS
416
star
8

QuickQuestion

A simple, text-based system for building an easily-searchable knowlegebase on OS X. CLI, LaunchBar and Alfred included.
Shell
188
star
9

Brett-s-TextExpander-Snippets

General-use snippets for TextExpander on Mac
PHP
129
star
10

OTask

Ruby CLI for OmniFocus
Ruby
122
star
11

na

Bash function for displaying next actions in plain-text files per project directory
Shell
113
star
12

nvremind

A scheduled background task to scan nvALT notes for @reminder() tags and trigger notifications based on dates.
Ruby
98
star
13

bunch

Documentation repository for Bunch.app
Ruby
88
star
14

vitag

Ruby
86
star
15

hookapp

HTML
81
star
16

Pinboard-to-OpenMeta

Saves Pinboard bookmarks as local webloc files on a Mac. Can add thumbnails and save PDF's, with external apps. Works with Tags.app or the OpenMeta cli utility.
Ruby
79
star
17

gather-cli

Swift
73
star
18

JekyllPlugins

A small collection of (often lame) Jekyll plugins
SCSS
65
star
19

ubersicht-widgets

CoffeeScript
62
star
20

niftymenu

JavaScript
59
star
21

hook_goodies

AppleScript
59
star
22

snibbets

Ruby
46
star
23

where

Shell
38
star
24

BetterTouchTool-Widgets

Ruby
38
star
25

searchlink

Ruby
34
star
26

howzit_old

Ruby
32
star
27

ExtraInfoPlus

AppleScript
32
star
28

blogsmith-tmbundle

TextMate bundle for blogging platforms with poor/no xmlrpc support
Ruby
31
star
29

bookmark-cli

CLI for OS X that returns a base64 string of bookmark data for a file, or locates a file given a base64 string
Objective-C
31
star
30

popupsCSS

iOS-esque popup styles
28
star
31

jquery-tldr

JavaScript
26
star
32

dotfiles

Various config files
Shell
24
star
33

tagbak

Ruby
24
star
34

nvWikiLink

Universal system for creating plain text wiki links to nvALT notes
Ruby
22
star
35

sidecar

Sidecar jacket for Simplify
HTML
19
star
36

jtag

Ruby
19
star
37

coughbutton

An iPhone-based cough button for your Mac using PHP and MuteMyMic
JavaScript
18
star
38

delimport-pinboard

Index your Pinboard bookmarks using Spotlight on Mac OS X.
Objective-C
18
star
39

CodeReminder

Ruby
17
star
40

MarkdownURLs.safariextension

The source for the TabLinks Safari Extension
JavaScript
16
star
41

na_gem

a command line tool for adding and listing project todos
Ruby
16
star
42

mmd2cheatset

Ruby
16
star
43

howzit

Ruby
14
star
44

notehub

Ruby
14
star
45

reiki

Shell
13
star
46

Character-pair-autocompletion

Character pair autocomplete is now possible on any Mac app using these TextExpander custom snippets including on selected text.
13
star
47

ttscoff.github.com

Brett Terpstra's GitHub website
CSS
12
star
48

bunchcli

Ruby
12
star
49

Twilight2.tmTheme

A mod of the classic Twilight theme for TextMate and Sublime Text
11
star
50

starter-book

An online book.
11
star
51

Sublime-Bunch

Bunch is a Mac automation app that runs on plain text files with the extension `.bunch`. It has its own "language", and this package provides syntax highlighting for Bunch files, as well as light/dark color schemes, snippets for common commands, and completion for app names.
Python
10
star
52

podtagger

Automated ID3 tagging for podcasts
Ruby
9
star
53

VSCode-Bunch

9
star
54

TextBuddyScripts

JavaScript
9
star
55

TabLinks

HTML
8
star
56

loadbar

CoffeeScript
8
star
57

LuckyCharms-tmTheme

A light theme for Sublime Text, VS Code, and Vim
Vim Script
8
star
58

fuzzy_cd

Shell
6
star
59

MailMateMate.mmBundle

Ruby
6
star
60

quix-mann

Merlin Mann's Custom Quix Commands
6
star
61

bookmarklets

Repo to run bookmarklets from inline scripts on github.com
JavaScript
5
star
62

omf-fuzzy_cd

Shell
4
star
63

EditScript

Ruby
3
star
64

itunescontrol-tmbundle

iTunes Controller for TextMate, highly experimental
Ruby
2
star
65

Dictionary-tmbundle

Various dictionary, spellchecking and thesaurus commands for TextMate
2
star
66

omf-packages

1
star
67

Marked

Marked.app - MultiMarkdown Preview Everywhere
1
star
68

homebrew-thelab

Ruby
1
star
69

htmlexperiments

Just dicking around
1
star