Skip to content

Instantly share code, notes, and snippets.

@damienomurchu
Last active January 30, 2024 10:33
Show Gist options
  • Save damienomurchu/8621cc603156300881a02fd3c42ee04b to your computer and use it in GitHub Desktop.
Save damienomurchu/8621cc603156300881a02fd3c42ee04b to your computer and use it in GitHub Desktop.
Machine & shell configs
# system
abbr -a .r source ~/.config/fish/config.fish
abbr -a z zsh
abbr -a ps ps auxf
abbr -a ds sudo dnf search
abbr -a di sudo dnf install
abbr -a ssh-forwardx ssh -X -C -c aes128-ctr -m hmac-sha1
# git
abbr -a gst git status -sb
abbr -a gl tig
abbr -a acm git add -A\n git commit -m
abbr -a aca git add -A\n git commit --amend
abbr -a gp git push
abbr -a gr git remote -v
abbr -a co git checkout
abbr -a gs git stash
abbr -a ga git add
abbr -a gc git commit -m
# k8s
abbr -a kc kubectl
abbr -a kn kubectl config set-context --current --namespace
# apps
abbr -a tf terraform
abbr -a c cheat
abbr -a ce cheat -e
abbr -a cl cheat -l
abbr -a cs cheat -s
abbr -a ct cheat -l -t
abbr -a vi vim
abbr -a v vim
# work
abbr -a pi pip3 install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org
abbr -a code code
---
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
editor: vim
# Should 'cheat' always colorize output?
colorize: false
# Which 'chroma' colorscheme should be applied to the output?
# Options are available here:
# https://github.com/alecthomas/chroma/tree/master/styles
style: monokai
# Which 'chroma' "formatter" should be applied?
# One of: "terminal", "terminal256", "terminal16m"
formatter: terminal256
# Through which pager should output be piped?
# 'less -FRX' is recommended on Unix systems
# 'more' is recommended on Windows
pager:
# Cheatpaths are paths at which cheatsheets are available on your local
# filesystem.
#
# It is useful to sort cheatsheets into different cheatpaths for organizational
# purposes. For example, you might want one cheatpath for community
# cheatsheets, one for personal cheatsheets, one for cheatsheets pertaining to
# your day job, one for code snippets, etc.
#
# Cheatpaths are scoped, such that more "local" cheatpaths take priority over
# more "global" cheatpaths. (The most global cheatpath is listed first in this
# file; the most local is listed last.) For example, if there is a 'tar'
# cheatsheet on both global and local paths, you'll be presented with the local
# one by default. ('cheat -p' can be used to view cheatsheets from alternative
# cheatpaths.)
#
# Cheatpaths can also be tagged as "read only". This instructs cheat not to
# automatically create cheatsheets on a read-only cheatpath. Instead, when you
# would like to edit a read-only cheatsheet using 'cheat -e', cheat will
# perform a copy-on-write of that cheatsheet from a read-only cheatpath to a
# writeable cheatpath.
#
# This is very useful when you would like to maintain, for example, a
# "pristine" repository of community cheatsheets on one cheatpath, and an
# editable personal reponsity of cheatsheets on another cheatpath.
#
# Cheatpaths can be also configured to automatically apply tags to cheatsheets
# on certain paths, which can be useful for querying purposes.
# Example: 'cheat -t work jenkins'.
#
# Community cheatsheets must be installed separately, though you may have
# downloaded them automatically when installing 'cheat'. If not, you may
# download them here:
#
# https://github.com/cheat/cheatsheets
cheatpaths:
# Cheatpath properties mean the following:
# 'name': the name of the cheatpath (view with 'cheat -d', filter with 'cheat -p')
# 'path': the filesystem path of the cheatsheet directory (view with 'cheat -d')
# 'tags': tags that should be automatically applied to sheets on this path
# 'readonly': shall user-created ('cheat -e') cheatsheets be saved here?
#- name: community
# path: $HOME/.config/cheat/cheatsheets/community
# tags: [ community ]
# readonly: true
# If you have personalized cheatsheets, list them last. They will take
# precedence over the more global cheatsheets.
- name: personal
path: $HOME/Documents/cheatsheets
tags: [ personal ]
readonly: false
# While it requires no configuration here, it's also worth noting that
# cheat will automatically append directories named '.cheat' within the
# current working directory to the 'cheatpath'. This can be very useful if
# you'd like to closely associate cheatsheets with, for example, a directory
# containing source code.
#
# Such "directory-scoped" cheatsheets will be treated as the most "local"
# cheatsheets, and will override less "local" cheatsheets. Similarly,
# directory-scoped cheatsheets will always be editable ('readonly: false').
complete -c cheat -f -a "(cheat -l | tail -n +2 | cut -d ' ' -f 1)"
complete -c cheat -l init -d "Write a default config file to stdout"
complete -c cheat -s c -l colorize -d "Colorize output"
complete -c cheat -s d -l directories -d "List cheatsheet directories"
complete -c cheat -s e -l edit -x -a "(cheat -l | tail -n +2 | cut -d ' ' -f 1)" -d "Edit cheatsheet"
complete -c cheat -s l -l list -d "List cheatsheets"
complete -c cheat -s p -l path -x -a "(cheat -d | cut -d ':' -f 1)" -d "Return only sheets found on given path"
complete -c cheat -s r -l regex -d "Treat search phrase as a regex"
complete -c cheat -s s -l search -x -d "Search cheatsheets for given phrase"
complete -c cheat -s t -l tag -x -a "(cheat -T)" -d "Return only sheets matching the given tag"
complete -c cheat -s T -l tags -d "List all tags in use"
complete -c cheat -s v -l version -d "Print the version number"
if status is-interactive
# Commands to run in interactive sessions can go here
eval (starship init fish)
end
function cn
#cp ~/.config/cheat/cheatsheets/template ~/Documents/cheatsheets/$argv[1]
vim ~/Documents/cheatsheets/$argv[1]
end
add_newline = true
continuation_prompt = " "
format = """
$container\
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
$directory\
$vcsh\
$git_branch\
$git_commit\
$git_state\
$git_metrics\
$git_status\
$hg_branch\
$docker_context\
$package\
$cmake\
$cobol\
$dart\
$deno\
$dotnet\
$elixir\
$elm\
$erlang\
$golang\
$helm\
$java\
$julia\
$kotlin\
$lua\
$nim\
$nodejs\
$ocaml\
$perl\
$php\
$pulumi\
$purescript\
$python\
$rlang\
$red\
$ruby\
$rust\
$scala\
$swift\
$terraform\
$vlang\
$vagrant\
$zig\
$nix_shell\
$conda\
$memory_usage\
$aws\
$gcloud\
$openstack\
$azure\
$env_var\
$crystal\
$custom\
$sudo\
$cmd_duration\
$jobs\
$battery\
$time\
$status\
$line_break\
$shell\
"""
[directory]
truncation_length = 8
truncation_symbol = "…/"
truncate_to_repo = false
[git_branch]
symbol = "ξ‚  "
always_show_remote = true
[git_commit]
tag_symbol = " πŸ”– "
tag_disabled = false
[git_status]
format = '($all_status$ahead_behind($style) )'
conflicted = "❌"
ahead = "πŸ”Ό"
behind = "πŸ”½"
diverged = "πŸ”€"
up_to_date = ""
untracked = "✨"
stashed = "πŸ§ͺ"
modified = "πŸ“"
staged = "🚁"
renamed = "πŸ¦‹"
deleted = "πŸ”₯"
[aws]
symbol = "β›… "
[character]
success_symbol = "🐧"
error_symbol = "πŸ‘€"
[cmd_duration]
min_time = 5_000
#show_notifications = true
#min_time_to_notify = "45_000"
[git_metrics]
disabled = false
format = '([+$added]($added_style) )([-$deleted]($deleted_style) )'
[hostname]
ssh_only = true
[kubernetes]
symbol = "πŸ”±"
disabled = false
[python]
symbol = "πŸͺ±"
python_binary = "python3"
[sudo]
disabled = false
[terraform]
disabled = false
symbol = "πŸ’ "
[jobs]
symbol = "πŸ‘·"
[container]
symbol = "πŸ“¦"
format = "$symbol "
[shell]
disabled = false
bash_indicator = "πŸ”¨"
zsh_indicator = "β„€"
fish_indicator = "🐟"
#[localip]
#disabled = false
#ssh_only = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment