Skip to content

Instantly share code, notes, and snippets.

@j0hnm4r5
Last active March 18, 2024 14:42
Show Gist options
  • Save j0hnm4r5/935af4e3e7e34851dc41ded312ca1b35 to your computer and use it in GitHub Desktop.
Save j0hnm4r5/935af4e3e7e34851dc41ded312ca1b35 to your computer and use it in GitHub Desktop.
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
// ========= COLORS =========
const colors = {
black: "#08040B",
red: "#D42450",
green: "#A9D400",
yellow: "#D95702",
blue: "#301D78",
magenta: "#D42450",
cyan: "#00A7B5",
white: "#E9C8D3",
lightBlack: "#27214D",
lightRed: "#D42450",
lightGreen: "#A9D400",
lightYellow: "#D95702",
lightBlue: "#27214D",
lightMagenta: "#D42450",
lightCyan: "#00A7B5",
lightWhite: "#C6E4E4"
}
// ========= SETTINGS =========
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "canary",
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: "Hurmit Nerd Font, monospace",
// default font weight: 'normal' or 'bold'
fontWeight: "normal",
// font weight for bold characters: 'normal' or 'bold'
fontWeightBold: "bold",
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: colors.cyan,
// terminal text color under BLOCK cursor
cursorAccentColor: colors.black,
// `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
cursorShape: "BLOCK",
// set to `true` (without backticks and without quotes) for blinking cursor
cursorBlink: true,
// color of the text
foregroundColor: colors.red,
// terminal background color
backgroundColor: colors.lightBlack,
// terminal selection color
selectionColor: hexToRGBAString(colors.red, 0.3),
// border color (window, tabs)
borderColor: colors.red,
// custom CSS to embed in the main window
css: ``,
// custom CSS to embed in the terminal window
termCSS: ``,
// custom padding (CSS format, i.e.: `top right bottom left`)
padding: "10px 10px",
// the full list. if you're going to provide the full color palette,
// including the 6 x 6 color cubes and the grayscale map, just provide
// an array here instead of a color map object
colors: {
black: colors.black,
red: colors.red,
green: colors.green,
yellow: colors.yellow,
blue: colors.blue,
magenta: colors.magenta,
cyan: colors.cyan,
white: colors.white,
lightBlack: colors.lightBlack,
lightRed: colors.lightRed,
lightGreen: colors.lightGreen,
lightYellow: colors.lightYellow,
lightBlue: colors.lightBlue,
lightMagenta: colors.lightMagenta,
lightCyan: colors.lightCyan,
lightWhite: colors.lightWhite,
},
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
shell: "",
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
shellArgs: ["--login"],
// for environment variables
env: {},
// set to `false` for no bell
bell: "SOUND",
// if `true`, selected text will automatically be copied to the clipboard
copyOnSelect: false,
// if `true`, hyper will be set as the default protocol client for SSH
defaultSSHApp: true,
// for advanced config flags please refer to https://hyper.is/#cfg
// ========= PLUGINS CONFIG =========
visor: {
hotkey: "Control+`",
position: "top"
},
hyperTabs: {
border: true,
tabIconsColored: true,
closeAlign: "right",
},
hyperBorder: {
borderColors: [colors.red, colors.blue],
animate: true,
borderWidth: "10px",
},
},
// a list of plugins to fetch and install from npm
// format: [@org/]project[#version]
plugins: [
"hyperterm-alternatescroll",
"hyperborder",
"hyper-tabs-enhanced",
"hyperterm-visor",
],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here
// to load it and avoid it being `npm install`ed
localPlugins: [],
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
}
};
// ========= HELPER FUNCTIONS =========
function hexToRGB(hex) {
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function (m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
}
function hexToRGBAString(hex, alpha) {
const color = hexToRGB(hex);
return `rgba(${color.r}, ${color.g}, ${color.b}, ${alpha})`
}
export ZSH=$HOME/.oh-my-zsh
skip_global_compinit=1
# THEME =========
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='nerdfont-complete'
# POWERLEVEL9K=========
# Directories
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_DELIMITER="…"
POWERLEVEL9K_SHORTEN_STRATEGY="truncate_with_package_name"
# Separators
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR="\ue0b4"
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR="\ue0b6"
# Icons
POWERLEVEL9K_HOST_TEMPLATE="%2m"
POWERLEVEL9K_HOST_ICON="\uf109"
POWERLEVEL9K_SSH_ICON="\uf0c2"
POWERLEVEL9K_HOME_ICON="\uf015"
POWERLEVEL9K_HOME_SUB_ICON="\uf07c"
POWERLEVEL9K_FOLDER_ICON="\uf07b"
POWERLEVEL9K_NETWORK_ICON="\uf09e"
POWERLEVEL9K_PYTHON_ICON="\ue606"
POWERLEVEL9K_ANACONDA_LEFT_DELIMITER=""
POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER=""
prompt_nodenv() {
LOCAL_NODE_VERSION="$( cut -d ' ' -f 1 <<< "$(nodenv version)" )"
GLOBAL_NODE_VERSION="$( cut -d ' ' -f 1 <<< "$(nodenv global)" )"
if [ "$LOCAL_NODE_VERSION" != "$GLOBAL_NODE_VERSION" ]
then
echo -n "\ue718 $LOCAL_NODE_VERSION"
fi
}
POWERLEVEL9K_CUSTOM_NODENV="prompt_nodenv"
# Prompt
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(host ip newline dir)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(anaconda custom_nodenv status)
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
# Prompt Colors
POWERLEVEL9K_HOST_LOCAL_FOREGROUND='black'
POWERLEVEL9K_HOST_LOCAL_BACKGROUND='red'
POWERLEVEL9K_HOST_REMOTE_FOREGROUND='black'
POWERLEVEL9K_HOST_REMOTE_BACKGROUND='cyan'
POWERLEVEL9K_DIR_PATH_SEPARATOR="%F{white}  %F{red}"
POWERLEVEL9K_DIR_HOME_FOREGROUND='red'
POWERLEVEL9K_DIR_HOME_BACKGROUND='blue'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND='red'
POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND='blue'
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND='red'
POWERLEVEL9K_DIR_DEFAULT_BACKGROUND='cyan'
POWERLEVEL9K_IP_FOREGROUND='red'
POWERLEVEL9K_IP_BACKGROUND='blue'
POWERLEVEL9K_CUSTOM_NODENV_FOREGROUND="black"
POWERLEVEL9K_CUSTOM_NODENV_BACKGROUND="green"
POWERLEVEL9K_STATUS_OK_FOREGROUND='cyan'
POWERLEVEL9K_STATUS_OK_BACKGROUND='blue'
POWERLEVEL9K_STATUS_ERROR_FOREGROUND='white'
POWERLEVEL9K_STATUS_ERROR_BACKGROUND='red'
# OH MY ZSH SETTINGS =========
CASE_SENSITIVE="false"
HYPHEN_INSENSITIVE="true"
ENABLE_CORRECTION="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
DISABLE_UPDATE_PROMPT="true"
MAILCHECK=0
DISABLE_AUTO_TITLE="true"
plugins=(brew zsh-autosuggestions colorize) # OTHER PLUGINS zsh-nvm
source $ZSH/oh-my-zsh.sh
# USER CONFIGURATION =========
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/X11/bin"
export MANPATH="/usr/local/man:/usr/share/man:$MANPATH"
export HOMEBREW_CASK_OPTS="--appdir=/Applications"
source $(dirname $(gem which colorls))/tab_complete.sh
# colors can be changed at ~/.config/colorls
alias ls='colorls'
alias la='colorls -A'
alias ll='colorls -Al --sd'
# alias ls='ls -CFp' # normal ls
# alias la='ls -AFhopT' # ls all files with details
alias cl='clear'
alias mkdir="mkdir -pv"
# Terminal colors
export CLICOLOR=1
export LSCOLORS=Fxxxcxexdxegedabagacad
# ========= ALIASES & COMMANDS =========
# Source .zshrc
alias codez='code ~/.zshrc'
alias sourz='source ~/.zshrc'
# Copy Working Directory
alias cwd='echo -n $PWD | pbcopy | echo "Copied to Clipboard: $PWD"'
# Cycle WiFi on OSX
alias resetWifi='networksetup -setairportpower en0 off; networksetup -setairportpower en0 on'
# Hide Desktop icons
alias hideIcons='defaults write com.apple.finder CreateDesktop false && killall Finder'
# Show Desktop icons
alias showIcons='defaults write com.apple.finder CreateDesktop true && killall Finder'
# Change the wallpaper on all desktops on OSX
function changeWallpaper() {
sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '$1'"
killall Dock
}
# Python3 server
function serve() {
if [ -n "$1" ] ; then
PORT="$1"
else
PORT='8000'
fi
echo "Command-Click this link to open http://localhost:$PORT in your browser"
python3 -m http.server $PORT
}
# VSCode Insiders
# alias code='code-insiders'
# ========= LOAD IN EXTRAS =========
# Conda
export PATH=/usr/local/miniconda3/bin:"$PATH"
# Android
export PATH=/Users/jmars/Library/Android/sdk/platform-tools:"$PATH"
# iTerm Shell Integration
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# nodenv
eval "$(nodenv init -)"
# ========= STUPID THINGS =========
alias hacker='cat /dev/urandom| hexdump -C | grep --color=auto "ca fe"'
# pipes.sh
# htop
# cmatrix
# tty-clock
# neofetch
# figlet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment