Skip to content

Instantly share code, notes, and snippets.

@brra
Forked from ryanpcmcquen/.bash_profile
Last active May 27, 2021 15:43
Show Gist options
  • Save brra/272f35d51634c6df48a9148215c5f482 to your computer and use it in GitHub Desktop.
Save brra/272f35d51634c6df48a9148215c5f482 to your computer and use it in GitHub Desktop.
Funky configs
# So I know where I am in repos:
#parse_git_branch() {
# git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
#}
# Colorize `ls` by default:
alias ls='ls -G'
[ -e ~/.bash_SECRETS ] && . ~/.bash_SECRETS
# Modified from:
# https://stackoverflow.com/a/4138531/2662028
#export PS1='\n\[\e[1;37m\]|-- \[\e[1;32m\]\u\[\e[0;39m\]@\[\e[1;36m\]\h\[\e[0;39m\]:\[\e[1;33m\]\w\[\e[0;39m\]\[\e[1;35m\]$(parse_git_branch " (%s)")\[\e[0;39m\] \[\e[1;37m\]--|\[\e[0;39m\]\n\$ '
# Old prompt (less fun):
#export PS1='\u@\w:$(parse_git_branch)\$ '
# Without this, Mac OS will not share your terminal
# history across sessions ...
export SHELL_SESSION_HISTORY=0
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
export PATH="$PATH:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/opt/node@12/bin"
[user]
email = brra@
name = testing
[alias]
view = log --pretty=format:\"%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s\"
viewtime = log --pretty=format:\"%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s\" --date=relative
pristine = "!git for-each-ref --format='%(color:blue)%(authorname)%(color:reset) %09 %(color:green)%(refname:short)%(color:reset)' | grep 'Pristine Tran'"
# fromme = "!git for-each-ref --sort=committerdate --format='%(color:red)%(committerdate:short) - %(committerdate:relative)%(color:reset) %09 %(color:blue)%(authorname)%(color:reset) %09 %(color:green)%(refname)%(color:reset)' | grep 'Pristine Tran'"
fromme = "!git for-each-ref --sort=committerdate --format='%(committerdate:short) - %(committerdate:relative) %09 %(authorname) %09 %(color:green)%(refname)%(color:reset)' | grep 'Pristine Tran'"
listhead = "!git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:red)%(objectname:short)%(color:reset);%(color:yellow)%(refname:short)%(color:reset);(%(color:green)%(committerdate:relative)%(color:reset));%(authorname);%(contents:subject)' | column -t -s ';'"
logtree = log --graph --oneline --decorate --all
co = checkout
dev = checkout development
st = status
pl = pull -r
cm = commit --no-verify -m
ad = add -A
url = remote -v
link = remote -v
# For all branches: git branch -avv
# For local branches only: git branch -lvv
# For remote branches only: git branch -rvv
#
# Working with branches
#
# mergetest
mergetest = "!f(){ git merge --no-commit --no-ff \"$1\"; git merge --abort; echo \"Merge aborted\"; };f "
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
pub = "!git push -u origin $(git branch-name)"
# Delete the remote version of the current branch
unpub = "!git push origin :$(git branch-name)"
# Delete the remote branch
# delremote = "!git push origin -d :$(git branch-name)"
delremote = "!git push origin -d"
# Delete the local branch
dellocal = "!git branch -D :$(git branch-name)"
# Delete a branch and recreate it from master — useful if you have, say,
# a development branch and a master branch and they could conceivably go
# out of sync
recreate = "!f() { [[ -n $@ ]] && git checkout \"$@\" && git unpublish && git checkout master && git branch -D \"$@\" && git checkout -b \"$@\" && git publish; }; f"
# Fire up your difftool (e.g. Kaleidescope) with all the changes that
# are on the current branch.
code-review = difftool origin/master...
# Given a merge commit, find the span of commits that exist(ed) on that
# branch. Again, not so useful in itself, but used by other aliases.
merge-span = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f"
# Find the commits that were introduced by a merge
merge-log = "!git log `git merge-span .. $1`"
# Show the changes that were introduced by a merge
merge-diff = "!git diff `git merge-span ... $1`"
# As above, but in your difftool
merge-difftool = "!git difftool `git merge-span ... $1`"
# Interactively rebase all the commits on the current branch
rebase-branch = "!git rebase -i `git merge-base master HEAD`"
#
# Working with files
#
# Unstage any files that have been added to the staging area
unstage = reset HEAD
# Show changes that have been staged
diffc = diff --cached
# Mark a file as "assume unchanged", which means that Git will treat it
# as though there are no changes to it even if there are. Useful for
# temporary changes to tracked files
assume = update-index --assume-unchanged
# Reverse the above
unassume = update-index --no-assume-unchanged
# Show the files that are currently assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
# Checkout our version of a file and add it
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
# Checkout their version of a file and add it
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
# Delete any branches that have been merged into master
# See also: https://gist.github.com/robmiller/5133264
delete-merged-branches = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
glog = "!git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative ; true"
editconfig = "!sh subl $HOME/.gitconfig"
[core]
excludesfile = ~/.gitignore
excludesfile = ~/.gitignore_global
[diff]
tool = smerge
[merge]
tool = smerge
[init]
templatedir = ~/.git-templates
[pager]
branch = false
[mergetool "smerge"]
cmd = smerge mergetool \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
trustExitCode = true
[difftool "smerge"]
cmd = smerge \"$BASE\" \"$LOCAL\" \"$REMOTE\"
[pull]
rebase = false
# Created by https://www.gitignore.io/api/node
.DS_Store
# Node and related ecosystem
# ==========================
.nodemonignore
.sass-cache/
node_modules/
.bower-*/
.idea/
cache/
# MEAN.js app and assets
# ======================
public/dist/
uploads
*.pem
# General
# =======
*.out
*.pid
*.tmp
*.bak
npm-debug.log
npm-debug.log*
*.swp
pids
logs/
local-file-*
local-mock/
client/local-mock/
server/local-mock/
# For IntelliJ, Webstorm aliases to work with .babelrc configuration, create a webpack.junk.js file and add them there
webpack.junk.js
# Sublime editor
# ==============
.sublime-project
*.sublime-project
*.sublime-workspace
# Eclipse project files
# =====================
.project
.settings/
.*.md.html
.metadata
*~.nib
local.properties
# IntelliJ
# ========
.idea
*.iml
# Cloud9 IDE
# =========
.c9/
# Visual Studio
# =========
#Ignore files build by Visual Studio
*.suo
*.ntvs*
*.njsproj
*.sln
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.tlb
*.tlh
*.cache
*.ilk
*.dll
*.lib
*.sbr
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
# Windows
# ===========
#ignore thumbnails created by windows
ehthumbs.db
Icon?
Thumbs.db
Desktop.ini
# OS X
# ===========
.DS_Store*
._*
# Linux
.directory
*~
#!/usr/bin/env bash
# curl -o ~/.osx https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/2ae4fd3eff54c6e12b3e2897d2e7d647540d3375/.osx && bash ~/.osx
###############################################################################
# General UI/UX #
###############################################################################
# set menu clock
# see http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
defaults write -g com.apple.menuextra.clock "DateFormat" 'EEE MMM d hh:mm:ss a'
killall SystemUIServer
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
sudo -v
# Disable smart dashes as they’re annoying when typing code.
defaults write -g NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# Disable automatic periods with a double space:
defaults write -g NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
# Disable smart quotes as they’re annoying when typing code.
defaults write -g NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# Set a shorter delay until key repeat:
defaults write -g NSGlobalDomain InitialKeyRepeat -int 15
# Set a blazingly fast keyboard repeat rate:
defaults write -g NSGlobalDomain KeyRepeat -int 2
# Disable drop shadows in screenshots:
defaults write -g com.apple.screencapture disable-shadow -bool true
# Disable press-and-hold for keys in favor of key repeat.
defaults write -g ApplePressAndHoldEnabled -bool false
# set finder to display full path in title bar
defaults write -g com.apple.finder '_FXShowPosixPathInTitle' -bool true
# stop Photos from opening automatically
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
#to revert use defaults -currentHost delete com.apple.ImageCapture disableHotPlug
#Disable guest login
defaults write -g /Library/Preferences/com.apple.loginwindow GuestEnabled -bool NO;
defaults write -g /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool NO;
defaults write -g /Library/Preferences/com.apple.AppleFileServer guestAccess -bool NO
#Show remaining battery time" N; then
defaults write -g com.apple.menuextra.battery ShowTime -string "YES"
#Show remaining battery percentage
defaults write -g com.apple.menuextra.battery ShowPercent -string "YES"
# Disable transparency in the menu bar and elsewhere on Yosemite
defaults write -g com.apple.universalaccess reduceTransparency -bool true
#Temperature units
defaults write -g AppleTemperatureUnit -string "Celsius"
#Turn off the 'Application Downloaded from Internet' quarantine warning
defaults write -g com.apple.LaunchServices LSQuarantine -bool false
#Disable automatic termination of inactive apps
defaults write -g NSDisableAutomaticTermination -bool true
#Remove duplicates in the 'Open With' menu (also see 'lscleanup' alias
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
#Set the languages present
defaultswrite -g NSLinguisticDataAssetsRequested -array "en_US" "en" "se"
defaultsdelete NSGlobalDomain NSNavRecentPlaces
#Disable Notification Center and remove the menu bar icon
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
# Show the ~/Library folder.
chflags nohidden ~/Library
# Set the Finder prefs for showing a few different volumes on the Desktop.
defaults write -g com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write -g com.apple.finder ShowRemovableMediaOnDesktop -bool true
#Increase sound quality for Bluetooth headphones/headsets
defaults write -g com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
# Expand save panel by default
defaults write -g NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write -g NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
defaults write -g NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write -g NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
# While applying any changes to SoftwareUpdate defaults, set software update to OFF to avoid any conflict with the defaults system cache. (Also close the System Preferences app)
softwareupdate --schedule OFF
###############################################################################
# SSD-specific tweaks #
###############################################################################
#Disable hibernation (speeds up entering sleep mode
pmset -a hibernatemode 0
#Disable the sudden motion sensor as it’s not useful for SSDs
pmset -a sms 0
###############################################################################
# DiskUtility #
###############################################################################
#Show a Debug menu in Disk Utility
defaults write -g com.apple.DiskUtility DUDebugMenuEnabled -bool true
#Enables additional disk image options
defaults write -g com.apple.DiskUtility advanced-image-options -bool true
#Shows all partitions for a disk in the main list
defaults write -g com.apple.DiskUtility DUShowEveryPartition -bool true
#Skip checksum verification for images on remote volumes
defaults write -g com.apple.frameworks.diskimages skip-verify-remote -bool true
#Skip checksum verification for images on locked volumes
defaults write -g com.apple.frameworks.diskimages skip-verify-locked -bool true
#Allows Disk Images As RAIDs
defaults write -g com.apple.DiskUtility DUAllowsDiskImagesAsRAIDs -bool true
#Disk Skip Verify
defaults write -g com.apple.DiskUtility DURestoreCanSkipVerify -bool true
#Debug All Message Level
defaults write -g com.apple.DiskUtility DUDebugMessageLevel -int 4
#Show Details In First Aid
defaults write -g com.apple.DiskUtility DUShowDetailsInFirstAid -bool true
#Disable disk image verification
defaults write -g com.apple.frameworks.diskimages skip-verify -bool true
###############################################################################
# Finder #
###############################################################################
#Allow quitting Finder via ⌘ + Q; doing so will also hide desktop icons
defaults write -g com.apple.finder QuitMenuItem -bool true
# #Disable window animations and Get Info animations
defaults write -g com.apple.finder DisableAllAnimations -bool true
#Set Desktop as the default location for new Finder windows
# For other paths, use `PfLo` and `file:///full/path/here/`
defaults write -g com.apple.finder NewWindowTarget -string "PfLo"
defaults write -g com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
#Show icons for hard drives, servers, and removable media on the desktop
defaults write -g com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write -g com.apple.finder ShowHardDrivesOnDesktop -bool false
# defaults write -g com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write -g com.apple.finder ShowRemovableMediaOnDesktop -bool true
#Show hidden files by default
defaults write -g com.apple.finder AppleShowAllFiles -bool true
#Show all filename extensions
defaults write -g AppleShowAllExtensions -bool true
#Show status bar
defaults write -g com.apple.finder ShowStatusBar -bool true
#Start the status bar Path at $HOME (instead of Hard drive)" N; then
defaults write -g /Library/Preferences/com.apple.finder PathBarRootAtHome -bool true
#Show path (breadcrumb) bar
defaults write -g com.apple.finder ShowPathbar -bool true
#Show preview pane
defaults write -g com.apple.finder ShowPreviewPane -bool false
#Allowing text selection in Quick Look/Preview in Finder by default
defaults write -g com.apple.finder QLEnableTextSelection -bool true
#Display full POSIX path as Finder window title
defaults write -g com.apple.finder _FXShowPosixPathInTitle -bool true
#
#When performing a search, search the current folder by default (the default 'This Mac' is 'SCev'
defaults write -g com.apple.finder FXDefaultSearchScope -string "SCcf"
#Disable the warning when changing a file extension
defaults write -g com.apple.finder FXEnableExtensionChangeWarning -bool false
# #Enable spring loading for directories
# defaults write -g com.apple.springing.enabled -bool true
#
#Remove the delay for spring loading for directories
defaults write -g com.apple.springing.delay -float 0
#Enable snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
#Increase grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 54" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 54" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 54" ~/Library/Preferences/com.apple.finder.plist
#Increase the size of icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 64" ~/Library/Preferences/com.apple.finder.plist
# Show item info near icons on the desktop and in other icon views
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
# Show item info to the right of the icons on the desktop
# /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
# Enable snap-to-grid for icons on the desktop and in other icon views
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Increase grid spacing for icons on the desktop and in other icon views
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
# Increase the size of icons on the desktop and in other icon views
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
# /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
#Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv` (icon), `Nlsv` (list), `Flwv` (cover flow)
defaults write -g com.apple.finder FXPreferredViewStyle -string "clmv"
defaults write -g com.apple.finder SearchRecentsSavedViewStyle -string "clmv"
#Disable creation of Metadata Files on Network Volumes (avoids creation of .DS_Store and AppleDouble files.
defaults write -g com.apple.desktopservices DSDontWriteNetworkStores -bool true
#Disable creation of Metadata Files on USB Volumes (avoids creation of .DS_Store and AppleDouble files.
defaults write -g com.apple.desktopservices DSDontWriteUSBStores -bool true
#Disable the warning before emptying the Trash
defaults write -g com.apple.finder WarnOnEmptyTrash -bool false
#Show app-centric sidebar
defaults write -g com.apple.finder FK_AppCentricShowSidebar -bool true
#Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write -g com.apple.NetworkBrowser BrowseAllInterfaces -bool true
#Show the ~/Library folder
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
#Expand the following File Info panes: 'General', 'Open with', and 'Sharing & Permissions'
defaults write -g com.apple.finder FXInfoPanesExpanded -dict-add "General" -bool true
defaults write -g com.apple.finder FXInfoPanesExpanded -dict-add "MetaData" -bool false
defaults write -g com.apple.finder FXInfoPanesExpanded -dict-add "OpenWith" -bool true
defaults write -g com.apple.finder FXInfoPanesExpanded -dict-add "Privileges" -bool true
#Turn on Smooth Scroll
defaults write -g NSScrollAnimationEnabled -bool true
# Increase window resize speed for Cocoa applications
defaults write -g NSGlobalDomain NSWindowResizeTime -float 0.001
#Disable window animations" N; then
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false && killall Finder
#
###############################################################################
# Energy saving #
###############################################################################
# Enable lid wakeup
pmset -a lidwake 1
# Restart automatically on power loss
pmset -a autorestart 1
# Restart automatically if the computer freezes
systemsetup -setrestartfreeze on
# Sleep the display after 15 minutes
pmset -a displaysleep 15
# Disable machine sleep while charging
pmset -c sleep 0
# Set machine sleep to 5 minutes on battery
pmset -b sleep 5
# Set standby delay to 24 hours (default is 1 hour)
pmset -a standbydelay 86400
# Never go into computer sleep mode
systemsetup -setcomputersleep Off > /dev/null
# Hibernation mode
# 0: Disable hibernation (speeds up entering sleep mode)
# 3: Copy RAM to disk so the system state can still be restored in case of a power failure.
pmset -a hibernatemode 0
# Remove the sleep image file to save disk space
sudo rm /private/var/vm/sleepimage
# Create a zero-byte file instead…
sudo touch /private/var/vm/sleepimage
# …and make sure it can’t be rewritten
sudo chflags uchg /private/var/vm/sleepimage
###############################
# Do not allow rootless login #
###############################
ROOTLESS_STATUS=$(/usr/bin/csrutil status | awk '/status/ {print $5}' | sed 's/\.$//')
if [[ $ROOTLESS_STATUS == "enabled" ]]; then
echo "csrutil (\"rootless\") is enabled. please disable in boot screen and run again!"
exit 1
##########
# Config #
##########
# Get the command line tools!
[ ! "`xcodebuild -version`" ] && \
xcodebuild -versionxcode-select --install && \
xcodebuild -license accept
# Install homebrew:
[ ! "`which brew`" ] && \
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew update
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/94d39868ead05a41d08c9684d6bd7795e8aa71ab/Brewfile -P "$HOME/.config/"
brew bundle install --file="$HOME/.config/Brewfile" &&
rm -rf "$HOME/.config/Brewfile"
# Bash:
#wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.bash_profile -P ~/
# Nushell:
# The config is in Preferences for older versions (0.19.0 or older), and in Application Support for newer versions.
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/44568f2dd70494996c96a4754893294942b113b3/config.toml -P "$HOME/Library/Application Support/org.nushell.nu/"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/44568f2dd70494996c96a4754893294942b113b3/starship.toml -P "$HOME/.config/"
# ZSH:
#mkdir -p ~/.oh-my-zsh/themes/
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.zshrc -P ~/
wget -N https://gist.githubusercontent.com/ryanpcmcquen/150cf9a66bca2463e5660cafed3e1000/raw/McQuen.zsh-theme -P ~/.oh-my-zsh/themes/
# Emacs customizations for Prelude:
# if [ -d ~/.emacs.d/personal ]; then
# curl -o ~/.emacs.d/personal/McQuen.el https://gist.githubusercontent.com/ryanpcmcquen/1ca6d1d7b5c8580aebef4f840e29f83a/raw/McQuen.el
# else
curl -o ~/.emacs https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.emacs
# Hammerspoon config:
[ -d ~/.hammerspoon ] && \
curl -o ~/.hammerspoon/init.lua https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/init.lua
# Sublime!
SUBLIME_MERGE_CONFIG_DIR=~/Library/Application\ Support/Sublime\ Merge/Packages/User
if [ -d "${SUBLIME_MERGE_CONFIG_DIR}" ]; then
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/MERGE_Preferences.sublime-settings -P "${SUBLIME_MERGE_CONFIG_DIR}"
mv "${SUBLIME_MERGE_CONFIG_DIR}"/MERGE_Preferences.sublime-settings "${SUBLIME_MERGE_CONFIG_DIR}"/Preferences.sublime-settings
SUBLIME_TEXT_CONFIG_DIR=~/Library/Application\ Support/Sublime\ Text/Packages/User
if [ -d "${SUBLIME_TEXT_CONFIG_DIR}" ]; then
wget -N https://raw.githubusercontent.com/ryanpcmcquen/sublime_witness/master/Witness.sublime-color-scheme -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Default.sublime-keymap -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Default.sublime-mousemap -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Doxy.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/ecmascript-js.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/JavaScript.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/JSON.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/LSP.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/LSP-typescript.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/phpcbf.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/phpfmt.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Preferences.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/SQL.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Terminus.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Xdebug.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
if [ ! -e "${SUBLIME_TEXT_CONFIG_DIR}/Package Control.sublime-settings" ]; then
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/Package%20Control.sublime-settings -P "${SUBLIME_TEXT_CONFIG_DIR}"
# Vim!
curl -o ~/.vimrc https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.vimrc
# ZeroBrane Studio config:
#[ -d ~/.zbstudio ] && \
#curl -o ~/.zbstudio/user.lua https://raw.githubusercontent.com/ryanpcmcquen/linuxTweaks/master/.zbstudio/user.lua
# modify appearance of dock: remove standard icons, add chrome and iTerm
if [ ! -e /usr/local/bin/dockutil ]; then
curl https://raw.githubusercontent.com/kcrawford/dockutil/master/scripts/dockutil > /usr/local/bin/dockutil
fi
chmod a+rx,go-w /usr/local/bin/dockutil
dockutil --list | awk -F\t '{print "dockutil --remove \""$1"\" --no-restart"}' | sh
dockutil --add /Applications/Google\ Chrome.app --no-restart
dockutil --add /Applications/iTerm.app
# Make a shortcut to the open command, which works around shells which have a built-in 'open' (nushell).
ln -sf /usr/bin/open /usr/local/bin/finder
set nocompatible
"
" In '$ ~/' & '# ~/' run:
"
" wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.vimrc -P ~/
"
" Or:
"
" curl -o ~/.vimrc https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.vimrc
"
" Set 4 spaces globally & make indenting sane.
" ... Note that 'set paste' destroys indentation.
"
" We could also set `tabstop`, but let's
" keep tabs 'natural'.
set softtabstop=4 shiftwidth=4 expandtab autoindent
" Allow the user to insert an actual tab with:
" Ctrl + T
inoremap <C-T> <C-V><Tab>
" utf-8!
set encoding=utf-8 fileencoding=utf-8
" Do not show line numbers:
set nonumber
" Clear out the cruft:
set nobackup nowritebackup noswapfile noundofile
" Make searching easy, and case insensitive:
set ignorecase smartcase incsearch hlsearch
" Gives you a little jazzy info on the bottom:
set title ruler
" Turn on the wildmenu, get wild!
set wildmenu
" Always show the mode, so you know what is up:
set showmode
" Unsets "last search pattern" register by hitting return.
nnoremap <CR> :noh<CR><CR>
" Nifty shortcut for middle of line instead of middle of screen:
map gm :call cursor(0, virtcol('$')/2)<CR>
if &term =~ '256color'
" Render properly when in 256-color tmux:
set t_ut=
endif
" Display filename in vim:
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername}
" Make vim use the system clipboard:
set clipboard^=unnamed,unnamedplus
" Delete to the blackhole register,
" keeps you from pasting deleted text:
nnoremap <Leader>d "_d
vnoremap <Leader>d "_d
" Disable mouse usage.
" If I wanted to use the mouse, I wouldn't have learned vim!
set mouse=
" I just include my theme below,
" rather than having to download
" anything else. ;^)
syntax on
" Pick up PICO-8 files:
augroup filetypedetect
au BufRead,BufNewFile *.p8 setfiletype lua
augroup END
"
" End of my stuff.
"
"
" Start of `fix-vim-pasting`.
"
" https://github.com/ryanpcmcquen/fix-vim-pasting
"
" Because Vim doesn't like
" pasting that works.
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
"
" End of `fix-vim-pasting`.
"
set background=light
""""""""""""""""""
" Vim color file "
""""""""""""""""""
" Theme: PaperColor
" Author: Nikyle Nguyen <NLKNguyen@MSN.com>
" License: MIT
" Source: http://github.com/NLKNguyen/papercolor-theme
let s:version = '0.9.x'
" Note on navigating this source code:
" - Use folding feature to collapse/uncollapse blocks of marked code
" zM to fold all markers in this file to see the structure of the source code
" zR to unfold all recursively
" za to toggle a fold
" See: http://vim.wikia.com/wiki/Folding
" - The main section is at the end where the functions are called in order.
" Theme Repository: {{{
let s:themes = {}
" }}}
fun! s:register_default_theme()
" Theme name should be lowercase
let s:themes['default'] = {
\ 'maintainer' : 'Nikyle Nguyen <me@Nikyle.com>',
\ 'source' : 'http://github.com/NLKNguyen/papercolor-theme',
\ 'description' : 'The original PaperColor Theme, inspired by Google Material Design',
\ 'options' : {
\ 'allow_bold': 1
\ }
\ }
" Theme can have 'light' and/or 'dark' color palette.
" Color values can be HEX and/or 256-color. Use empty string '' if not provided.
" Only color00 -> color15 are required. The rest are optional.
let s:themes['default'].light = {
\ 'NO_CONVERSION': 1,
\ 'TEST_256_COLOR_CONSISTENCY' : 1,
\ 'palette' : {
\ 'color00' : ['#eeeeee', '255'],
\ 'color01' : ['#af0000', '124'],
\ 'color02' : ['#008700', '28'],
\ 'color03' : ['#5f8700', '64'],
\ 'color04' : ['#0087af', '31'],
\ 'color05' : ['#878787', '102'],
\ 'color06' : ['#005f87', '24'],
\ 'color07' : ['#444444', '238'],
\ 'color08' : ['#bcbcbc', '250'],
\ 'color09' : ['#d70000', '160'],
\ 'color10' : ['#d70087', '162'],
\ 'color11' : ['#8700af', '91'],
\ 'color12' : ['#d75f00', '166'],
\ 'color13' : ['#d75f00', '166'],
\ 'color14' : ['#005faf', '25'],
\ 'color15' : ['#005f87', '24'],
\ 'color16' : ['#0087af', '31'],
\ 'color17' : ['#008700', '28'],
\ 'cursor_fg' : ['#eeeeee', '255'],
\ 'cursor_bg' : ['#005f87', '24'],
\ 'cursorline' : ['#e4e4e4', '254'],
\ 'cursorcolumn' : ['#e4e4e4', '254'],
\ 'cursorlinenr_fg' : ['#af5f00', '130'],
\ 'cursorlinenr_bg' : ['#eeeeee', '255'],
\ 'popupmenu_fg' : ['#444444', '238'],
\ 'popupmenu_bg' : ['#d0d0d0', '252'],
\ 'search_fg' : ['#444444', '238'],
\ 'search_bg' : ['#ffff5f', '227'],
\ 'linenumber_fg' : ['#b2b2b2', '249'],
\ 'linenumber_bg' : ['#eeeeee', '255'],
\ 'vertsplit_fg' : ['#005f87', '24'],
\ 'vertsplit_bg' : ['#eeeeee', '255'],
\ 'statusline_active_fg' : ['#e4e4e4', '254'],
\ 'statusline_active_bg' : ['#005f87', '24'],
\ 'statusline_inactive_fg' : ['#444444', '238'],
\ 'statusline_inactive_bg' : ['#d0d0d0', '252'],
\ 'todo_fg' : ['#00af5f', '35'],
\ 'todo_bg' : ['#eeeeee', '255'],
\ 'error_fg' : ['#af0000', '124'],
\ 'error_bg' : ['#ffd7ff', '225'],
\ 'matchparen_bg' : ['#c6c6c6', '251'],
\ 'matchparen_fg' : ['#005f87', '24'],
\ 'visual_fg' : ['#eeeeee', '255'],
\ 'visual_bg' : ['#0087af', '31'],
\ 'folded_fg' : ['#0087af', '31'],
\ 'folded_bg' : ['#afd7ff', '153'],
\ 'wildmenu_fg': ['#444444', '238'],
\ 'wildmenu_bg': ['#ffff00', '226'],
\ 'spellbad': ['#ffafd7', '218'],
\ 'spellcap': ['#ffffaf', '229'],
\ 'spellrare': ['#afff87', '156'],
\ 'spelllocal': ['#d7d7ff', '189'],
\ 'diffadd_fg': ['#008700', '28'],
\ 'diffadd_bg': ['#afffaf', '157'],
\ 'diffdelete_fg': ['#af0000', '124'],
\ 'diffdelete_bg': ['#ffd7ff', '225'],
\ 'difftext_fg': ['#0087af', '31'],
\ 'difftext_bg': ['#ffffd7', '230'],
\ 'diffchange_fg': ['#444444', '238'],
\ 'diffchange_bg': ['#ffd787', '222'],
\ 'tabline_bg': ['#005f87', '24'],
\ 'tabline_active_fg': ['#444444', '238'],
\ 'tabline_active_bg': ['#e4e4e4', '254'],
\ 'tabline_inactive_fg': ['#eeeeee', '255'],
\ 'tabline_inactive_bg': ['#0087af', '31'],
\ 'buftabline_bg': ['#005f87', '24'],
\ 'buftabline_current_fg': ['#444444', '238'],
\ 'buftabline_current_bg': ['#e4e4e4', '254'],
\ 'buftabline_active_fg': ['#eeeeee', '255'],
\ 'buftabline_active_bg': ['#005faf', '25'],
\ 'buftabline_inactive_fg': ['#eeeeee', '255'],
\ 'buftabline_inactive_bg': ['#0087af', '31']
\ }
\ }
" TODO: idea for subtheme options
" let s:themes['default'].light.subtheme = {
" \ 'alternative' : {
" \ 'options' : {
" \ 'transparent_background': 1
" \ },
" \ 'palette' : {
" \ }
" \ }
" \ }
let s:themes['default'].dark = {
\ 'NO_CONVERSION': 1,
\ 'TEST_256_COLOR_CONSISTENCY' : 1,
\ 'palette' : {
\ 'color00' : ['#1c1c1c', '234'],
\ 'color01' : ['#af005f', '125'],
\ 'color02' : ['#5faf00', '70'],
\ 'color03' : ['#d7af5f', '179'],
\ 'color04' : ['#5fafd7', '74'],
\ 'color05' : ['#808080', '244'],
\ 'color06' : ['#d7875f', '173'],
\ 'color07' : ['#d0d0d0', '252'],
\ 'color08' : ['#585858', '240'],
\ 'color09' : ['#5faf5f', '71'],
\ 'color10' : ['#afd700', '148'],
\ 'color11' : ['#af87d7', '140'],
\ 'color12' : ['#ffaf00', '214'],
\ 'color13' : ['#ff5faf', '205'],
\ 'color14' : ['#00afaf', '37'],
\ 'color15' : ['#5f8787', '66'],
\ 'color16' : ['#5fafd7', '74'],
\ 'color17' : ['#d7af00', '178'],
\ 'cursor_fg' : ['#1c1c1c', '234'],
\ 'cursor_bg' : ['#c6c6c6', '251'],
\ 'cursorline' : ['#303030', '236'],
\ 'cursorcolumn' : ['#303030', '236'],
\ 'cursorlinenr_fg' : ['#ffff00', '226'],
\ 'cursorlinenr_bg' : ['#1c1c1c', '234'],
\ 'popupmenu_fg' : ['#c6c6c6', '251'],
\ 'popupmenu_bg' : ['#303030', '236'],
\ 'search_fg' : ['#000000', '16'],
\ 'search_bg' : ['#00875f', '29'],
\ 'linenumber_fg' : ['#585858', '240'],
\ 'linenumber_bg' : ['#1c1c1c', '234'],
\ 'vertsplit_fg' : ['#5f8787', '66'],
\ 'vertsplit_bg' : ['#1c1c1c', '234'],
\ 'statusline_active_fg' : ['#1c1c1c', '234'],
\ 'statusline_active_bg' : ['#5f8787', '66'],
\ 'statusline_inactive_fg' : ['#bcbcbc', '250'],
\ 'statusline_inactive_bg' : ['#3a3a3a', '237'],
\ 'todo_fg' : ['#ff8700', '208'],
\ 'todo_bg' : ['#1c1c1c', '234'],
\ 'error_fg' : ['#af005f', '125'],
\ 'error_bg' : ['#5f0000', '52'],
\ 'matchparen_bg' : ['#4e4e4e', '239'],
\ 'matchparen_fg' : ['#c6c6c6', '251'],
\ 'visual_fg' : ['#000000', '16'],
\ 'visual_bg' : ['#8787af', '103'],
\ 'folded_fg' : ['#d787ff', '177'],
\ 'folded_bg' : ['#5f005f', '53'],
\ 'wildmenu_fg': ['#1c1c1c', '234'],
\ 'wildmenu_bg': ['#afd700', '148'],
\ 'spellbad': ['#5f0000', '52'],
\ 'spellcap': ['#5f005f', '53'],
\ 'spellrare': ['#005f00', '22'],
\ 'spelllocal': ['#00005f', '17'],
\ 'diffadd_fg': ['#87d700', '112'],
\ 'diffadd_bg': ['#005f00', '22'],
\ 'diffdelete_fg': ['#af005f', '125'],
\ 'diffdelete_bg': ['#5f0000', '52'],
\ 'difftext_fg': ['#5fffff', '87'],
\ 'difftext_bg': ['#008787', '30'],
\ 'diffchange_fg': ['#d0d0d0', '252'],
\ 'diffchange_bg': ['#005f5f', '23'],
\ 'tabline_bg': ['#262626', '235'],
\ 'tabline_active_fg': ['#121212', '233'],
\ 'tabline_active_bg': ['#00afaf', '37'],
\ 'tabline_inactive_fg': ['#bcbcbc', '250'],
\ 'tabline_inactive_bg': ['#585858', '240'],
\ 'buftabline_bg': ['#262626', '235'],
\ 'buftabline_current_fg': ['#121212', '233'],
\ 'buftabline_current_bg': ['#00afaf', '37'],
\ 'buftabline_active_fg': ['#00afaf', '37'],
\ 'buftabline_active_bg': ['#585858', '240'],
\ 'buftabline_inactive_fg': ['#bcbcbc', '250'],
\ 'buftabline_inactive_bg': ['#585858', '240']
\ }
\ }
endfun
" ============================ THEME REGISTER =================================
" Acquire Theme Data: {{{
" Brief:
" Function to get theme information and store in variables for other
" functions to use
"
" Require:
" s:themes <dictionary> collection of all theme palettes
"
" Require Optionally:
" {g:PaperColor_Theme_[s:theme_name]} <dictionary> user custom theme palette
" g:PaperColor_Theme_Options <dictionary> user options
"
" Expose:
" s:theme_name <string> the name of the selected theme
" s:selected_theme <dictionary> the selected theme object (contains palette, etc.)
" s:selected_variant <string> 'light' or 'dark'
" s:palette <dictionary> the palette of selected theme
" s:options <dictionary> user options
fun! s:acquire_theme_data()
" Get theme name: {{{
let s:theme_name = 'default'
if exists("g:PaperColor_Theme") " Users expressed theme preference
let lowercase_theme_name = tolower(g:PaperColor_Theme)
if lowercase_theme_name !=? 'default'
let theme_identifier = 'PaperColor_' . lowercase_theme_name
let autoload_function = theme_identifier . '#register'
call {autoload_function}()
let theme_variable = 'g:' . theme_identifier
if exists(theme_variable)
let s:theme_name = lowercase_theme_name
let s:themes[s:theme_name] = {theme_variable}
endif
endif
endif
" }}}
if s:theme_name ==? 'default'
" Either no other theme is specified or they failed to load
" Defer loading default theme until now
call s:register_default_theme()
endif
let s:selected_theme = s:themes[s:theme_name]
" Get Theme Variant: either dark or light {{{
let s:selected_variant = 'dark'
let s:is_dark=(&background == 'dark')
if s:is_dark
if has_key(s:selected_theme, 'dark')
let s:selected_variant = 'dark'
else " in case the theme only provides the other variant
let s:selected_variant = 'light'
endif
else " is light background
if has_key(s:selected_theme, 'light')
let s:selected_variant = 'light'
else " in case the theme only provides the other variant
let s:selected_variant = 'dark'
endif
endif
let s:palette = s:selected_theme[s:selected_variant].palette
" Systematic User-Config Options: {{{
" Example config in .vimrc
" let g:PaperColor_Theme_Options = {
" \ 'theme': {
" \ 'default': {
" \ 'allow_bold': 1,
" \ 'allow_italic': 0,
" \ 'transparent_background': 1
" \ }
" \ },
" \ 'language': {
" \ 'python': {
" \ 'highlight_builtins' : 1
" \ },
" \ 'c': {
" \ 'highlight_builtins' : 1
" \ },
" \ 'cpp': {
" \ 'highlight_standard_library': 1
" \ }
" \ }
" \ }
"
let s:options = {}
if exists("g:PaperColor_Theme_Options")
let s:options = g:PaperColor_Theme_Options
endif
" }}}
" }}}
endfun
" }}}
" Identify Color Mode: {{{
fun! s:identify_color_mode()
let s:MODE_16_COLOR = 0
let s:MODE_256_COLOR = 1
let s:MODE_GUI_COLOR = 2
if has("gui_running") || has('termguicolors') && &termguicolors || has('nvim') && $NVIM_TUI_ENABLE_TRUE_COLOR
let s:mode = s:MODE_GUI_COLOR
elseif (&t_Co >= 256)
let s:mode = s:MODE_256_COLOR
else
let s:mode = s:MODE_16_COLOR
endif
endfun
" }}}
" ============================ OPTION HANDLER =================================
" Generate Them Option Variables: {{{
fun! s:generate_theme_option_variables()
" 0. All possible theme option names must be registered here
let l:available_theme_options = [
\ 'allow_bold',
\ 'allow_italic',
\ 'transparent_background',
\ ]
" 1. Generate variables and set to default value
for l:option in l:available_theme_options
let s:{'themeOpt_' . l:option} = 0
endfor
let s:themeOpt_override = {} " special case, this has to be a dictionary
" 2. Reassign value to the above variables based on theme settings
" 2.1 In case the theme has top-level options
if has_key(s:selected_theme, 'options')
let l:theme_options = s:selected_theme['options']
for l:opt_name in keys(l:theme_options)
let s:{'themeOpt_' . l:opt_name} = l:theme_options[l:opt_name]
" echo 's:themeOpt_' . l:opt_name . ' = ' . s:{'themeOpt_' . l:opt_name}
endfor
endif
" 2.2 In case the theme has specific variant options
if has_key(s:selected_theme[s:selected_variant], 'options')
let l:theme_options = s:selected_theme[s:selected_variant]['options']
for l:opt_name in keys(l:theme_options)
let s:{'themeOpt_' . l:opt_name} = l:theme_options[l:opt_name]
" echo 's:themeOpt_' . l:opt_name . ' = ' . s:{'themeOpt_' . l:opt_name}
endfor
endif
" 3. Reassign value to the above variables which the user customizes
" Part of user-config options
let s:theme_options = {}
if has_key(s:options, 'theme')
let s:theme_options = s:options['theme']
endif
" 3.1 In case user sets for a theme without specifying which variant
if has_key(s:theme_options, s:theme_name)
let l:theme_options = s:theme_options[s:theme_name]
for l:opt_name in keys(l:theme_options)
let s:{'themeOpt_' . l:opt_name} = l:theme_options[l:opt_name]
" echo 's:themeOpt_' . l:opt_name . ' = ' . s:{'themeOpt_' . l:opt_name}
endfor
endif
" 3.2 In case user sets for a specific variant of a theme
" Create the string that the user might have set for this theme variant
" for example, 'default.dark'
let l:specific_theme_variant = s:theme_name . '.' . s:selected_variant
if has_key(s:theme_options, l:specific_theme_variant)
let l:theme_options = s:theme_options[l:specific_theme_variant]
for l:opt_name in keys(l:theme_options)
let s:{'themeOpt_' . l:opt_name} = l:theme_options[l:opt_name]
" echo 's:themeOpt_' . l:opt_name . ' = ' . s:{'themeOpt_' . l:opt_name}
endfor
endif
endfun
" }}}
" Check If Theme Has Hint: {{{
"
" Brief:
" Function to Check if the selected theme and variant has a hint
"
" Details:
" A hint is a known key that has value 1
" It is not part of theme design but is used for technical purposes
"
" Example:
" If a theme has hint 'NO_CONVERSION', then we can assume that every
" color value is a complete pair, so we don't have to check.
fun! s:theme_has_hint(hint)
return has_key(s:selected_theme[s:selected_variant], a:hint) &&
\ s:selected_theme[s:selected_variant][a:hint] == 1
endfun
" }}}
" Set Overriding Colors: {{{
fun! s:set_overriding_colors()
if s:theme_has_hint('NO_CONVERSION')
" s:convert_colors will not do anything, so we take care of conversion
" for the overriding colors that need to be converted
if s:mode == s:MODE_GUI_COLOR
" if GUI color is not provided, convert from 256 color that must be available
if !empty(s:themeOpt_override)
call s:load_256_to_GUI_converter()
endif
for l:color in keys(s:themeOpt_override)
let l:value = s:themeOpt_override[l:color]
if l:value[0] == ''
let l:value[0] = s:to_HEX[l:value[1]]
endif
let s:palette[l:color] = l:value
endfor
elseif s:mode == s:MODE_256_COLOR
" if 256 color is not provided, convert from GUI color that must be available
if !empty(s:themeOpt_override)
call s:load_GUI_to_256_converter()
endif
for l:color in keys(s:themeOpt_override)
let l:value = s:themeOpt_override[l:color]
if l:value[1] == ''
let l:value[1] = s:to_256(l:value[0])
endif
let s:palette[l:color] = l:value
endfor
endif
else " simply set the colors and let s:convert_colors() take care of conversion
for l:color in keys(s:themeOpt_override)
let s:palette[l:color] = s:themeOpt_override[l:color]
endfor
endif
endfun
" }}}
" Generate Language Option Variables: {{{
" Brief:
" Function to generate language option variables so that there is no need to
" look up from the dictionary every time the option value is checked in the
" function s:apply_syntax_highlightings()
"
" Require:
" s:options <dictionary> user options
"
" Require Optionally:
" g:PaperColor_Theme_Options <dictionary> user option config in .vimrc
"
" Expose:
" s:langOpt_[LANGUAGE]__[OPTION] <any> variables for language options
"
" Example:
" g:PaperColor_Theme_Options has something like this:
" 'language': {
" \ 'python': {
" \ 'highlight_builtins': 1
" \ }
" }
" The following variable will be generated:
" s:langOpt_python__highlight_builtins = 1
fun! s:generate_language_option_variables()
" 0. All possible theme option names must be registered here
let l:available_language_options = [
\ 'c__highlight_builtins',
\ 'cpp__highlight_standard_library',
\ 'python__highlight_builtins'
\ ]
" 1. Generate variables and set to default value
for l:option in l:available_language_options
let s:{'langOpt_' . l:option} = 0
endfor
" Part of user-config options
if has_key(s:options, 'language')
let l:language_options = s:options['language']
" echo l:language_options
for l:lang in keys(l:language_options)
let l:options = l:language_options[l:lang]
" echo l:lang
" echo l:options
for l:option in keys(l:options)
let s:{'langOpt_' . l:lang . '__' . l:option} = l:options[l:option]
" echo 's:langOpt_' . l:lang . '__' . l:option . ' = ' . l:options[l:option]
endfor
endfor
endif
endfun
" }}}
" =========================== COLOR CONVERTER =================================
fun! s:load_GUI_to_256_converter()
" GUI-color To 256-color: {{{
" Returns an approximate grey index for the given grey level
fun! s:grey_number(x)
if &t_Co == 88
if a:x < 23
return 0
elseif a:x < 69
return 1
elseif a:x < 103
return 2
elseif a:x < 127
return 3
elseif a:x < 150
return 4
elseif a:x < 173
return 5
elseif a:x < 196
return 6
elseif a:x < 219
return 7
elseif a:x < 243
return 8
else
return 9
endif
else
if a:x < 14
return 0
else
let l:n = (a:x - 8) / 10
let l:m = (a:x - 8) % 10
if l:m < 5
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" Returns the actual grey level represented by the grey index
fun! s:grey_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 46
elseif a:n == 2
return 92
elseif a:n == 3
return 115
elseif a:n == 4
return 139
elseif a:n == 5
return 162
elseif a:n == 6
return 185
elseif a:n == 7
return 208
elseif a:n == 8
return 231
else
return 255
endif
else
if a:n == 0
return 0
else
return 8 + (a:n * 10)
endif
endif
endfun
" Returns the palette index for the given grey index
fun! s:grey_colour(n)
if &t_Co == 88
if a:n == 0
return 16
elseif a:n == 9
return 79
else
return 79 + a:n
endif
else
if a:n == 0
return 16
elseif a:n == 25
return 231
else
return 231 + a:n
endif
endif
endfun
" Returns an approximate colour index for the given colour level
fun! s:rgb_number(x)
if &t_Co == 88
if a:x < 69
return 0
elseif a:x < 172
return 1
elseif a:x < 230
return 2
else
return 3
endif
else
if a:x < 75
return 0
else
let l:n = (a:x - 55) / 40
let l:m = (a:x - 55) % 40
if l:m < 20
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" Returns the actual colour level for the given colour index
fun! s:rgb_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 139
elseif a:n == 2
return 205
else
return 255
endif
else
if a:n == 0
return 0
else
return 55 + (a:n * 40)
endif
endif
endfun
" Returns the palette index for the given R/G/B colour indices
fun! s:rgb_colour(x, y, z)
if &t_Co == 88
return 16 + (a:x * 16) + (a:y * 4) + a:z
else
return 16 + (a:x * 36) + (a:y * 6) + a:z
endif
endfun
" Returns the palette index to approximate the given R/G/B colour levels
fun! s:colour(r, g, b)
" Get the closest grey
let l:gx = s:grey_number(a:r)
let l:gy = s:grey_number(a:g)
let l:gz = s:grey_number(a:b)
" Get the closest colour
let l:x = s:rgb_number(a:r)
let l:y = s:rgb_number(a:g)
let l:z = s:rgb_number(a:b)
if l:gx == l:gy && l:gy == l:gz
" There are two possibilities
let l:dgr = s:grey_level(l:gx) - a:r
let l:dgg = s:grey_level(l:gy) - a:g
let l:dgb = s:grey_level(l:gz) - a:b
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
let l:dr = s:rgb_level(l:gx) - a:r
let l:dg = s:rgb_level(l:gy) - a:g
let l:db = s:rgb_level(l:gz) - a:b
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
if l:dgrey < l:drgb
" Use the grey
return s:grey_colour(l:gx)
else
" Use the colour
return s:rgb_colour(l:x, l:y, l:z)
endif
else
" Only one possibility
return s:rgb_colour(l:x, l:y, l:z)
endif
endfun
" Returns the palette index to approximate the '#rrggbb' hex string
fun! s:to_256(rgb)
let l:r = ("0x" . strpart(a:rgb, 1, 2)) + 0
let l:g = ("0x" . strpart(a:rgb, 3, 2)) + 0
let l:b = ("0x" . strpart(a:rgb, 5, 2)) + 0
return s:colour(l:r, l:g, l:b)
endfun
" }}}
endfun
fun! s:load_256_to_GUI_converter()
" 256-color To GUI-color: {{{
""" Xterm 256 color dictionary
" See: http://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html
"
let s:to_HEX = {
\ '00': '#000000', '01': '#800000', '02': '#008000', '03': '#808000', '04': '#000080',
\ '05': '#800080', '06': '#008080', '07': '#c0c0c0', '08': '#808080', '09': '#ff0000',
\ '10': '#00ff00', '11': '#ffff00', '12': '#0000ff', '13': '#ff00ff', '14': '#00ffff',
\ '15': '#ffffff', '16': '#000000', '17': '#00005f', '18': '#000087', '19': '#0000af',
\ '20': '#0000d7', '21': '#0000ff', '22': '#005f00', '23': '#005f5f', '24': '#005f87',
\ '25': '#005faf', '26': '#005fd7', '27': '#005fff', '28': '#008700', '29': '#00875f',
\ '30': '#008787', '31': '#0087af', '32': '#0087d7', '33': '#0087ff', '34': '#00af00',
\ '35': '#00af5f', '36': '#00af87', '37': '#00afaf', '38': '#00afd7', '39': '#00afff',
\ '40': '#00d700', '41': '#00d75f', '42': '#00d787', '43': '#00d7af', '44': '#00d7d7',
\ '45': '#00d7ff', '46': '#00ff00', '47': '#00ff5f', '48': '#00ff87', '49': '#00ffaf',
\ '50': '#00ffd7', '51': '#00ffff', '52': '#5f0000', '53': '#5f005f', '54': '#5f0087',
\ '55': '#5f00af', '56': '#5f00d7', '57': '#5f00ff', '58': '#5f5f00', '59': '#5f5f5f',
\ '60': '#5f5f87', '61': '#5f5faf', '62': '#5f5fd7', '63': '#5f5fff', '64': '#5f8700',
\ '65': '#5f875f', '66': '#5f8787', '67': '#5f87af', '68': '#5f87d7', '69': '#5f87ff',
\ '70': '#5faf00', '71': '#5faf5f', '72': '#5faf87', '73': '#5fafaf', '74': '#5fafd7',
\ '75': '#5fafff', '76': '#5fd700', '77': '#5fd75f', '78': '#5fd787', '79': '#5fd7af',
\ '80': '#5fd7d7', '81': '#5fd7ff', '82': '#5fff00', '83': '#5fff5f', '84': '#5fff87',
\ '85': '#5fffaf', '86': '#5fffd7', '87': '#5fffff', '88': '#870000', '89': '#87005f',
\ '90': '#870087', '91': '#8700af', '92': '#8700d7', '93': '#8700ff', '94': '#875f00',
\ '95': '#875f5f', '96': '#875f87', '97': '#875faf', '98': '#875fd7', '99': '#875fff',
\ '100': '#878700', '101': '#87875f', '102': '#878787', '103': '#8787af', '104': '#8787d7',
\ '105': '#8787ff', '106': '#87af00', '107': '#87af5f', '108': '#87af87', '109': '#87afaf',
\ '110': '#87afd7', '111': '#87afff', '112': '#87d700', '113': '#87d75f', '114': '#87d787',
\ '115': '#87d7af', '116': '#87d7d7', '117': '#87d7ff', '118': '#87ff00', '119': '#87ff5f',
\ '120': '#87ff87', '121': '#87ffaf', '122': '#87ffd7', '123': '#87ffff', '124': '#af0000',
\ '125': '#af005f', '126': '#af0087', '127': '#af00af', '128': '#af00d7', '129': '#af00ff',
\ '130': '#af5f00', '131': '#af5f5f', '132': '#af5f87', '133': '#af5faf', '134': '#af5fd7',
\ '135': '#af5fff', '136': '#af8700', '137': '#af875f', '138': '#af8787', '139': '#af87af',
\ '140': '#af87d7', '141': '#af87ff', '142': '#afaf00', '143': '#afaf5f', '144': '#afaf87',
\ '145': '#afafaf', '146': '#afafd7', '147': '#afafff', '148': '#afd700', '149': '#afd75f',
\ '150': '#afd787', '151': '#afd7af', '152': '#afd7d7', '153': '#afd7ff', '154': '#afff00',
\ '155': '#afff5f', '156': '#afff87', '157': '#afffaf', '158': '#afffd7', '159': '#afffff',
\ '160': '#d70000', '161': '#d7005f', '162': '#d70087', '163': '#d700af', '164': '#d700d7',
\ '165': '#d700ff', '166': '#d75f00', '167': '#d75f5f', '168': '#d75f87', '169': '#d75faf',
\ '170': '#d75fd7', '171': '#d75fff', '172': '#d78700', '173': '#d7875f', '174': '#d78787',
\ '175': '#d787af', '176': '#d787d7', '177': '#d787ff', '178': '#d7af00', '179': '#d7af5f',
\ '180': '#d7af87', '181': '#d7afaf', '182': '#d7afd7', '183': '#d7afff', '184': '#d7d700',
\ '185': '#d7d75f', '186': '#d7d787', '187': '#d7d7af', '188': '#d7d7d7', '189': '#d7d7ff',
\ '190': '#d7ff00', '191': '#d7ff5f', '192': '#d7ff87', '193': '#d7ffaf', '194': '#d7ffd7',
\ '195': '#d7ffff', '196': '#ff0000', '197': '#ff005f', '198': '#ff0087', '199': '#ff00af',
\ '200': '#ff00d7', '201': '#ff00ff', '202': '#ff5f00', '203': '#ff5f5f', '204': '#ff5f87',
\ '205': '#ff5faf', '206': '#ff5fd7', '207': '#ff5fff', '208': '#ff8700', '209': '#ff875f',
\ '210': '#ff8787', '211': '#ff87af', '212': '#ff87d7', '213': '#ff87ff', '214': '#ffaf00',
\ '215': '#ffaf5f', '216': '#ffaf87', '217': '#ffafaf', '218': '#ffafd7', '219': '#ffafff',
\ '220': '#ffd700', '221': '#ffd75f', '222': '#ffd787', '223': '#ffd7af', '224': '#ffd7d7',
\ '225': '#ffd7ff', '226': '#ffff00', '227': '#ffff5f', '228': '#ffff87', '229': '#ffffaf',
\ '230': '#ffffd7', '231': '#ffffff', '232': '#080808', '233': '#121212', '234': '#1c1c1c',
\ '235': '#262626', '236': '#303030', '237': '#3a3a3a', '238': '#444444', '239': '#4e4e4e',
\ '240': '#585858', '241': '#626262', '242': '#6c6c6c', '243': '#767676', '244': '#808080',
\ '245': '#8a8a8a', '246': '#949494', '247': '#9e9e9e', '248': '#a8a8a8', '249': '#b2b2b2',
\ '250': '#bcbcbc', '251': '#c6c6c6', '252': '#d0d0d0', '253': '#dadada', '254': '#e4e4e4',
\ '255': '#eeeeee' }
" }}}
endfun
" ========================== ENVIRONMENT ADAPTER ==============================
" Set Format Attributes: {{{
fun! s:set_format_attributes()
" These are the default
if s:mode == s:MODE_GUI_COLOR
let s:ft_bold = " cterm=bold gui=bold "
let s:ft_none = " cterm=none gui=none "
let s:ft_reverse = " cterm=reverse gui=reverse "
let s:ft_italic = " cterm=italic gui=italic "
let s:ft_italic_bold = " cterm=italic,bold gui=italic,bold "
elseif s:mode == s:MODE_256_COLOR
let s:ft_bold = " cterm=bold "
let s:ft_none = " cterm=none "
let s:ft_reverse = " cterm=reverse "
let s:ft_italic = " cterm=italic "
let s:ft_italic_bold = " cterm=italic,bold "
else
let s:ft_bold = ""
let s:ft_none = " cterm=none "
let s:ft_reverse = " cterm=reverse "
let s:ft_italic = ""
let s:ft_italic_bold = ""
endif
" Unless instructed otherwise either by theme setting or user overriding
if s:themeOpt_allow_bold == 0
let s:ft_bold = ""
endif
if s:themeOpt_allow_italic == 0
let s:ft_italic = ""
let s:ft_italic_bold = s:ft_bold
endif
endfun
" }}}
" Convert Colors If Needed: {{{
fun! s:convert_colors()
if s:theme_has_hint('NO_CONVERSION')
return
endif
if s:mode == s:MODE_GUI_COLOR
" if GUI color is not provided, convert from 256 color that must be available
call s:load_256_to_GUI_converter()
for l:color in keys(s:palette)
let l:value = s:palette[l:color]
if l:value[0] == ''
let l:value[0] = s:to_HEX[l:value[1]]
endif
let s:palette[l:color] = l:value
endfor
elseif s:mode == s:MODE_256_COLOR
" if 256 color is not provided, convert from GUI color that must be available
call s:load_GUI_to_256_converter()
for l:color in keys(s:palette)
let l:value = s:palette[l:color]
if l:value[1] == ''
let l:value[1] = s:to_256(l:value[0])
endif
let s:palette[l:color] = l:value
endfor
endif
" otherwise use the terminal colors and none of the theme colors are used
endfun
" }}}
" ============================ COLOR POPULARIZER ===============================
" Set Color Variables: {{{
fun! s:set_color_variables()
" Helper: {{{
" -------
" Function to dynamically generate variables that store the color strings
" for setting highlighting. Each color name will have 2 variables with prefix
" s:fg_ and s:bg_. For example:
" if a:color_name is 'Normal' and a:color_value is ['#000000', '0', 'Black'],
" the following 2 variables will be created:
" s:fg_Normal that stores the string ' guifg=#000000 '
" s:bg_Normal that stores the string ' guibg=#000000 '
" Depending on the color mode, ctermfg and ctermbg will be either 0 or Black
"
" Rationale:
" The whole purpose is for speed. We generate these ahead of time so that we
" don't have to do look up or do any if-branch when we set the highlightings.
"
" Furthermore, multiple function definitions for each mode actually reduces
" the need for multiple if-branches inside a single function. This is not
" pretty, but Vim Script is slow, so reducing if-branches in function that is
" often called helps speeding things up quite a bit. Think of this like macro.
"
" If you are familiar with the old code base (v0.9 and ealier), this way of
" generate variables dramatically reduces the loading speed.
" None of previous optimization tricks gets anywhere near this.
if s:mode == s:MODE_GUI_COLOR
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' guifg=' . a:rich_color[0] . ' '
let {'s:bg_' . a:color_name} = ' guibg=' . a:rich_color[0] . ' '
endfun
elseif s:mode == s:MODE_256_COLOR
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' ctermfg=' . a:rich_color[1] . ' '
let {'s:bg_' . a:color_name} = ' ctermbg=' . a:rich_color[1] . ' '
endfun
else
fun! s:create_color_variables(color_name, rich_color, term_color)
let {'s:fg_' . a:color_name} = ' ctermfg=' . a:term_color . ' '
let {'s:bg_' . a:color_name} = ' ctermbg=' . a:term_color . ' '
endfun
endif
" }}}
" Color value format: Array [<GUI COLOR/HEX >, <256-Base>, <16-Base>]
" 16-Base is terminal's native color palette that can be alternated through
" the terminal settings. The 16-color names are according to `:h cterm-colors`
" BASIC COLORS:
" color00-15 are required by all themes.
" These are also how the terminal color palette for the target theme should be.
" See README for theme design guideline
"
" An example format of the below variable's value: ['#262626', '234', 'Black']
" Where the 1st value is HEX color for GUI Vim, 2nd value is for 256-color terminal,
" and the color name on the right is for 16-color terminal (the actual terminal colors
" can be different from what the color names suggest). See :h cterm-colors
"
" Depending on the provided color palette and current Vim, the 1st and 2nd
" parameter might not exist, for example, on 16-color terminal, the variables below
" only store the color names to use the terminal color palette which is the only
" thing available therefore no need for GUI-color or 256-color.
let color00 = get(s:palette, 'color00')
let color01 = get(s:palette, 'color01')
let color02 = get(s:palette, 'color02')
let color03 = get(s:palette, 'color03')
let color04 = get(s:palette, 'color04')
let color05 = get(s:palette, 'color05')
let color06 = get(s:palette, 'color06')
let color07 = get(s:palette, 'color07')
let color08 = get(s:palette, 'color08')
let color09 = get(s:palette, 'color09')
let color10 = get(s:palette, 'color10')
let color11 = get(s:palette, 'color11')
let color12 = get(s:palette, 'color12')
let color13 = get(s:palette, 'color13')
let color14 = get(s:palette, 'color14')
let color15 = get(s:palette, 'color15')
call s:create_color_variables('background', color00 , 'Black')
call s:create_color_variables('negative', color01 , 'DarkRed')
call s:create_color_variables('positive', color02 , 'DarkGreen')
call s:create_color_variables('olive', color03 , 'DarkYellow') " string
call s:create_color_variables('neutral', color04 , 'DarkBlue')
call s:create_color_variables('comment', color05 , 'DarkMagenta')
call s:create_color_variables('navy', color06 , 'DarkCyan') " storageclass
call s:create_color_variables('foreground', color07 , 'LightGray')
call s:create_color_variables('nontext', color08 , 'DarkGray')
call s:create_color_variables('red', color09 , 'LightRed') " import / try/catch
call s:create_color_variables('pink', color10 , 'LightGreen') " statement, type
call s:create_color_variables('purple', color11 , 'LightYellow') " if / conditional
call s:create_color_variables('accent', color12 , 'LightBlue')
call s:create_color_variables('orange', color13 , 'LightMagenta') " number
call s:create_color_variables('blue', color14 , 'LightCyan') " other keyword
call s:create_color_variables('highlight', color15 , 'White')
" Note: special case for FoldColumn group. I want to get rid of this case.
call s:create_color_variables('transparent', [color00[0], 'none'], 'none')
" EXTENDED COLORS:
" From here on, all colors are optional and must have default values (3rd parameter of the
" `get` command) that point to the above basic colors in case the target theme doesn't
" provide the extended colors. The default values should be reasonably sensible.
" The terminal color must be provided also.
call s:create_color_variables('aqua', get(s:palette, 'color16', color14) , 'LightCyan')
call s:create_color_variables('green', get(s:palette, 'color17', color13) , 'LightMagenta')
call s:create_color_variables('wine', get(s:palette, 'color18', color11) , 'LightYellow')
" LineNumber: when set number
call s:create_color_variables('linenumber_fg', get(s:palette, 'linenumber_fg', color08) , 'DarkGray')
call s:create_color_variables('linenumber_bg', get(s:palette, 'linenumber_bg', color00) , 'Black')
" Vertical Split: when there are more than 1 window side by side, ex: <C-W><C-V>
call s:create_color_variables('vertsplit_fg', get(s:palette, 'vertsplit_fg', color15) , 'White')
call s:create_color_variables('vertsplit_bg', get(s:palette, 'vertsplit_bg', color00) , 'Black')
" Statusline: when set status=2
call s:create_color_variables('statusline_active_fg', get(s:palette, 'statusline_active_fg', color00) , 'Black')
call s:create_color_variables('statusline_active_bg', get(s:palette, 'statusline_active_bg', color15) , 'White')
call s:create_color_variables('statusline_inactive_fg', get(s:palette, 'statusline_inactive_fg', color07) , 'LightGray')
call s:create_color_variables('statusline_inactive_bg', get(s:palette, 'statusline_inactive_bg', color08) , 'DarkGray')
" Cursor: in normal mode
call s:create_color_variables('cursor_fg', get(s:palette, 'cursor_fg', color00) , 'Black')
call s:create_color_variables('cursor_bg', get(s:palette, 'cursor_bg', color07) , 'LightGray')
call s:create_color_variables('cursorline', get(s:palette, 'cursorline', color00) , 'Black')
" CursorColumn: when set cursorcolumn
call s:create_color_variables('cursorcolumn', get(s:palette, 'cursorcolumn', color00) , 'Black')
" CursorLine Number: when set cursorline number
call s:create_color_variables('cursorlinenr_fg', get(s:palette, 'cursorlinenr_fg', color13) , 'LightMagenta')
call s:create_color_variables('cursorlinenr_bg', get(s:palette, 'cursorlinenr_bg', color00) , 'Black')
" Popup Menu: when <C-X><C-N> for autocomplete
call s:create_color_variables('popupmenu_fg', get(s:palette, 'popupmenu_fg', color07) , 'LightGray')
call s:create_color_variables('popupmenu_bg', get(s:palette, 'popupmenu_bg', color08) , 'DarkGray') " TODO: double check this, might resolve an issue
" Search: ex: when * on a word
call s:create_color_variables('search_fg', get(s:palette, 'search_fg', color00) , 'Black')
call s:create_color_variables('search_bg', get(s:palette, 'search_bg', color15) , 'Yellow')
" Todo: ex: TODO
call s:create_color_variables('todo_fg', get(s:palette, 'todo_fg', color05) , 'LightYellow')
call s:create_color_variables('todo_bg', get(s:palette, 'todo_bg', color00) , 'Black')
" Error: ex: turn spell on and have invalid words
call s:create_color_variables('error_fg', get(s:palette, 'error_fg', color01) , 'DarkRed')
call s:create_color_variables('error_bg', get(s:palette, 'error_bg', color00) , 'Black')
" Match Parenthesis: selecting an opening/closing pair and the other one will be highlighted
call s:create_color_variables('matchparen_fg', get(s:palette, 'matchparen_fg', color00) , 'LightMagenta')
call s:create_color_variables('matchparen_bg', get(s:palette, 'matchparen_bg', color05) , 'Black')
" Visual:
call s:create_color_variables('visual_fg', get(s:palette, 'visual_fg', color08) , 'Black')
call s:create_color_variables('visual_bg', get(s:palette, 'visual_bg', color07) , 'White')
" Folded:
call s:create_color_variables('folded_fg', get(s:palette, 'folded_fg', color00) , 'Black')
call s:create_color_variables('folded_bg', get(s:palette, 'folded_bg', color05) , 'DarkYellow')
" WildMenu: Autocomplete command, ex: :color <tab><tab>
call s:create_color_variables('wildmenu_fg', get(s:palette, 'wildmenu_fg', color00) , 'Black')
call s:create_color_variables('wildmenu_bg', get(s:palette, 'wildmenu_bg', color06) , 'LightGray')
" Spelling: when spell on and there are spelling problems like this for example: papercolor. a vim color scheme
call s:create_color_variables('spellbad', get(s:palette, 'spellbad', color04) , 'DarkRed')
call s:create_color_variables('spellcap', get(s:palette, 'spellcap', color05) , 'DarkMagenta')
call s:create_color_variables('spellrare', get(s:palette, 'spellrare', color06) , 'DarkYellow')
call s:create_color_variables('spelllocal', get(s:palette, 'spelllocal', color01) , 'DarkBlue')
" Diff:
call s:create_color_variables('diffadd_fg', get(s:palette, 'diffadd_fg', color00) , 'Black')
call s:create_color_variables('diffadd_bg', get(s:palette, 'diffadd_bg', color02) , 'DarkGreen')
call s:create_color_variables('diffdelete_fg', get(s:palette, 'diffdelete_fg', color00) , 'Black')
call s:create_color_variables('diffdelete_bg', get(s:palette, 'diffdelete_bg', color04) , 'DarkRed')
call s:create_color_variables('difftext_fg', get(s:palette, 'difftext_fg', color00) , 'Black')
call s:create_color_variables('difftext_bg', get(s:palette, 'difftext_bg', color06) , 'DarkYellow')
call s:create_color_variables('diffchange_fg', get(s:palette, 'diffchange_fg', color00) , 'Black')
call s:create_color_variables('diffchange_bg', get(s:palette, 'diffchange_bg', color14) , 'LightYellow')
" Tabline: when having tabs, ex: :tabnew
call s:create_color_variables('tabline_bg', get(s:palette, 'tabline_bg', color00) , 'Black')
call s:create_color_variables('tabline_active_fg', get(s:palette, 'tabline_active_fg', color07) , 'LightGray')
call s:create_color_variables('tabline_active_bg', get(s:palette, 'tabline_active_bg', color00) , 'Black')
call s:create_color_variables('tabline_inactive_fg', get(s:palette, 'tabline_inactive_fg', color07) , 'Black')
call s:create_color_variables('tabline_inactive_bg', get(s:palette, 'tabline_inactive_bg', color08) , 'DarkMagenta')
" Plugin: BufTabLine https://github.com/ap/vim-buftabline
call s:create_color_variables('buftabline_bg', get(s:palette, 'buftabline_bg', color00) , 'Black')
call s:create_color_variables('buftabline_current_fg', get(s:palette, 'buftabline_current_fg', color07) , 'LightGray')
call s:create_color_variables('buftabline_current_bg', get(s:palette, 'buftabline_current_bg', color05) , 'DarkMagenta')
call s:create_color_variables('buftabline_active_fg', get(s:palette, 'buftabline_active_fg', color07) , 'LightGray')
call s:create_color_variables('buftabline_active_bg', get(s:palette, 'buftabline_active_bg', color12) , 'LightBlue')
call s:create_color_variables('buftabline_inactive_fg', get(s:palette, 'buftabline_inactive_fg', color07) , 'LightGray')
call s:create_color_variables('buftabline_inactive_bg', get(s:palette, 'buftabline_inactive_bg', color00) , 'Black')
" Neovim terminal colors https://neovim.io/doc/user/nvim_terminal_emulator.html#nvim-terminal-emulator-configuration
" TODO: Fix this
let g:terminal_color_0 = color00[0]
let g:terminal_color_1 = color01[0]
let g:terminal_color_2 = color02[0]
let g:terminal_color_3 = color03[0]
let g:terminal_color_4 = color04[0]
let g:terminal_color_5 = color05[0]
let g:terminal_color_6 = color06[0]
let g:terminal_color_7 = color07[0]
let g:terminal_color_8 = color08[0]
let g:terminal_color_9 = color09[0]
let g:terminal_color_10 = color10[0]
let g:terminal_color_11 = color11[0]
let g:terminal_color_12 = color12[0]
let g:terminal_color_13 = color13[0]
let g:terminal_color_14 = color14[0]
let g:terminal_color_15 = color15[0]
" Vim 8's :terminal buffer ANSI colors
if has('terminal')
let g:terminal_ansi_colors = [color00[0], color01[0], color02[0], color03[0],
\ color04[0], color05[0], color06[0], color07[0], color08[0], color09[0],
\ color10[0], color11[0], color12[0], color13[0], color14[0], color15[0]]
endif
endfun
" }}}
" Apply Syntax Highlightings: {{{
fun! s:apply_syntax_highlightings()
if s:themeOpt_transparent_background
exec 'hi Normal' . s:fg_foreground
" Switching between dark & light variant through `set background`
" NOTE: Handle background switching right after `Normal` group because of
" God-know-why reason. Not doing this way had caused issue before
if s:is_dark " DARK VARIANT
set background=dark
else " LIGHT VARIANT
set background=light
endif
exec 'hi NonText' . s:fg_nontext
exec 'hi LineNr' . s:fg_linenumber_fg
exec 'hi Conceal' . s:fg_linenumber_fg
exec 'hi VertSplit' . s:fg_vertsplit_fg . s:ft_none
exec 'hi FoldColumn' . s:fg_folded_fg . s:bg_transparent . s:ft_none
else
exec 'hi Normal' . s:fg_foreground . s:bg_background
" Switching between dark & light variant through `set background`
if s:is_dark " DARK VARIANT
set background=dark
exec 'hi EndOfBuffer' . s:fg_cursor_fg . s:ft_none
else " LIGHT VARIANT
set background=light
endif
exec 'hi NonText' . s:fg_nontext . s:bg_background
exec 'hi LineNr' . s:fg_linenumber_fg . s:bg_linenumber_bg
exec 'hi Conceal' . s:fg_linenumber_fg . s:bg_linenumber_bg
exec 'hi VertSplit' . s:fg_vertsplit_bg . s:bg_vertsplit_fg
exec 'hi FoldColumn' . s:fg_folded_fg . s:bg_background . s:ft_none
endif
exec 'hi Cursor' . s:fg_cursor_fg . s:bg_cursor_bg
exec 'hi SpecialKey' . s:fg_nontext
exec 'hi Search' . s:fg_search_fg . s:bg_search_bg
exec 'hi StatusLine' . s:fg_statusline_active_bg . s:bg_statusline_active_fg
exec 'hi StatusLineNC' . s:fg_statusline_inactive_bg . s:bg_statusline_inactive_fg
exec 'hi StatusLineTerm' . s:fg_statusline_active_bg . s:bg_statusline_active_fg
exec 'hi StatusLineTermNC' . s:fg_statusline_inactive_bg . s:bg_statusline_inactive_fg
exec 'hi Visual' . s:fg_visual_fg . s:bg_visual_bg
exec 'hi Directory' . s:fg_blue
exec 'hi ModeMsg' . s:fg_olive
exec 'hi MoreMsg' . s:fg_olive
exec 'hi Question' . s:fg_olive
exec 'hi WarningMsg' . s:fg_pink
exec 'hi MatchParen' . s:fg_matchparen_fg . s:bg_matchparen_bg
exec 'hi Folded' . s:fg_folded_fg . s:bg_folded_bg
exec 'hi WildMenu' . s:fg_wildmenu_fg . s:bg_wildmenu_bg . s:ft_bold
if version >= 700
exec 'hi CursorLine' . s:bg_cursorline . s:ft_none
if s:mode == s:MODE_16_COLOR
exec 'hi CursorLineNr' . s:fg_cursorlinenr_fg . s:bg_cursorlinenr_bg
else
exec 'hi CursorLineNr' . s:fg_cursorlinenr_fg . s:bg_cursorlinenr_bg . s:ft_none
endif
exec 'hi CursorColumn' . s:bg_cursorcolumn . s:ft_none
exec 'hi PMenu' . s:fg_popupmenu_fg . s:bg_popupmenu_bg . s:ft_none
exec 'hi PMenuSel' . s:fg_popupmenu_fg . s:bg_popupmenu_bg . s:ft_reverse
if s:themeOpt_transparent_background
exec 'hi SignColumn' . s:fg_green . s:ft_none
else
exec 'hi SignColumn' . s:fg_green . s:bg_background . s:ft_none
endif
end
if version >= 703
exec 'hi ColorColumn' . s:bg_cursorcolumn . s:ft_none
end
exec 'hi TabLine' . s:fg_tabline_inactive_fg . s:bg_tabline_inactive_bg . s:ft_none
exec 'hi TabLineFill' . s:fg_tabline_bg . s:bg_tabline_bg . s:ft_none
exec 'hi TabLineSel' . s:fg_tabline_active_fg . s:bg_tabline_active_bg . s:ft_none
exec 'hi BufTabLineCurrent' . s:fg_buftabline_current_fg . s:bg_buftabline_current_bg . s:ft_none
exec 'hi BufTabLineActive' . s:fg_buftabline_active_fg . s:bg_buftabline_active_bg . s:ft_none
exec 'hi BufTabLineHidden' . s:fg_buftabline_inactive_fg . s:bg_buftabline_inactive_bg . s:ft_none
exec 'hi BufTabLineFill' . s:bg_buftabline_bg . s:ft_none
" Standard Group Highlighting:
exec 'hi Comment' . s:fg_comment . s:ft_italic
exec 'hi Constant' . s:fg_orange
exec 'hi String' . s:fg_olive
exec 'hi Character' . s:fg_olive
exec 'hi Number' . s:fg_orange
exec 'hi Boolean' . s:fg_green . s:ft_bold
exec 'hi Float' . s:fg_orange
exec 'hi Identifier' . s:fg_navy
exec 'hi Function' . s:fg_foreground
exec 'hi Statement' . s:fg_pink . s:ft_none
exec 'hi Conditional' . s:fg_purple . s:ft_bold
exec 'hi Repeat' . s:fg_purple . s:ft_bold
exec 'hi Label' . s:fg_blue
exec 'hi Operator' . s:fg_aqua . s:ft_none
exec 'hi Keyword' . s:fg_blue
exec 'hi Exception' . s:fg_red
exec 'hi PreProc' . s:fg_blue
exec 'hi Include' . s:fg_red
exec 'hi Define' . s:fg_blue
exec 'hi Macro' . s:fg_blue
exec 'hi PreCondit' . s:fg_aqua
exec 'hi Type' . s:fg_pink . s:ft_bold
exec 'hi StorageClass' . s:fg_navy . s:ft_bold
exec 'hi Structure' . s:fg_blue . s:ft_bold
exec 'hi Typedef' . s:fg_pink . s:ft_bold
exec 'hi Special' . s:fg_foreground
exec 'hi SpecialChar' . s:fg_foreground
exec 'hi Tag' . s:fg_green
exec 'hi Delimiter' . s:fg_aqua
exec 'hi SpecialComment' . s:fg_comment . s:ft_bold
exec 'hi Debug' . s:fg_orange
exec 'hi Error' . s:fg_error_fg . s:bg_error_bg
exec 'hi Todo' . s:fg_todo_fg . s:bg_todo_bg . s:ft_bold
exec 'hi Title' . s:fg_comment
exec 'hi Global' . s:fg_blue
" Extension {{{
" VimL Highlighting
exec 'hi vimCommand' . s:fg_pink
exec 'hi vimVar' . s:fg_navy
exec 'hi vimFuncKey' . s:fg_pink
exec 'hi vimFunction' . s:fg_blue . s:ft_bold
exec 'hi vimNotFunc' . s:fg_pink
exec 'hi vimMap' . s:fg_red
exec 'hi vimAutoEvent' . s:fg_aqua . s:ft_bold
exec 'hi vimMapModKey' . s:fg_aqua
exec 'hi vimFuncName' . s:fg_purple
exec 'hi vimIsCommand' . s:fg_foreground
exec 'hi vimFuncVar' . s:fg_aqua
exec 'hi vimLet' . s:fg_red
exec 'hi vimContinue' . s:fg_aqua
exec 'hi vimMapRhsExtend' . s:fg_foreground
exec 'hi vimCommentTitle' . s:fg_comment . s:ft_italic_bold
exec 'hi vimBracket' . s:fg_aqua
exec 'hi vimParenSep' . s:fg_aqua
exec 'hi vimNotation' . s:fg_aqua
exec 'hi vimOper' . s:fg_foreground
exec 'hi vimOperParen' . s:fg_foreground
exec 'hi vimSynType' . s:fg_purple
exec 'hi vimSynReg' . s:fg_pink . s:ft_none
exec 'hi vimSynRegion' . s:fg_foreground
exec 'hi vimSynMtchGrp' . s:fg_pink
exec 'hi vimSynNextgroup' . s:fg_pink
exec 'hi vimSynKeyRegion' . s:fg_green
exec 'hi vimSynRegOpt' . s:fg_blue
exec 'hi vimSynMtchOpt' . s:fg_blue
exec 'hi vimSynContains' . s:fg_pink
exec 'hi vimGroupName' . s:fg_foreground
exec 'hi vimGroupList' . s:fg_foreground
exec 'hi vimHiGroup' . s:fg_foreground
exec 'hi vimGroup' . s:fg_navy . s:ft_bold
exec 'hi vimOnlyOption' . s:fg_blue
" Makefile Highlighting
exec 'hi makeIdent' . s:fg_blue
exec 'hi makeSpecTarget' . s:fg_olive
exec 'hi makeTarget' . s:fg_red
exec 'hi makeStatement' . s:fg_aqua . s:ft_bold
exec 'hi makeCommands' . s:fg_foreground
exec 'hi makeSpecial' . s:fg_orange . s:ft_bold
" CMake Highlighting (Builtin)
exec 'hi cmakeStatement' . s:fg_blue
exec 'hi cmakeArguments' . s:fg_foreground
exec 'hi cmakeVariableValue' . s:fg_pink
" CMake Highlighting (Plugin: https://github.com/pboettch/vim-cmake-syntax)
exec 'hi cmakeCommand' . s:fg_blue
exec 'hi cmakeCommandConditional' . s:fg_purple . s:ft_bold
exec 'hi cmakeKWset' . s:fg_orange
exec 'hi cmakeKWvariable_watch' . s:fg_orange
exec 'hi cmakeKWif' . s:fg_orange
exec 'hi cmakeArguments' . s:fg_foreground
exec 'hi cmakeKWproject' . s:fg_pink
exec 'hi cmakeGeneratorExpressions' . s:fg_orange
exec 'hi cmakeGeneratorExpression' . s:fg_aqua
exec 'hi cmakeVariable' . s:fg_pink
exec 'hi cmakeProperty' . s:fg_aqua
exec 'hi cmakeKWforeach' . s:fg_aqua
exec 'hi cmakeKWunset' . s:fg_aqua
exec 'hi cmakeKWmacro' . s:fg_aqua
exec 'hi cmakeKWget_property' . s:fg_aqua
exec 'hi cmakeKWset_tests_properties' . s:fg_aqua
exec 'hi cmakeKWmessage' . s:fg_aqua
exec 'hi cmakeKWinstall_targets' . s:fg_orange
exec 'hi cmakeKWsource_group' . s:fg_orange
exec 'hi cmakeKWfind_package' . s:fg_aqua
exec 'hi cmakeKWstring' . s:fg_olive
exec 'hi cmakeKWinstall' . s:fg_aqua
exec 'hi cmakeKWtarget_sources' . s:fg_orange
" C Highlighting
exec 'hi cType' . s:fg_pink . s:ft_bold
exec 'hi cFormat' . s:fg_olive
exec 'hi cStorageClass' . s:fg_navy . s:ft_bold
exec 'hi cBoolean' . s:fg_green . s:ft_bold
exec 'hi cCharacter' . s:fg_olive
exec 'hi cConstant' . s:fg_green . s:ft_bold
exec 'hi cConditional' . s:fg_purple . s:ft_bold
exec 'hi cSpecial' . s:fg_olive . s:ft_bold
exec 'hi cDefine' . s:fg_blue
exec 'hi cNumber' . s:fg_orange
exec 'hi cPreCondit' . s:fg_aqua
exec 'hi cRepeat' . s:fg_purple . s:ft_bold
exec 'hi cLabel' . s:fg_aqua
" exec 'hi cAnsiFunction' . s:fg_aqua . s:ft_bold
" exec 'hi cAnsiName' . s:fg_pink
exec 'hi cDelimiter' . s:fg_blue
" exec 'hi cBraces' . s:fg_foreground
" exec 'hi cIdentifier' . s:fg_blue . s:bg_pink
" exec 'hi cSemiColon' . s:bg_blue
exec 'hi cOperator' . s:fg_aqua
" exec 'hi cStatement' . s:fg_pink
" exec 'hi cTodo' . s:fg_comment . s:ft_bold
" exec 'hi cStructure' . s:fg_blue . s:ft_bold
exec 'hi cCustomParen' . s:fg_foreground
" exec 'hi cCustomFunc' . s:fg_foreground
" exec 'hi cUserFunction' . s:fg_blue . s:ft_bold
exec 'hi cOctalZero' . s:fg_purple . s:ft_bold
if s:langOpt_c__highlight_builtins == 1
exec 'hi cFunction' . s:fg_blue
else
exec 'hi cFunction' . s:fg_foreground
endif
" CPP highlighting
exec 'hi cppBoolean' . s:fg_green . s:ft_bold
exec 'hi cppSTLnamespace' . s:fg_purple
exec 'hi cppSTLexception' . s:fg_pink
exec 'hi cppSTLfunctional' . s:fg_foreground . s:ft_bold
exec 'hi cppSTLiterator' . s:fg_foreground . s:ft_bold
exec 'hi cppExceptions' . s:fg_red
exec 'hi cppStatement' . s:fg_blue
exec 'hi cppStorageClass' . s:fg_navy . s:ft_bold
exec 'hi cppAccess' . s:fg_orange . s:ft_bold
if s:langOpt_cpp__highlight_standard_library == 1
exec 'hi cppSTLconstant' . s:fg_green . s:ft_bold
exec 'hi cppSTLtype' . s:fg_pink . s:ft_bold
exec 'hi cppSTLfunction' . s:fg_blue
exec 'hi cppSTLios' . s:fg_olive . s:ft_bold
else
exec 'hi cppSTLconstant' . s:fg_foreground
exec 'hi cppSTLtype' . s:fg_foreground
exec 'hi cppSTLfunction' . s:fg_foreground
exec 'hi cppSTLios' . s:fg_foreground
endif
" exec 'hi cppSTL' . s:fg_blue
" Rust highlighting
exec 'hi rustKeyword' . s:fg_pink
exec 'hi rustModPath' . s:fg_blue
exec 'hi rustModPathSep' . s:fg_blue
exec 'hi rustLifetime' . s:fg_purple
exec 'hi rustStructure' . s:fg_aqua . s:ft_bold
exec 'hi rustAttribute' . s:fg_aqua . s:ft_bold
exec 'hi rustPanic' . s:fg_olive . s:ft_bold
exec 'hi rustTrait' . s:fg_blue . s:ft_bold
exec 'hi rustEnum' . s:fg_green . s:ft_bold
exec 'hi rustEnumVariant' . s:fg_green
exec 'hi rustSelf' . s:fg_orange
exec 'hi rustSigil' . s:fg_aqua . s:ft_bold
exec 'hi rustOperator' . s:fg_aqua . s:ft_bold
exec 'hi rustMacro' . s:fg_olive . s:ft_bold
exec 'hi rustMacroVariable' . s:fg_olive
exec 'hi rustAssert' . s:fg_olive . s:ft_bold
exec 'hi rustConditional' . s:fg_purple . s:ft_bold
" Lex highlighting
exec 'hi lexCFunctions' . s:fg_foreground
exec 'hi lexAbbrv' . s:fg_purple
exec 'hi lexAbbrvRegExp' . s:fg_aqua
exec 'hi lexAbbrvComment' . s:fg_comment
exec 'hi lexBrace' . s:fg_navy
exec 'hi lexPat' . s:fg_aqua
exec 'hi lexPatComment' . s:fg_comment
exec 'hi lexPatTag' . s:fg_orange
" exec 'hi lexPatBlock' . s:fg_foreground . s:ft_bold
exec 'hi lexSlashQuote' . s:fg_foreground
exec 'hi lexSep' . s:fg_foreground
exec 'hi lexStartState' . s:fg_orange
exec 'hi lexPatTagZone' . s:fg_olive . s:ft_bold
exec 'hi lexMorePat' . s:fg_olive . s:ft_bold
exec 'hi lexOptions' . s:fg_olive . s:ft_bold
exec 'hi lexPatString' . s:fg_olive
" Yacc highlighting
exec 'hi yaccNonterminal' . s:fg_navy
exec 'hi yaccDelim' . s:fg_orange
exec 'hi yaccInitKey' . s:fg_aqua
exec 'hi yaccInit' . s:fg_navy
exec 'hi yaccKey' . s:fg_purple
exec 'hi yaccVar' . s:fg_aqua
" NASM highlighting
exec 'hi nasmStdInstruction' . s:fg_navy
exec 'hi nasmGen08Register' . s:fg_aqua
exec 'hi nasmGen16Register' . s:fg_aqua
exec 'hi nasmGen32Register' . s:fg_aqua
exec 'hi nasmGen64Register' . s:fg_aqua
exec 'hi nasmHexNumber' . s:fg_purple
exec 'hi nasmStorage' . s:fg_aqua . s:ft_bold
exec 'hi nasmLabel' . s:fg_pink
exec 'hi nasmDirective' . s:fg_blue . s:ft_bold
exec 'hi nasmLocalLabel' . s:fg_orange
" GAS highlighting
exec 'hi gasSymbol' . s:fg_pink
exec 'hi gasDirective' . s:fg_blue . s:ft_bold
exec 'hi gasOpcode_386_Base' . s:fg_navy
exec 'hi gasDecimalNumber' . s:fg_purple
exec 'hi gasSymbolRef' . s:fg_pink
exec 'hi gasRegisterX86' . s:fg_blue
exec 'hi gasOpcode_P6_Base' . s:fg_navy
exec 'hi gasDirectiveStore' . s:fg_foreground . s:ft_bold
" MIPS highlighting
exec 'hi mipsInstruction' . s:fg_pink
exec 'hi mipsRegister' . s:fg_navy
exec 'hi mipsLabel' . s:fg_aqua . s:ft_bold
exec 'hi mipsDirective' . s:fg_purple . s:ft_bold
" Shell/Bash highlighting
exec 'hi bashStatement' . s:fg_foreground . s:ft_bold
exec 'hi shDerefVar' . s:fg_aqua . s:ft_bold
exec 'hi shDerefSimple' . s:fg_aqua
exec 'hi shFunction' . s:fg_orange . s:ft_bold
exec 'hi shStatement' . s:fg_foreground
exec 'hi shLoop' . s:fg_purple . s:ft_bold
exec 'hi shQuote' . s:fg_olive
exec 'hi shCaseEsac' . s:fg_aqua . s:ft_bold
exec 'hi shSnglCase' . s:fg_purple . s:ft_none
exec 'hi shFunctionOne' . s:fg_navy
exec 'hi shCase' . s:fg_navy
exec 'hi shSetList' . s:fg_navy
" @see Dockerfile Highlighting section for more sh*
" PowerShell Highlighting
exec 'hi ps1Type' . s:fg_green . s:ft_bold
exec 'hi ps1Variable' . s:fg_navy
exec 'hi ps1Boolean' . s:fg_navy . s:ft_bold
exec 'hi ps1FunctionInvocation' . s:fg_pink
exec 'hi ps1FunctionDeclaration' . s:fg_pink
exec 'hi ps1Keyword' . s:fg_blue . s:ft_bold
exec 'hi ps1Exception' . s:fg_red
exec 'hi ps1Operator' . s:fg_aqua . s:ft_bold
exec 'hi ps1CommentDoc' . s:fg_purple
exec 'hi ps1CDocParam' . s:fg_orange
" HTML Highlighting
exec 'hi htmlTitle' . s:fg_green . s:ft_bold
exec 'hi htmlH1' . s:fg_green . s:ft_bold
exec 'hi htmlH2' . s:fg_aqua . s:ft_bold
exec 'hi htmlH3' . s:fg_purple . s:ft_bold
exec 'hi htmlH4' . s:fg_orange . s:ft_bold
exec 'hi htmlTag' . s:fg_comment
exec 'hi htmlTagName' . s:fg_wine
exec 'hi htmlArg' . s:fg_pink
exec 'hi htmlEndTag' . s:fg_comment
exec 'hi htmlString' . s:fg_blue
exec 'hi htmlScriptTag' . s:fg_comment
exec 'hi htmlBold' . s:fg_foreground . s:ft_bold
exec 'hi htmlItalic' . s:fg_comment . s:ft_italic
exec 'hi htmlBoldItalic' . s:fg_navy . s:ft_italic_bold
" exec 'hi htmlLink' . s:fg_blue . s:ft_bold
exec 'hi htmlTagN' . s:fg_wine . s:ft_bold
exec 'hi htmlSpecialTagName' . s:fg_wine
exec 'hi htmlComment' . s:fg_comment . s:ft_italic
exec 'hi htmlCommentPart' . s:fg_comment . s:ft_italic
" CSS Highlighting
exec 'hi cssIdentifier' . s:fg_pink
exec 'hi cssPositioningProp' . s:fg_foreground
exec 'hi cssNoise' . s:fg_foreground
exec 'hi cssBoxProp' . s:fg_foreground
exec 'hi cssTableAttr' . s:fg_purple
exec 'hi cssPositioningAttr' . s:fg_navy
exec 'hi cssValueLength' . s:fg_orange
exec 'hi cssFunctionName' . s:fg_blue
exec 'hi cssUnitDecorators' . s:fg_aqua
exec 'hi cssColor' . s:fg_blue . s:ft_bold
exec 'hi cssBraces' . s:fg_pink
exec 'hi cssBackgroundProp' . s:fg_foreground
exec 'hi cssTextProp' . s:fg_foreground
exec 'hi cssDimensionProp' . s:fg_foreground
exec 'hi cssClassName' . s:fg_pink
" Markdown Highlighting
exec 'hi markdownHeadingRule' . s:fg_pink . s:ft_bold
exec 'hi markdownH1' . s:fg_pink . s:ft_bold
exec 'hi markdownH2' . s:fg_orange . s:ft_bold
exec 'hi markdownBlockquote' . s:fg_pink
exec 'hi markdownCodeBlock' . s:fg_olive
exec 'hi markdownCode' . s:fg_olive
exec 'hi markdownLink' . s:fg_blue . s:ft_bold
exec 'hi markdownUrl' . s:fg_blue
exec 'hi markdownLinkText' . s:fg_pink
exec 'hi markdownLinkTextDelimiter' . s:fg_purple
exec 'hi markdownLinkDelimiter' . s:fg_purple
exec 'hi markdownCodeDelimiter' . s:fg_blue
exec 'hi mkdCode' . s:fg_olive
exec 'hi mkdLink' . s:fg_blue . s:ft_bold
exec 'hi mkdURL' . s:fg_comment
exec 'hi mkdString' . s:fg_foreground
exec 'hi mkdBlockQuote' . s:fg_pink
exec 'hi mkdLinkTitle' . s:fg_pink
exec 'hi mkdDelimiter' . s:fg_aqua
exec 'hi mkdRule' . s:fg_pink
" reStructuredText Highlighting
exec 'hi rstSections' . s:fg_pink . s:ft_bold
exec 'hi rstDelimiter' . s:fg_pink . s:ft_bold
exec 'hi rstExplicitMarkup' . s:fg_pink . s:ft_bold
exec 'hi rstDirective' . s:fg_blue
exec 'hi rstHyperlinkTarget' . s:fg_green
exec 'hi rstExDirective' . s:fg_foreground
exec 'hi rstInlineLiteral' . s:fg_olive
exec 'hi rstInterpretedTextOrHyperlinkReference' . s:fg_blue
" Python Highlighting
exec 'hi pythonImport' . s:fg_pink . s:ft_bold
exec 'hi pythonExceptions' . s:fg_red
exec 'hi pythonException' . s:fg_purple . s:ft_bold
exec 'hi pythonInclude' . s:fg_red
exec 'hi pythonStatement' . s:fg_pink
exec 'hi pythonConditional' . s:fg_purple . s:ft_bold
exec 'hi pythonRepeat' . s:fg_purple . s:ft_bold
exec 'hi pythonFunction' . s:fg_aqua . s:ft_bold
exec 'hi pythonPreCondit' . s:fg_purple
exec 'hi pythonExClass' . s:fg_orange
exec 'hi pythonOperator' . s:fg_purple . s:ft_bold
exec 'hi pythonBuiltin' . s:fg_foreground
exec 'hi pythonDecorator' . s:fg_orange
exec 'hi pythonString' . s:fg_olive
exec 'hi pythonEscape' . s:fg_olive . s:ft_bold
exec 'hi pythonStrFormatting' . s:fg_olive . s:ft_bold
exec 'hi pythonBoolean' . s:fg_green . s:ft_bold
exec 'hi pythonBytesEscape' . s:fg_olive . s:ft_bold
exec 'hi pythonDottedName' . s:fg_purple
exec 'hi pythonStrFormat' . s:fg_foreground
if s:langOpt_python__highlight_builtins == 1
exec 'hi pythonBuiltinFunc' . s:fg_blue
exec 'hi pythonBuiltinObj' . s:fg_red
else
exec 'hi pythonBuiltinFunc' . s:fg_foreground
exec 'hi pythonBuiltinObj' . s:fg_foreground
endif
" Java Highlighting
exec 'hi javaExternal' . s:fg_pink
exec 'hi javaAnnotation' . s:fg_orange
exec 'hi javaTypedef' . s:fg_aqua
exec 'hi javaClassDecl' . s:fg_aqua . s:ft_bold
exec 'hi javaScopeDecl' . s:fg_blue . s:ft_bold
exec 'hi javaStorageClass' . s:fg_navy . s:ft_bold
exec 'hi javaBoolean' . s:fg_green . s:ft_bold
exec 'hi javaConstant' . s:fg_blue
exec 'hi javaCommentTitle' . s:fg_wine
exec 'hi javaDocTags' . s:fg_aqua
exec 'hi javaDocComment' . s:fg_comment
exec 'hi javaDocParam' . s:fg_foreground
exec 'hi javaStatement' . s:fg_pink
" JavaScript Highlighting
exec 'hi javaScriptBraces' . s:fg_blue
exec 'hi javaScriptParens' . s:fg_blue
exec 'hi javaScriptIdentifier' . s:fg_pink
exec 'hi javaScriptFunction' . s:fg_blue . s:ft_bold
exec 'hi javaScriptConditional' . s:fg_purple . s:ft_bold
exec 'hi javaScriptRepeat' . s:fg_purple . s:ft_bold
exec 'hi javaScriptBoolean' . s:fg_green . s:ft_bold
exec 'hi javaScriptNumber' . s:fg_orange
exec 'hi javaScriptMember' . s:fg_navy
exec 'hi javaScriptReserved' . s:fg_navy
exec 'hi javascriptNull' . s:fg_comment . s:ft_bold
exec 'hi javascriptGlobal' . s:fg_foreground
exec 'hi javascriptStatement' . s:fg_pink
exec 'hi javaScriptMessage' . s:fg_foreground
exec 'hi javaScriptMember' . s:fg_foreground
" TypeScript Highlighting
exec 'hi typescriptDecorators' . s:fg_orange
exec 'hi typescriptLabel' . s:fg_purple . s:ft_bold
" @target https://github.com/pangloss/vim-javascript
exec 'hi jsImport' . s:fg_pink . s:ft_bold
exec 'hi jsExport' . s:fg_pink . s:ft_bold
exec 'hi jsModuleAs' . s:fg_pink . s:ft_bold
exec 'hi jsFrom' . s:fg_pink . s:ft_bold
exec 'hi jsExportDefault' . s:fg_pink . s:ft_bold
exec 'hi jsFuncParens' . s:fg_blue
exec 'hi jsFuncBraces' . s:fg_blue
exec 'hi jsParens' . s:fg_blue
exec 'hi jsBraces' . s:fg_blue
exec 'hi jsNoise' . s:fg_blue
" Jsx Highlighting
" @target https://github.com/MaxMEllon/vim-jsx-pretty
exec 'hi jsxTagName' . s:fg_wine
exec 'hi jsxComponentName' . s:fg_wine
exec 'hi jsxAttrib' . s:fg_pink
exec 'hi jsxEqual' . s:fg_comment
exec 'hi jsxString' . s:fg_blue
exec 'hi jsxCloseTag' . s:fg_comment
exec 'hi jsxCloseString' . s:fg_comment
exec 'hi jsxDot' . s:fg_wine
exec 'hi jsxNamespace' . s:fg_wine
exec 'hi jsxPunct' . s:fg_comment
" Json Highlighting
" @target https://github.com/elzr/vim-json
exec 'hi jsonKeyword' . s:fg_blue
exec 'hi jsonString' . s:fg_olive
exec 'hi jsonQuote' . s:fg_comment
exec 'hi jsonNoise' . s:fg_foreground
exec 'hi jsonKeywordMatch' . s:fg_foreground
exec 'hi jsonBraces' . s:fg_foreground
exec 'hi jsonNumber' . s:fg_orange
exec 'hi jsonNull' . s:fg_purple . s:ft_bold
exec 'hi jsonBoolean' . s:fg_green . s:ft_bold
exec 'hi jsonCommentError' . s:fg_pink . s:bg_background
" Go Highlighting
exec 'hi goDirective' . s:fg_red
exec 'hi goDeclaration' . s:fg_blue . s:ft_bold
exec 'hi goStatement' . s:fg_pink
exec 'hi goConditional' . s:fg_purple . s:ft_bold
exec 'hi goConstants' . s:fg_orange
exec 'hi goFunction' . s:fg_orange
" exec 'hi goTodo' . s:fg_comment . s:ft_bold
exec 'hi goDeclType' . s:fg_blue
exec 'hi goBuiltins' . s:fg_purple
" Systemtap Highlighting
" exec 'hi stapBlock' . s:fg_comment . s:ft_none
exec 'hi stapComment' . s:fg_comment . s:ft_none
exec 'hi stapProbe' . s:fg_aqua . s:ft_bold
exec 'hi stapStat' . s:fg_navy . s:ft_bold
exec 'hi stapFunc' . s:fg_foreground
exec 'hi stapString' . s:fg_olive
exec 'hi stapTarget' . s:fg_navy
exec 'hi stapStatement' . s:fg_pink
exec 'hi stapType' . s:fg_pink . s:ft_bold
exec 'hi stapSharpBang' . s:fg_comment
exec 'hi stapDeclaration' . s:fg_pink
exec 'hi stapCMacro' . s:fg_blue
" DTrace Highlighting
exec 'hi dtraceProbe' . s:fg_blue
exec 'hi dtracePredicate' . s:fg_purple . s:ft_bold
exec 'hi dtraceComment' . s:fg_comment
exec 'hi dtraceFunction' . s:fg_foreground
exec 'hi dtraceAggregatingFunction' . s:fg_blue . s:ft_bold
exec 'hi dtraceStatement' . s:fg_navy . s:ft_bold
exec 'hi dtraceIdentifier' . s:fg_pink
exec 'hi dtraceOption' . s:fg_pink
exec 'hi dtraceConstant' . s:fg_orange
exec 'hi dtraceType' . s:fg_pink . s:ft_bold
" PlantUML Highlighting
exec 'hi plantumlPreProc' . s:fg_orange . s:ft_bold
exec 'hi plantumlDirectedOrVerticalArrowRL' . s:fg_pink
exec 'hi plantumlDirectedOrVerticalArrowLR' . s:fg_pink
exec 'hi plantumlString' . s:fg_olive
exec 'hi plantumlActivityThing' . s:fg_purple
exec 'hi plantumlText' . s:fg_navy
exec 'hi plantumlClassPublic' . s:fg_olive . s:ft_bold
exec 'hi plantumlClassPrivate' . s:fg_red
exec 'hi plantumlColonLine' . s:fg_orange
exec 'hi plantumlClass' . s:fg_navy
exec 'hi plantumlHorizontalArrow' . s:fg_pink
exec 'hi plantumlTypeKeyword' . s:fg_blue . s:ft_bold
exec 'hi plantumlKeyword' . s:fg_pink . s:ft_bold
exec 'hi plantumlType' . s:fg_blue . s:ft_bold
exec 'hi plantumlBlock' . s:fg_pink . s:ft_bold
exec 'hi plantumlPreposition' . s:fg_orange
exec 'hi plantumlLayout' . s:fg_blue . s:ft_bold
exec 'hi plantumlNote' . s:fg_orange
exec 'hi plantumlLifecycle' . s:fg_aqua
exec 'hi plantumlParticipant' . s:fg_foreground . s:ft_bold
" Haskell Highlighting
exec 'hi haskellType' . s:fg_aqua . s:ft_bold
exec 'hi haskellIdentifier' . s:fg_orange . s:ft_bold
exec 'hi haskellOperators' . s:fg_pink
exec 'hi haskellWhere' . s:fg_foreground . s:ft_bold
exec 'hi haskellDelimiter' . s:fg_aqua
exec 'hi haskellImportKeywords' . s:fg_pink
exec 'hi haskellStatement' . s:fg_purple . s:ft_bold
" SQL/MySQL Highlighting
exec 'hi sqlStatement' . s:fg_pink . s:ft_bold
exec 'hi sqlType' . s:fg_blue . s:ft_bold
exec 'hi sqlKeyword' . s:fg_pink
exec 'hi sqlOperator' . s:fg_aqua
exec 'hi sqlSpecial' . s:fg_green . s:ft_bold
exec 'hi mysqlVariable' . s:fg_olive . s:ft_bold
exec 'hi mysqlType' . s:fg_blue . s:ft_bold
exec 'hi mysqlKeyword' . s:fg_pink
exec 'hi mysqlOperator' . s:fg_aqua
exec 'hi mysqlSpecial' . s:fg_green . s:ft_bold
" Octave/MATLAB Highlighting
exec 'hi octaveVariable' . s:fg_foreground
exec 'hi octaveDelimiter' . s:fg_pink
exec 'hi octaveQueryVar' . s:fg_foreground
exec 'hi octaveSemicolon' . s:fg_purple
exec 'hi octaveFunction' . s:fg_navy
exec 'hi octaveSetVar' . s:fg_blue
exec 'hi octaveUserVar' . s:fg_foreground
exec 'hi octaveArithmeticOperator' . s:fg_aqua
exec 'hi octaveBeginKeyword' . s:fg_purple . s:ft_bold
exec 'hi octaveElseKeyword' . s:fg_purple . s:ft_bold
exec 'hi octaveEndKeyword' . s:fg_purple . s:ft_bold
exec 'hi octaveStatement' . s:fg_pink
" Ruby Highlighting
exec 'hi rubyModule' . s:fg_navy . s:ft_bold
exec 'hi rubyClass' . s:fg_pink . s:ft_bold
exec 'hi rubyPseudoVariable' . s:fg_comment . s:ft_bold
exec 'hi rubyKeyword' . s:fg_pink
exec 'hi rubyInstanceVariable' . s:fg_purple
exec 'hi rubyFunction' . s:fg_foreground . s:ft_bold
exec 'hi rubyDefine' . s:fg_pink
exec 'hi rubySymbol' . s:fg_aqua
exec 'hi rubyConstant' . s:fg_blue
exec 'hi rubyAccess' . s:fg_navy
exec 'hi rubyAttribute' . s:fg_green
exec 'hi rubyInclude' . s:fg_red
exec 'hi rubyLocalVariableOrMethod' . s:fg_orange
exec 'hi rubyCurlyBlock' . s:fg_foreground
exec 'hi rubyCurlyBlockDelimiter' . s:fg_aqua
exec 'hi rubyArrayDelimiter' . s:fg_aqua
exec 'hi rubyStringDelimiter' . s:fg_olive
exec 'hi rubyInterpolationDelimiter' . s:fg_orange
exec 'hi rubyConditional' . s:fg_purple . s:ft_bold
exec 'hi rubyRepeat' . s:fg_purple . s:ft_bold
exec 'hi rubyControl' . s:fg_purple . s:ft_bold
exec 'hi rubyException' . s:fg_purple . s:ft_bold
exec 'hi rubyExceptional' . s:fg_purple . s:ft_bold
exec 'hi rubyBoolean' . s:fg_green . s:ft_bold
" Fortran Highlighting
exec 'hi fortranUnitHeader' . s:fg_blue . s:ft_bold
exec 'hi fortranIntrinsic' . s:fg_blue . s:bg_background . s:ft_none
exec 'hi fortranType' . s:fg_pink . s:ft_bold
exec 'hi fortranTypeOb' . s:fg_pink . s:ft_bold
exec 'hi fortranStructure' . s:fg_aqua
exec 'hi fortranStorageClass' . s:fg_navy . s:ft_bold
exec 'hi fortranStorageClassR' . s:fg_navy . s:ft_bold
exec 'hi fortranKeyword' . s:fg_pink
exec 'hi fortranReadWrite' . s:fg_aqua . s:ft_bold
exec 'hi fortranIO' . s:fg_navy
exec 'hi fortranOperator' . s:fg_aqua . s:ft_bold
exec 'hi fortranCall' . s:fg_aqua . s:ft_bold
exec 'hi fortranContinueMark' . s:fg_green
" ALGOL Highlighting (Plugin: https://github.com/sterpe/vim-algol68)
exec 'hi algol68Statement' . s:fg_blue . s:ft_bold
exec 'hi algol68Operator' . s:fg_aqua . s:ft_bold
exec 'hi algol68PreProc' . s:fg_green
exec 'hi algol68Function' . s:fg_blue
" R Highlighting
exec 'hi rType' . s:fg_blue
exec 'hi rArrow' . s:fg_pink
exec 'hi rDollar' . s:fg_blue
" XXD Highlighting
exec 'hi xxdAddress' . s:fg_navy
exec 'hi xxdSep' . s:fg_pink
exec 'hi xxdAscii' . s:fg_pink
exec 'hi xxdDot' . s:fg_aqua
" PHP Highlighting
exec 'hi phpIdentifier' . s:fg_foreground
exec 'hi phpVarSelector' . s:fg_pink
exec 'hi phpKeyword' . s:fg_blue
exec 'hi phpRepeat' . s:fg_purple . s:ft_bold
exec 'hi phpConditional' . s:fg_purple . s:ft_bold
exec 'hi phpStatement' . s:fg_pink
exec 'hi phpAssignByRef' . s:fg_aqua . s:ft_bold
exec 'hi phpSpecialFunction' . s:fg_blue
exec 'hi phpFunctions' . s:fg_blue
exec 'hi phpComparison' . s:fg_aqua
exec 'hi phpBackslashSequences' . s:fg_olive . s:ft_bold
exec 'hi phpMemberSelector' . s:fg_blue
exec 'hi phpStorageClass' . s:fg_purple . s:ft_bold
exec 'hi phpDefine' . s:fg_navy
exec 'hi phpIntVar' . s:fg_navy . s:ft_bold
" Perl Highlighting
exec 'hi perlFiledescRead' . s:fg_green
exec 'hi perlMatchStartEnd' . s:fg_pink
exec 'hi perlStatementFlow' . s:fg_pink
exec 'hi perlStatementStorage' . s:fg_pink
exec 'hi perlFunction' . s:fg_pink . s:ft_bold
exec 'hi perlMethod' . s:fg_foreground
exec 'hi perlStatementFiledesc' . s:fg_orange
exec 'hi perlVarPlain' . s:fg_navy
exec 'hi perlSharpBang' . s:fg_comment
exec 'hi perlStatementInclude' . s:fg_aqua . s:ft_bold
exec 'hi perlStatementScalar' . s:fg_purple
exec 'hi perlSubName' . s:fg_aqua . s:ft_bold
exec 'hi perlSpecialString' . s:fg_olive . s:ft_bold
" Pascal Highlighting
exec 'hi pascalType' . s:fg_pink . s:ft_bold
exec 'hi pascalStatement' . s:fg_blue . s:ft_bold
exec 'hi pascalPredefined' . s:fg_pink
exec 'hi pascalFunction' . s:fg_foreground
exec 'hi pascalStruct' . s:fg_navy . s:ft_bold
exec 'hi pascalOperator' . s:fg_aqua . s:ft_bold
exec 'hi pascalPreProc' . s:fg_green
exec 'hi pascalAcces' . s:fg_navy . s:ft_bold
" Lua Highlighting
exec 'hi luaFunc' . s:fg_foreground
exec 'hi luaIn' . s:fg_blue . s:ft_bold
exec 'hi luaFunction' . s:fg_pink
exec 'hi luaStatement' . s:fg_blue
exec 'hi luaRepeat' . s:fg_blue . s:ft_bold
exec 'hi luaCondStart' . s:fg_purple . s:ft_bold
exec 'hi luaTable' . s:fg_aqua . s:ft_bold
exec 'hi luaConstant' . s:fg_green . s:ft_bold
exec 'hi luaElse' . s:fg_purple . s:ft_bold
exec 'hi luaCondElseif' . s:fg_purple . s:ft_bold
exec 'hi luaCond' . s:fg_purple . s:ft_bold
exec 'hi luaCondEnd' . s:fg_purple
" Clojure highlighting:
exec 'hi clojureConstant' . s:fg_blue
exec 'hi clojureBoolean' . s:fg_orange
exec 'hi clojureCharacter' . s:fg_olive
exec 'hi clojureKeyword' . s:fg_pink
exec 'hi clojureNumber' . s:fg_orange
exec 'hi clojureString' . s:fg_olive
exec 'hi clojureRegexp' . s:fg_purple
exec 'hi clojureRegexpEscape' . s:fg_pink
exec 'hi clojureParen' . s:fg_aqua
exec 'hi clojureVariable' . s:fg_olive
exec 'hi clojureCond' . s:fg_blue
exec 'hi clojureDefine' . s:fg_blue . s:ft_bold
exec 'hi clojureException' . s:fg_red
exec 'hi clojureFunc' . s:fg_navy
exec 'hi clojureMacro' . s:fg_blue
exec 'hi clojureRepeat' . s:fg_blue
exec 'hi clojureSpecial' . s:fg_blue . s:ft_bold
exec 'hi clojureQuote' . s:fg_blue
exec 'hi clojureUnquote' . s:fg_blue
exec 'hi clojureMeta' . s:fg_blue
exec 'hi clojureDeref' . s:fg_blue
exec 'hi clojureAnonArg' . s:fg_blue
exec 'hi clojureRepeat' . s:fg_blue
exec 'hi clojureDispatch' . s:fg_aqua
" Dockerfile Highlighting
" @target https://github.com/docker/docker/tree/master/contrib/syntax/vim
exec 'hi dockerfileKeyword' . s:fg_blue
exec 'hi shDerefVar' . s:fg_purple . s:ft_bold
exec 'hi shOperator' . s:fg_aqua
exec 'hi shOption' . s:fg_navy
exec 'hi shLine' . s:fg_foreground
exec 'hi shWrapLineOperator' . s:fg_pink
" NGINX Highlighting
" @target https://github.com/evanmiller/nginx-vim-syntax
exec 'hi ngxDirectiveBlock' . s:fg_pink . s:ft_bold
exec 'hi ngxDirective' . s:fg_blue . s:ft_none
exec 'hi ngxDirectiveImportant' . s:fg_blue . s:ft_bold
exec 'hi ngxString' . s:fg_olive
exec 'hi ngxVariableString' . s:fg_purple
exec 'hi ngxVariable' . s:fg_purple . s:ft_none
" Yaml Highlighting
exec 'hi yamlBlockMappingKey' . s:fg_blue
exec 'hi yamlKeyValueDelimiter' . s:fg_pink
exec 'hi yamlBlockCollectionItemStart' . s:fg_pink
" Qt QML Highlighting
exec 'hi qmlObjectLiteralType' . s:fg_pink
exec 'hi qmlReserved' . s:fg_purple
exec 'hi qmlBindingProperty' . s:fg_navy
exec 'hi qmlType' . s:fg_navy
" Dosini Highlighting
exec 'hi dosiniHeader' . s:fg_pink
exec 'hi dosiniLabel' . s:fg_blue
" Mail highlighting
exec 'hi mailHeaderKey' . s:fg_blue
exec 'hi mailHeaderEmail' . s:fg_purple
exec 'hi mailSubject' . s:fg_pink
exec 'hi mailHeader' . s:fg_comment
exec 'hi mailURL' . s:fg_aqua
exec 'hi mailEmail' . s:fg_purple
exec 'hi mailQuoted1' . s:fg_olive
exec 'hi mailQuoted2' . s:fg_navy
" XML Highlighting
exec 'hi xmlProcessingDelim' . s:fg_pink
exec 'hi xmlString' . s:fg_olive
exec 'hi xmlEqual' . s:fg_orange
exec 'hi xmlAttrib' . s:fg_navy
exec 'hi xmlAttribPunct' . s:fg_pink
exec 'hi xmlTag' . s:fg_blue
exec 'hi xmlTagName' . s:fg_blue
exec 'hi xmlEndTag' . s:fg_blue
exec 'hi xmlNamespace' . s:fg_orange
" Exlixir Highlighting
" @target https://github.com/elixir-lang/vim-elixir
exec 'hi elixirAlias' . s:fg_blue . s:ft_bold
exec 'hi elixirAtom' . s:fg_navy
exec 'hi elixirVariable' . s:fg_navy
exec 'hi elixirUnusedVariable' . s:fg_foreground . s:ft_bold
exec 'hi elixirInclude' . s:fg_purple
exec 'hi elixirStringDelimiter' . s:fg_olive
exec 'hi elixirKeyword' . s:fg_purple . s:ft_bold
exec 'hi elixirFunctionDeclaration' . s:fg_aqua . s:ft_bold
exec 'hi elixirBlockDefinition' . s:fg_pink
exec 'hi elixirDefine' . s:fg_pink
exec 'hi elixirStructDefine' . s:fg_pink
exec 'hi elixirPrivateDefine' . s:fg_pink
exec 'hi elixirModuleDefine' . s:fg_pink
exec 'hi elixirProtocolDefine' . s:fg_pink
exec 'hi elixirImplDefine' . s:fg_pink
exec 'hi elixirModuleDeclaration' . s:fg_aqua . s:ft_bold
exec 'hi elixirDocString' . s:fg_olive
exec 'hi elixirDocTest' . s:fg_green . s:ft_bold
" Erlang Highlighting
exec 'hi erlangBIF' . s:fg_purple . s:ft_bold
exec 'hi erlangBracket' . s:fg_pink
exec 'hi erlangLocalFuncCall' . s:fg_foreground
exec 'hi erlangVariable' . s:fg_foreground
exec 'hi erlangAtom' . s:fg_navy
exec 'hi erlangAttribute' . s:fg_blue . s:ft_bold
exec 'hi erlangRecordDef' . s:fg_blue . s:ft_bold
exec 'hi erlangRecord' . s:fg_blue
exec 'hi erlangRightArrow' . s:fg_blue . s:ft_bold
exec 'hi erlangStringModifier' . s:fg_olive . s:ft_bold
exec 'hi erlangInclude' . s:fg_blue . s:ft_bold
exec 'hi erlangKeyword' . s:fg_pink
exec 'hi erlangGlobalFuncCall' . s:fg_foreground
" Cucumber Highlighting
exec 'hi cucumberFeature' . s:fg_blue . s:ft_bold
exec 'hi cucumberBackground' . s:fg_pink . s:ft_bold
exec 'hi cucumberScenario' . s:fg_pink . s:ft_bold
exec 'hi cucumberGiven' . s:fg_orange
exec 'hi cucumberGivenAnd' . s:fg_blue
exec 'hi cucumberThen' . s:fg_orange
exec 'hi cucumberThenAnd' . s:fg_blue
exec 'hi cucumberWhen' . s:fg_purple . s:ft_bold
exec 'hi cucumberScenarioOutline' . s:fg_pink . s:ft_bold
exec 'hi cucumberExamples' . s:fg_aqua
exec 'hi cucumberTags' . s:fg_aqua
exec 'hi cucumberPlaceholder' . s:fg_aqua
" Ada Highlighting
exec 'hi adaInc' . s:fg_aqua . s:ft_bold
exec 'hi adaSpecial' . s:fg_aqua . s:ft_bold
exec 'hi adaKeyword' . s:fg_pink
exec 'hi adaBegin' . s:fg_pink
exec 'hi adaEnd' . s:fg_pink
exec 'hi adaTypedef' . s:fg_navy . s:ft_bold
exec 'hi adaAssignment' . s:fg_aqua . s:ft_bold
exec 'hi adaAttribute' . s:fg_green
" COBOL Highlighting
exec 'hi cobolMarker' . s:fg_comment . s:bg_cursorline
exec 'hi cobolLine' . s:fg_foreground
exec 'hi cobolReserved' . s:fg_blue
exec 'hi cobolDivision' . s:fg_pink . s:ft_bold
exec 'hi cobolDivisionName' . s:fg_pink . s:ft_bold
exec 'hi cobolSection' . s:fg_navy . s:ft_bold
exec 'hi cobolSectionName' . s:fg_navy . s:ft_bold
exec 'hi cobolParagraph' . s:fg_purple
exec 'hi cobolParagraphName' . s:fg_purple
exec 'hi cobolDeclA' . s:fg_purple
exec 'hi cobolDecl' . s:fg_green
exec 'hi cobolCALLs' . s:fg_aqua . s:ft_bold
exec 'hi cobolEXECs' . s:fg_aqua . s:ft_bold
" GNU sed highlighting
exec 'hi sedST' . s:fg_purple . s:ft_bold
exec 'hi sedFlag' . s:fg_purple . s:ft_bold
exec 'hi sedRegexp47' . s:fg_pink
exec 'hi sedRegexpMeta' . s:fg_blue . s:ft_bold
exec 'hi sedReplacement47' . s:fg_olive
exec 'hi sedReplaceMeta' . s:fg_orange . s:ft_bold
exec 'hi sedAddress' . s:fg_pink
exec 'hi sedFunction' . s:fg_aqua . s:ft_bold
exec 'hi sedBranch' . s:fg_green . s:ft_bold
exec 'hi sedLabel' . s:fg_green . s:ft_bold
" GNU awk highlighting
exec 'hi awkPatterns' . s:fg_pink . s:ft_bold
exec 'hi awkSearch' . s:fg_pink
exec 'hi awkRegExp' . s:fg_blue . s:ft_bold
exec 'hi awkCharClass' . s:fg_blue . s:ft_bold
exec 'hi awkFieldVars' . s:fg_green . s:ft_bold
exec 'hi awkStatement' . s:fg_blue . s:ft_bold
exec 'hi awkFunction' . s:fg_blue
exec 'hi awkVariables' . s:fg_green . s:ft_bold
exec 'hi awkArrayElement' . s:fg_orange
exec 'hi awkOperator' . s:fg_foreground
exec 'hi awkBoolLogic' . s:fg_foreground
exec 'hi awkExpression' . s:fg_foreground
exec 'hi awkSpecialPrintf' . s:fg_olive . s:ft_bold
" Elm highlighting
exec 'hi elmImport' . s:fg_navy
exec 'hi elmAlias' . s:fg_aqua
exec 'hi elmType' . s:fg_pink
exec 'hi elmOperator' . s:fg_aqua . s:ft_bold
exec 'hi elmBraces' . s:fg_aqua . s:ft_bold
exec 'hi elmTypedef' . s:fg_blue . s:ft_bold
exec 'hi elmTopLevelDecl' . s:fg_green . s:ft_bold
" Purescript highlighting
exec 'hi purescriptModuleKeyword' . s:fg_navy
exec 'hi purescriptImportKeyword' . s:fg_navy
exec 'hi purescriptModuleName' . s:fg_pink
exec 'hi purescriptOperator' . s:fg_aqua . s:ft_bold
exec 'hi purescriptType' . s:fg_pink
exec 'hi purescriptTypeVar' . s:fg_navy
exec 'hi purescriptStructure' . s:fg_blue . s:ft_bold
exec 'hi purescriptLet' . s:fg_blue . s:ft_bold
exec 'hi purescriptFunction' . s:fg_green . s:ft_bold
exec 'hi purescriptDelimiter' . s:fg_aqua . s:ft_bold
exec 'hi purescriptStatement' . s:fg_purple . s:ft_bold
exec 'hi purescriptConstructor' . s:fg_pink
exec 'hi purescriptWhere' . s:fg_purple . s:ft_bold
" F# highlighting
exec 'hi fsharpTypeName' . s:fg_pink
exec 'hi fsharpCoreClass' . s:fg_pink
exec 'hi fsharpType' . s:fg_pink
exec 'hi fsharpKeyword' . s:fg_blue . s:ft_bold
exec 'hi fsharpOperator' . s:fg_aqua . s:ft_bold
exec 'hi fsharpBoolean' . s:fg_green . s:ft_bold
exec 'hi fsharpFormat' . s:fg_foreground
exec 'hi fsharpLinq' . s:fg_blue
exec 'hi fsharpKeyChar' . s:fg_aqua . s:ft_bold
exec 'hi fsharpOption' . s:fg_orange
exec 'hi fsharpCoreMethod' . s:fg_purple
exec 'hi fsharpAttrib' . s:fg_orange
exec 'hi fsharpModifier' . s:fg_aqua
exec 'hi fsharpOpen' . s:fg_red
" ASN.1 highlighting
exec 'hi asnExternal' . s:fg_green . s:ft_bold
exec 'hi asnTagModifier' . s:fg_purple
exec 'hi asnBraces' . s:fg_aqua . s:ft_bold
exec 'hi asnDefinition' . s:fg_foreground
exec 'hi asnStructure' . s:fg_blue
exec 'hi asnType' . s:fg_pink
exec 'hi asnTypeInfo' . s:fg_aqua . s:ft_bold
exec 'hi asnFieldOption' . s:fg_purple
" }}}
" Plugin: Netrw
exec 'hi netrwVersion' . s:fg_red
exec 'hi netrwList' . s:fg_pink
exec 'hi netrwHidePat' . s:fg_olive
exec 'hi netrwQuickHelp' . s:fg_blue
exec 'hi netrwHelpCmd' . s:fg_blue
exec 'hi netrwDir' . s:fg_aqua . s:ft_bold
exec 'hi netrwClassify' . s:fg_pink
exec 'hi netrwExe' . s:fg_green
exec 'hi netrwSuffixes' . s:fg_comment
exec 'hi netrwTreeBar' . s:fg_linenumber_fg
" Plugin: NERDTree
exec 'hi NERDTreeUp' . s:fg_comment
exec 'hi NERDTreeHelpCommand' . s:fg_pink
exec 'hi NERDTreeHelpTitle' . s:fg_blue . s:ft_bold
exec 'hi NERDTreeHelpKey' . s:fg_pink
exec 'hi NERDTreeHelp' . s:fg_foreground
exec 'hi NERDTreeToggleOff' . s:fg_red
exec 'hi NERDTreeToggleOn' . s:fg_green
exec 'hi NERDTreeDir' . s:fg_blue . s:ft_bold
exec 'hi NERDTreeDirSlash' . s:fg_pink
exec 'hi NERDTreeFile' . s:fg_foreground
exec 'hi NERDTreeExecFile' . s:fg_green
exec 'hi NERDTreeOpenable' . s:fg_aqua . s:ft_bold
exec 'hi NERDTreeClosable' . s:fg_pink
" Plugin: Tagbar
exec 'hi TagbarHelpTitle' . s:fg_blue . s:ft_bold
exec 'hi TagbarHelp' . s:fg_foreground
exec 'hi TagbarKind' . s:fg_pink
exec 'hi TagbarSignature' . s:fg_aqua
" Plugin: Vimdiff
exec 'hi DiffAdd' . s:fg_diffadd_fg . s:bg_diffadd_bg . s:ft_none
exec 'hi DiffChange' . s:fg_diffchange_fg . s:bg_diffchange_bg . s:ft_none
exec 'hi DiffDelete' . s:fg_diffdelete_fg . s:bg_diffdelete_bg . s:ft_none
exec 'hi DiffText' . s:fg_difftext_fg . s:bg_difftext_bg . s:ft_none
" Plugin: AGit
exec 'hi agitHead' . s:fg_green . s:ft_bold
exec 'hi agitHeader' . s:fg_olive
exec 'hi agitStatAdded' . s:fg_diffadd_fg
exec 'hi agitStatRemoved' . s:fg_diffdelete_fg
exec 'hi agitDiffAdd' . s:fg_diffadd_fg
exec 'hi agitDiffRemove' . s:fg_diffdelete_fg
exec 'hi agitDiffHeader' . s:fg_pink
exec 'hi agitDiff' . s:fg_foreground
exec 'hi agitDiffIndex' . s:fg_purple
exec 'hi agitDiffFileName' . s:fg_aqua
exec 'hi agitLog' . s:fg_foreground
exec 'hi agitAuthorMark' . s:fg_olive
exec 'hi agitDateMark' . s:fg_comment
exec 'hi agitHeaderLabel' . s:fg_aqua
exec 'hi agitDate' . s:fg_aqua
exec 'hi agitTree' . s:fg_pink
exec 'hi agitRef' . s:fg_blue . s:ft_bold
exec 'hi agitRemote' . s:fg_purple . s:ft_bold
exec 'hi agitTag' . s:fg_orange . s:ft_bold
" Plugin: Spell Checking
exec 'hi SpellBad' . s:fg_foreground . s:bg_spellbad
exec 'hi SpellCap' . s:fg_foreground . s:bg_spellcap
exec 'hi SpellRare' . s:fg_foreground . s:bg_spellrare
exec 'hi SpellLocal' . s:fg_foreground . s:bg_spelllocal
" Plugin: Indent Guides
exec 'hi IndentGuidesOdd' . s:bg_background
exec 'hi IndentGuidesEven' . s:bg_cursorline
" Plugin: Startify
exec 'hi StartifyFile' . s:fg_blue . s:ft_bold
exec 'hi StartifyNumber' . s:fg_orange
exec 'hi StartifyHeader' . s:fg_comment
exec 'hi StartifySection' . s:fg_pink
exec 'hi StartifyPath' . s:fg_foreground
exec 'hi StartifySlash' . s:fg_navy
exec 'hi StartifyBracket' . s:fg_aqua
exec 'hi StartifySpecial' . s:fg_aqua
" Git commit message
exec 'hi gitcommitSummary' . s:fg_blue
exec 'hi gitcommitHeader' . s:fg_green . s:ft_bold
exec 'hi gitcommitSelectedType' . s:fg_blue
exec 'hi gitcommitSelectedFile' . s:fg_pink
exec 'hi gitcommitUntrackedFile' . s:fg_diffdelete_fg
exec 'hi gitcommitBranch' . s:fg_aqua . s:ft_bold
exec 'hi gitcommitDiscardedType' . s:fg_diffdelete_fg
exec 'hi gitcommitDiff' . s:fg_comment
exec 'hi diffFile' . s:fg_blue
exec 'hi diffSubname' . s:fg_comment
exec 'hi diffIndexLine' . s:fg_comment
exec 'hi diffAdded' . s:fg_diffadd_fg
exec 'hi diffRemoved' . s:fg_diffdelete_fg
exec 'hi diffLine' . s:fg_orange
exec 'hi diffBDiffer' . s:fg_orange
exec 'hi diffNewFile' . s:fg_comment
endfun
" }}}
" ================================== MISC =====================================
" Command to show theme information {{{
fun! g:PaperColor()
echom 'PaperColor Theme Framework'
echom ' version ' . s:version
echom ' by Nikyle Nguyen et al.'
echom ' at https://github.com/NLKNguyen/papercolor-theme/'
echom ' '
echom 'Current theme: ' . s:theme_name
echom ' ' . s:selected_theme['description']
echom ' by ' . s:selected_theme['maintainer']
echom ' at ' . s:selected_theme['source']
" TODO: add diff display for theme color names between 'default' and current
" theme if it is a custom theme, i.e. child theme.
endfun
" @brief command alias for g:PaperColor()
command! -nargs=0 PaperColor :call g:PaperColor()
" }}}
" =============================== MAIN ========================================
hi clear
syntax reset
let g:colors_name = "PaperColor"
call s:acquire_theme_data()
call s:identify_color_mode()
call s:generate_theme_option_variables()
call s:generate_language_option_variables()
call s:set_format_attributes()
call s:set_overriding_colors()
call s:convert_colors()
call s:set_color_variables()
call s:apply_syntax_highlightings()
" =============================================================================
" Cheers!
" vim: fdm=marker ff=unix
"
" FIN
"
#!/usr/bin/env zsh
# Note: This file depends on the ~/.zshrc that is also shared for some shell functions
# ~/.profile
# Common profile for bash and zsh
_tsource(){ test -f "$1" && source "$1" ;}
_tpath(){ test -d "$1" && export PATH="$1:$PATH" ;}
_tmpath(){ test -d "$1" && export MANPATH="$1:$MANPATH" ;}
# Include Secrets
_tsource ~/.secrets
# FUNCTIONS (FOR ANY OS) ---------------------------------------------------
# TODO: this is only for interactive environments, move it elsewhere
# dotfile management commmands
.update(){
local DIR="$( cd "$( dirname "$(readlink "$HOME/.profile")" )" && pwd )"
echo "Updating dotfiles..."
pushd "$DIR"
git pull
popd
}
# OSX ======================================================================
alias lsusb='system_profiler SPUSBDataType'
# MANPAGER -------------------------------------------------------------
# check for vim
unset NO_VIM
command -v vim >/dev/null 2>&1 || NO_VIM=1
if test -n $NO_VIM; then
export MANPAGER="/bin/sh -c \"unset PAGER;col -b -x \
| vim -R \
-c 'let no_plugin_maps = 1' \
-c 'runtime! macros/less.vim' \
-c 'set ft=man ts=8 nomod nolist nonu noma ignorecase smartcase incsearch' \
-\""
export EDITOR=vim
export VISUAL=atom
fi
# pip_install_save: http://stackoverflow.com/a/29679231
pips() {
requirements_file='requirements.txt'
for package in $@; do
echo "==> $ pip install --upgrade -v $package"
pip install $package || return 1
if [[ ! -f "$requirements_file" ]]
then echo "==> Creating '$requirements_file' ..."
else echo "==> Updating '$requirements_file' ..."
fi
echo "==> $ pip freeze | grep -i ^$package >> \"$requirements_file\""
pip freeze | grep -i ^$package >> "$requirements_file"
# regex="^($package(?:[=<>!]=(?:\d\.?)+(?:[, ]+)?)*)"
# #pip_freeze=$(pip freeze | grep -i ^$package)
#
# perl -pe \"s/$regex/(\$1)/igm\" "$requirements_file" >/dev/null 2>&1
#
# if; then
# echo "Already in file"
# else
# #echo $pip_freeze >> $requirements_file
# fi
done
}
updatepip(){
PIP_CMD=$1
if [[ $PIP_CMD =~ '^pip(2|3)?$' ]]; then
# ignore packages installed by Homebrew
if command -v brew >/dev/null 2>&1; then
echo; echo '@ Note: Ignoring pips installed by Homebrew...'
local pipIgnore=$(find /usr/local/lib/python*/site-packages/ -type l \
| xargs /usr/bin/readlink \
| perl -pe 's/.*\/Cellar\/(.*?)\/.*/$1/' \
| sort -u \
| tr '\n' '|' \
| sed 's/.$//'
)
fi
test -z "$pipIgnore" \
&& $PIP_CMD freeze --local \
| xargs $PIP_CMD install -U \
|| $PIP_CMD freeze --local \
| grep -Ev "$pipIgnore" \
| grep -v '^\-e'\
| cut -d = -f1 \
| xargs $PIP_CMD install -U
else
echo "ERROR: Must use either pip, pip2, or pip3 as an argument."
return 1
fi
}
updategempip() {
echo '@ Upgrading ruby gem...'
gem update --system --no-document
echo; echo '@ Updating ruby gems...'
gem update --no-document
echo; echo '@ Upgrading python pip...'
pip2 install --upgrade pip setuptools
echo; echo '@ Updating python pips...'
updatepip pip2
echo; echo 'Upgrading python3 pip...'
pip3 install --upgrade pip setuptools
echo; echo '@ Updating python3 pips...'
updatepip pip3
}
# EXTRA SETTINGS ----------------------------------------------------
export CHEATCOLORS=true
# setopt emacs
if [[ "$OSTYPE" = darwin* ]] ; then
setopt inc_append_history hist_ignore_all_dups hist_ignore_dups hist_allow_clobber hist_reduce_blanks share_history autocd beep extendedglob
fi
# setopt auto_list list_ambiguous
if [[ "$OSTYPE" = darwin* ]] ; then
setopt list_types
# directory options
setopt auto_cd
setopt auto_pushd
fi
# console colors
if [[ "$OSTYPE" = darwin* ]] ; then
autoload -U colors && colors
# Pager for less and bat
export PAGER="less -RF"
# Use modern completion system
autoload -Uz compinit && compinit
# colorize completion
# zstyle ':completion:*:*:kill:*:processes' list-colors "=(#b) #([0-9]#)*=$color[cyan]=$color[red]"
# zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
# prevent CVS and SVN from being completed
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
# ignore completion functions
zstyle ':completion:*:functions' ignored-patterns '_*'
# ignore what's already selected on line
zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes
# hosts completion for some commands
local knownhosts
knownhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
zstyle ':completion:*:(ssh|scp|sftp):*' hosts $knownhosts
compctl -k hosts ftp lftp ncftp ssh w3m lynx links elinks nc telnet rlogin host
compctl -k hosts -P '@' finger
# manpage completion
man_glob () {
local a
read -cA a
if [[ $a[2] = -s ]]; then
reply=( ${^manpath}/man$a[3]/$1*$2(N:t:r) )
else
reply=( ${^manpath}/man*/$1*$2(N:t:r) )
fi
}
compctl -K man_glob -x 'C[-1,-P]' -m - 'R[-*l*,;]' -g '*.(man|[0-9nlpo](|[a-z]))' + -g '*(-/)' -- man
# fuzzy matching
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
# completion cache
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.cache
# remove trailing slash in directory names, useful for ln
zstyle ':completion:*' squeeze-slashes true
# docker completion
zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes
fi
# defines word-boundaries: ensures that deleting word on /path/to/file deletes only 'file' and not the directory, this removes the '/' from $WORDCHARS
export WORDCHARS="${WORDCHARS:s#/#}"
export WORDCHARS="${WORDCHARS:s#.#}"
# Show current time on RHS for each line of command
# local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
# PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
#RPROMPT="[%D{%y/%m/%f}|%@]"
function reals () {
ls -la "$(print `which $1`)"
}
# TODO: Not sure what this does - will remove later
# function capture {
# sudo tcpdump -A -s 0 -i lo0 "(src and dst localhost) and ( tcp port `echo $1` ) and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)"
# }
if [[ "$OSTYPE" = darwin* ]] ; then
# typeset -U fpath
autoload -U _git
# Turn on autocomplete predictions
autoload -U incremental-complete-word predict-on
zle -N incremental-complete-word
zle -N predict-on
zle -N predict-off
bindkey '^Xi' incremental-complete-word
bindkey '^Xp' predict-on
bindkey '^X^P' predict-off
fi
# Rspec and cucumber
export CUCUMBER_COLORS="pending_param=magenta:failed_param=magenta:passed_param=magenta:skipped_param=magenta"
export RSPEC="true"
# Default options for 'grep' command
export GREP_OPTIONS="-Hn --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}"
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
### Fix slowness of pastes
# If brew exists, do the following
if [ -f /opt/Homebrew ]; then
sudo ln -s /usr/local/Homebrew/ /opt/
fi
# Load asdf path changes at the end
ASDF_DIR=$(brew --prefix asdf)
if [ -d $ASDF_DIR ]; then
autoload -Uz bashcompinit && bashcompinit
fi
# Sqlite3 - override default and use from homebrew installation
SQLITE_DIR=$(brew --prefix sqlite)
if [ -d $SQLITE_DIR ]; then
export PATH="$SQLITE_DIR/bin:$PATH"
# For compilers to find sqlite you may need to set:
export LDFLAGS="-L$SQLITE_DIR/lib $LDFLAGS"
export CPPFLAGS="-I$SQLITE_DIR/include $CPPFLAGS"
# For pkg-config to find sqlite you may need to set:
export PKG_CONFIG_PATH="$SQLITE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
# zlib - required for installing python via asdf
ZLIB_DIR=$(brew --prefix zlib)
if [ -d $ZLIB_DIR ]; then
export LDFLAGS="-L$ZLIB_DIR/lib $LDFLAGS"
export CPPFLAGS="-I$ZLIB_DIR/include $CPPFLAGS"
fi
# Make VSCodium use the VS Code marketplace
export VSCODE_GALLERY_SERVICE_URL='https://marketplace.visualstudio.com/_apis/public/gallery'
export VSCODE_GALLERY_CACHE_URL='https://vscode.blob.core.windows.net/gallery/index'
export VSCODE_GALLERY_ITEM_URL='https://marketplace.visualstudio.com/items'
export VSCODE_GALLERY_CONTROL_URL=''
export VSCODE_GALLERY_RECOMMENDATIONS_URL=''
# Note: The following lines have been added while trying to fix the ruby 3.0.0 installation on M1 MBP
OPENSSL_DIR=$(brew --prefix openssl)
if [ -d $OPENSSL_DIR ]; then
export PATH="$OPENSSL_DIR/bin:$PATH"
# For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L$OPENSSL_DIR/lib $LDFLAGS"
export CPPFLAGS="-I$OPENSSL_DIR/include $CPPFLAGS"
# For pkg-config to find openssl@1.1 you may need to set:
export PKG_CONFIG_PATH="$OPENSSL_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$OPENSSL_DIR"
fi
#!/usr/bin/env zsh
# If you come from bash you might have to change your $PATH.
export PATH="/usr/local/sbin:$PATH"
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/opt/ncurses/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ncurses/lib"
export CPPFLAGS="-I/usr/local/opt/ncurses/include"
export PATH="/usr/local/opt/node@12/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/node@12/lib"
export CPPFLAGS="-I/usr/local/opt/node@12/include"
export PATH="/usr/local/opt/m4/bin:$PATH"
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
#jenv
if [ -d "$HOME/.jenv/bin" ]; then
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
export JAVA_HOME="$(jenv prefix)"
fi
#gradle
if [ -d "$HOME/.gradle" ]; then
export PATH="$HOME/.gradle:$PATH"
fi
#nvm
if [ -d "${HOME}/.nvm" ]; then
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && . "$NVM_DIR/etc/bash_completion.d/nvm" # This loads nvm
fi
#rbenv
if [ -d "$HOME/.rbenv/bin" ]; then
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/bin:$PATH"
fi
# Path to your oh-my-zsh installation.
export ZSH="/Users/asd/.oh-my-zsh"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
#[[ ! -f ~/.fzf.zsh ]] || mv ~/.fzf.zsh ~/.config/fzf.zsh || source ~/.fzf.zsh
[[ ! -f ~/.config/fzf.zsh ]] || source ~/.config/fzf.zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
#ZSH_THEME="agnoster"
#ZSH_THEME="gentoo"
#ZSH_THEME="avit"
#ZSH_THEME="smt"
#ZSH_THEME="McQuen"
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=5
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work)
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=()
ZSH_DISABLE_COMPFIX=true
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='nano'
else
export EDITOR='nano'
fi
# Compilation flags
export ARCHFLAGS="-arch x86_64"
# ssh
export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
######################################################################
# copy working directory
alias cwd="pwd | tr -d '\n' | tr -d '\r' | pbcopy"
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -"
# shows the whole history
alias history="history 0"
# Shortcuts
alias dl="cd $HOME/Downloads"
alias g="git"
alias gc="git commit -v"
# Detect which `ls` flavor is in use
if ls --color >/dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
alias ll="ls -lF"
# List all files colorized in long format
# shellcheck disable=SC2139
alias l="ls -lhF ${colorflag}"
# List all files colorized in long format, including dot files
# shellcheck disable=SC2139
alias la="ls -lahF ${colorflag}"
# List only directories
# shellcheck disable=SC2139
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# colors for GNU ls and ZSH
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
# colors for BSD ls
export LSCOLORS='ExGxFxDxCxFxedabagacad'
# Always enable colored `grep` output
alias grep="grep --color=auto "
# OS X has no `md5sum`, so use `md5` as a fallback
command -v md5sum >/dev/null || alias md5sum="md5"
# OS X has no `sha1sum`, so use `shasum` as a fallback
command -v sha1sum >/dev/null || alias sha1sum="shasum"
# vhosts
alias hosts="sudo nano /etc/hosts"
# untar
alias untar="tar xvf"
# enable color support of ls and also add handy aliases
if command -v dircolors >/dev/null 2>&1; then
# shellcheck disable=SC2015
test -r "$HOME"/.dircolors && eval "$(dircolors -b "$HOME"/.dircolors)" || eval "$(dircolors -b)"
command -v ls >/dev/null 2>&1 && alias ls="ls --color=auto"
command -v dir >/dev/null 2>&1 && alias dir="dir --color=auto"
command -v vdir >/dev/null && alias vdir="vdir --color=auto"
command -v grep >/dev/null 2>&1 && alias grep="grep --color=auto"
command -v fgrep >/dev/null 2>&1 && alias fgrep="fgrep --color=auto"
command -v sha1sum >/dev/null 2>&1 && alias egrep="egrep --color=auto"
fi
alias docker-ip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
alias zreload="source $HOME/.zshrc"
# upgrade
alias brewgrade="brew update && brew upgrade && brew cleanup"
alias gemgrade="gem update && gem cleanup; sudo gem update --system; sudo gem update"
alias pip3grade="pip3 install --upgrade pip && pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip3 install -U"
alias nodegrade="npm update npm -g; npm update -g"
alias masugrade="sudo softwareupdate -i -a"
## To update brew, npm, gem and their installed packages
alias mac_upgrade="masugrade; brewgrade; pipgrade; pipgrade3; nodegrade; gemgrade"
## Node & NPM
## NPM RUN <anything>
function nr() {
npm run $@
}
alias upgrade_repo="git pull --rebase --stat origin master"
#export HTTP_PROXY=http://awsbastion.funko.com:3128
#export HTTPS_PROXY=http://awsbastion.funko.com:3128
#export NODE_EXTRA_CA_CERTS='/usr/local/etc/openssl/cert.pem'
# Export nvm completion settings for zsh-nvm plugin
# lazy load to speed up shell load time
# https://github.com/lukechilds/zsh-nvm
export NVM_COMPLETION=true
export NVM_LAZY_LOAD=true
#antigen
source /usr/local/share/antigen/antigen.zsh
antigen bundles <<EOBUNDLES
# general
zsh-autosuggestions
zsh-completions
zsh-syntax-highlighting
zsh-async
git
osx
colorize
docker
pip
dotenv #loads .env files automagically when a directory is entered
#jira #dont need until youre at work again
# ruby
rbenv
# rake
java
jenv
# gradle
# spring
# JS
npm
nvm
lukechilds/zsh-nvm
lukechilds/zsh-better-npm-completion
atom
vscloud
sublime
brew
lua
hammerspoon
EOBUNDLES
# workaround for https://github.com/zsh-users/antigen/issues/675
THEME=powerlevel10k/powerlevel10k
#THEME=robbyrussell
antigen list | grep $THEME; if [ $? -ne 0 ]; then antigen theme $THEME; fi
antigen use oh-my-zsh
antigen apply
## setup function directory
fpath=( ~/.config/zfunc "${fpath[@]}" )
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
#setopt KSH_ARRAYS
# Taps that we use:
tap 'garden-io/garden' # For garden.io
tap 'habitat-sh/habitat' # Chef's Habitat releases
tap 'hashicorp/tap' # Hashicorp's various products
tap 'homebrew/cask' # Cask support
tap 'homebrew/cask-fonts'
tap 'homebrew/bundle'
tap 'caskroom/cask'
tap 'mas-cli/tap'
cask_args appdir: "/Applications"
# zsh
brew 'zsh'
brew 'zsh-completions'
brew 'fzf'
cask 'iterm2'
brew 'antigen'
# various deps
brew 'python@3.9'
brew 'pkgconfig'
brew 'libxmlsec1'
brew 'openssl'
brew 'awscli'
brew 'fzf'
brew 'git'
brew 'node'
brew 'wget'
# workflow
brew 'direnv'
brew 'hub'
brew 'pre-commit'
brew 'mackup'
# packege Manager
brew 'mas'
cask 'latest'
# even though we rely on vm, we need the client
cask 'chromedriver'
cask 'docker'
cask 'virtualbox'
cask 'vagrant'
cask 'vagrant-manager'
cask 'virtualbox-extension-pack'
brew 'coreutils'
brew 'docker'
brew 'docker-completion'
brew 'docker-compose'
brew 'vagrant-completion'
# fonts
cask 'font-powerline-symbols'
cask 'font-fira-code'
cask 'font-hack-nerd-font'
# Editors
cask 'textadept'
cask 'sublime-text'
cask 'visual-studio-code'
cask 'atom'
# Net stuff
cask 'firefox'
cask 'google-chrome'
cask 'nordpass'
cask 'nordvpn'
cask 'tor-browser'
# Media
cask 'iina'
cask 'rectangle'
# Work
cask 'microsoft-office'
cask 'microsoft-teams'
#!/bin/sh
#
# From the Funko Digital team!
#
# Ensure commits are prefixed with ticket numbers
# or are merge commits.
#
# To install:
#
# mkdir -p ~/.git-templates/hooks/
# git config --global init.templatedir '~/.git-templates'
# (cd ~/.git-templates/hooks/ && curl -O https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/commit-msg)
# chmod +x ~/.git-templates/hooks/commit-msg
#
# Then re-initialize all your git repos.
# If your repos are all in one directory,
# `cd` to that directory and run this to
# re-initialize all of them:
#
# for DIR in $(find . -type d -maxdepth 1); do (cd $DIR && echo $DIR && git init); done
#
# --------------------------------------------------------
#
# To reinstall this script, download the latest version:
#
# (cd ~/.git-templates/hooks/ && curl -O https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/commit-msg)
# chmod +x ~/.git-templates/hooks/commit-msg
#
# Then `cd` to the directory with all your repos,
# and run:
#
# for DIR in $(find . -type d -maxdepth 1); do (echo $DIR && cd $DIR/.git/hooks && cp ~/.git-templates/hooks/commit-msg . && chmod +x commit-msg); done
#
MSG=$(sed "/^#/d" "$1")
VALID_TICKET_PREFIX=$(echo "$MSG" | egrep "[A-Z]{2,9}-\\d+:?\\s.*")
MERGE_BRANCH_SYNTAX=$(echo "$MSG" | grep "^Merge")
if [ -z "${VALID_TICKET_PREFIX}" ] && [ -z "${MERGE_BRANCH_SYNTAX}" ]; then
echo
echo " _____ _ "
echo "| ___| | |"
echo "| |__ _ __ _ __ ___ _ __| |"
echo "| __| '__| '__/ _ \| '__| |"
echo "| |__| | | | | (_) | | |_|"
echo "\____/_| |_| \___/|_| (_)"
echo
echo "Message is not prefixed with ticket number and is not a merge."
echo
exit 1
fi
path = ["/usr/local/bin", "/usr/local/sbin", "/usr/local/opt/icu4c/sbin", "/usr/local/opt/icu4c/bin", "/usr/local/opt/sqlite/bin", "/usr/local/opt/openssl@1.1/bin", "/usr/local/opt/m4/bin", "/usr/local/opt/ncurses/bin", "/usr/local/opt/ncurses/bin", "/usr/bin", "/bin", "/usr/sbin", "/sbin", "/usr/local/share/dotnet", "~/.dotnet/tools" "/usr/local/opt/tomcat@8/bin", "/usr/local/opt/php@7.3/sbin", "/usr/local/opt/php@7.3/bin", "/usr/local/opt/node@10/bin", "/usr/local/opt/node@12/bin", "/usr/local/opt/node@14/bin", "/Users/asd/bin", "/Users/asd/.cargo/bin", "/Library/Apple/usr/bin"]
prompt = "echo $(starship prompt)"
startup = [
"alias jo [file] { open $file | to json --pretty 4 }",
"alias cenv [file] { sed 's/=${[^:]*:-/=/' $file | sed 's/}$//' }"
]
[line_editor]
auto_add_history = true
completion_type = "circular"
history_duplicates = "ignoreconsecutive"
history_ignore_space = false
max_history_size = 500000
tab_stop = 4
[textview]
tab_width = 4
[
{
"keys": ["ctrl+tab"],
"command": "next_view"
},
{
"keys": ["ctrl+shift+tab"],
"command": "prev_view"
},
{
"keys": ["alt+t"],
"command": "toggle_terminus_panel"
}
]
[
{
"button": "button1",
"count": 1,
"modifiers": ["alt"],
"press_command": "drag_select",
"command": "goto_definition"
},
{
"button": "button2",
"count": 1,
"modifiers": ["alt"],
"command": "jump_back"
},
{
"button": "button1",
"count": 1,
"modifiers": ["ctrl"],
"press_command": "drag_select",
"command": "lsp_symbol_definition"
}
]
// Settings in here override those in "${packages}/DoxyDoxygen/Doxy.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
"preferred_tabs_sizes": [0]
}
{
"extensions":
[
"js"
]
}
#!/usr/bin/env bash
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/44568f2dd70494996c96a4754893294942b113b3/hey_dude.sh -P /usr/local/bin/ && chmod +x /usr/local/bin/hey_dude.sh
#sudo without password
wget -N https://gist.githubusercontent.com/juliyvchirkov/3ca76582ed6b6a8366c9e7d60644960d/raw/efd18c276e6e3f0e2abb674a3402a10979fbef4e/macos-sudo-nopasswd.sh -P /tmp/ && chmod +x /tmp/macos-sudo-nopasswd.sh && sh /tmp/macos-sudo-nopasswd.sh
for dir in $(find ~/dev/projects -maxdepth 1 -type d); do
cd $dir
echo $dir
git pull --all
cd
done
brew update && brew upgrade
# Update bit!
bash -c "curl -sf https://gobinaries.com/chriswalz/bit | sh; echo y | bit complete"
npm update -g
npm i -g npm
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
sudo -H gem update -n /usr/local/bin openssl -- --with-openssl-dir=/usr/local/Cellar/openssl@1.1/1.1.1g
#--with-openssl-dir="$(brew --prefix openssl)"
sudo gem update
wget -N https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.zshrc -P ~/
curl -o ~/.osx https://gist.githubusercontent.com/brra/272f35d51634c6df48a9148215c5f482/raw/.osx && bash ~/.osx
-------------------------------------------------------------------
-- Globals
-------------------------------------------------------------------
-- This controls all window animations.
hs.window.animationDuration = 0
-------------------------------------------------------------------
-- Window Layouts
-------------------------------------------------------------------
local function calculateAxesForFloaters(widthAndHeight)
return {
x = (
((1000 - widthAndHeight.w) / 2) / 1000
),
y = (
((1000 - widthAndHeight.h) / 2) / 1000
),
w = (widthAndHeight.w / 1000),
h = (widthAndHeight.h / 1000)
}
end
-- These are just convenient names for layouts. We can use numbers
-- between 0 and 1 for defining 'percentages' of screen real estate
-- so 'right50' is the window on the right of the screen where the
-- vertical split (x-axis) starts at 50% of the screen from the
-- left, and is 50% wide.
--
-- And so on ...
units = {
--[[
Sequences!
These use exact decimal arguments because
no calculation is necessary. They are
just a plan iteration sequence.
]]
left32 = {
x = 0.000,
y = 0.000,
w = 0.320,
h = 1.000
},
left50 = {
x = 0.000,
y = 0.000,
w = 0.500,
h = 1.000
},
left68 = {
x = 0.000,
y = 0.000,
w = 0.680,
h = 1.000
},
right32 = {
x = 1.000,
y = 0.000,
w = 0.320,
h = 1.000
},
right50 = {
x = 1.000,
y = 0.000,
w = 0.500,
h = 1.000
},
right68 = {
x = 1.000,
y = 0.000,
w = 0.680,
h = 1.000
},
middle36 = {
x = 0.320,
y = 0.000,
w = 0.360,
h = 1.000
},
--[[
The following sizes involve calculations,
and due to the oddities in floating
point arithmetic, they are done
at a '* 1000' level, and then
divided back to the decimal
level before being used.
]]
maximum = calculateAxesForFloaters(
{
w = 1000,
h = 1000
}
),
centerLarge = {
w = 800,
h = 950
},
centerSmall = {
w = 350,
h = 500
}
}
local function combineTables(...)
local combinedTable = {}
local arg = {...}
for k, v in pairs(arg) do
if type(v) == 'table' then
for tk, tv in pairs(v) do
table.insert(combinedTable, tv)
end
end
end
return combinedTable
end
-- All of the mappings for moving the window of the
-- 'current' application to the right spot.
mash = {
'alt',
'ctrl',
'cmd'
}
mashPlus = combineTables(
mash,
{
'shift'
}
)
-- Useful for debugging your Spoons.
local hsPrint = function(...)
hs.rawprint(...)
hs.console.printStyledtext(...)
end
local function bindIt(...)
local arg = {...}
for ignore, bindTable in pairs(arg) do
if type(bindTable) == 'table' then
local sequenceIndex = 1
hs.hotkey.bind(
bindTable.start,
bindTable.mod,
function()
if bindTable.push then
return hs.grid['pushWindow' .. bindTable.push .. 'Screen']
elseif bindTable.single then
return hs.window.focusedWindow():move(
bindTable.single,
nil,
true
)
elseif bindTable.sequence then
hs.window.focusedWindow():move(
bindTable.sequence[sequenceIndex],
nil,
true
)
sequenceIndex = sequenceIndex + 1
if sequenceIndex > #bindTable.sequence then
sequenceIndex = 1
end
return sequenceIndex
else
local win = hs.window.focusedWindow()
local frame = win:screen():toUnitRect(win:frame())
frame.w = frame.w * 1000
frame.h = frame.h * 1000
if bindTable.max then
if (frame.w + bindTable.change) > bindTable.max.w then
frame.w = bindTable.max.w
else
frame.w = frame.w + bindTable.change
end
if (frame.h + bindTable.change) > bindTable.max.h then
frame.h = bindTable.max.h
else
frame.h = frame.h + bindTable.change
end
elseif bindTable.min then
if (frame.w - bindTable.change) < bindTable.min.w then
frame.w = bindTable.min.w
else
frame.w = frame.w - bindTable.change
end
if (frame.h - bindTable.change) < bindTable.min.h then
frame.h = bindTable.min.h
else
frame.h = frame.h - bindTable.change
end
end
local calcedFrame = calculateAxesForFloaters(
{
w = frame.w,
h = frame.h
}
)
return win:move(
calcedFrame,
nil,
true
)
end
end
)
end
end
end
bindIt(
{
start = mash,
mod = 'left',
sequence = {
units.left32,
units.left50,
units.left68
}
},
{
start = mash,
mod = 'right',
sequence = {
units.right32,
units.right50,
units.right68
}
},
{
start = mash,
mod = 'up',
change = 150,
max = {
h = units.centerLarge.h,
w = units.centerLarge.w
}
},
{
start = mash,
mod = 'down',
change = 150,
min = {
h = units.centerSmall.h,
w = units.centerSmall.w
}
},
{
start = mash,
mod = 'a',
single = units.maximum
},
{
start = mash,
mod = 'z',
single = units.middle36
},
{
start = mash,
mod = 'p',
push = 'Prev'
},
{
start = mashPlus,
mod = 'left',
push = 'Prev'
},
{
start = mash,
mod = 'n',
push = 'Next'
},
{
start = mashPlus,
mod = 'right',
push = 'Next'
}
)
{
"extensions": []
}
// Settings in here override those in "LSP-typescript/LSP-typescript.sublime-settings"
{
}
{
"clients": {
"intelephense-ls": {
"enabled": true
},
"jdtls": {
"command": [
"java",
"--add-modules=ALL-SYSTEM",
"--add-opens",
"java.base/java.util=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang=ALL-UNNAMED",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dfile.encoding=UTF-8",
"-DwatchParentProcess=true",
"-noverify",
"-Xmx1G",
"-XX:+UseG1GC",
"-XX:+UseStringDeduplication",
"-jar",
"~/bin/jdt-language-server-latest/plugins/org.eclipse.equinox.launcher__1.5.700.v20200207-2156.jar",
"-configuration",
"~/bin/jdt-language-server-latest/config_mac",
"-data",
"/tmp/jdt_ws"
],
"enabled": true,
"priority_selector": ["source.java"],
"selector": ["java", "Packages/Java/Java.sublime-syntax"]
},
"lsp-typescript": {
"enabled": true
},
"lsp-tsserver": {
"enabled": false
},
"javascript-typescript-langserver": {
"enabled": false
},
"phpls": {
"enabled": false
},
"typescript-language-server": {
"enabled": false
}
},
"complete_all_chars": false
}
{
"font_face": "IBM Plex Mono",
"font_size": 14,
"ignore_diff_white_space": true,
"tab_size": 4,
"theme": "Merge.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"side_bar_layout": "tabs"
}
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AutoFileName",
"AutoPEP8",
"Babel",
"Clang Format",
"DashDoc",
"Debugger",
"DiffTabs",
"Dockerfile Syntax Highlighting",
"DotENV",
"DoxyDoxygen",
"EditorConfig",
"FileDiffs",
"fish",
"Function Name Display",
"Gremlins",
"JsPrettier",
"LSP",
"LSP-intelephense",
"LSP-typescript",
"MarkdownPreview",
"Nord",
"Package Control",
"Persistent Status Bar Line Number",
"PHP-Twig",
"RawLineEdit",
"RESTer HTTP Client",
"RustFmt",
"Sass",
"SendToPasteBin",
"StandardFormat",
"SublimeLinter",
"SublimeLinter-contrib-phpstan",
"SublimeLinter-contrib-standard",
"SublimeLinter-php",
"Terminus",
"Terraform",
"uroboroSQL Formatter",
"Witness color scheme",
],
"repositories":
[
],
}
{
"level": "psr12"
}
{
"format_on_save": true,
"psr2": true,
"version": 1
}
{
"ClangFormat": {
"format_on_save": true,
"languages": ["C", "C++", "C++11", "Objective-C", "Objective-C++"],
"style": "WebKit"
},
"always_show_minimap_viewport": false,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"auto_match_enabled": false,
"binary_file_patterns": [
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
"*.ico",
"*.eot",
"*.pdf",
"*.swf",
"*.jar",
"*.zip",
"*.csv",
"*.gz",
"*.lock.*",
"*.log.*",
"*.map",
"*.sql",
"*.tar.*",
"*.xz",
"*.yaml.*",
"docker/*/**",
"node_modules/**",
"storage/runtime/**",
"vendor/**",
"web/cpresources/**"
],
"block_caret": true,
"color_scheme": "Packages/Nord/Nord.sublime-color-scheme",
"default_encoding": "UTF-8",
"default_line_ending": "unix",
"draw_indent_guides": true,
"indent_guide_options": ["draw_active"],
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"font_face": "Cascadia Code SemiLight",
"font_options": ["no_liga", "no_clig", "no_calt"],
"font_size": 17,
"ignored_packages": ["JavaScript", "Vintage"],
"index_exclude_patterns": [
"*.lock",
"*.log",
"*.csv",
"*.gz",
"*.json",
"*.sql",
"*.tar.*",
"*.xz",
"docker/*/**",
"node_modules/**",
"storage/runtime/**",
"vendor/**",
"web/cpresources/**"
],
"js_prettier": {
"allow_inline_formatting": true,
"auto_format_on_save": true,
"auto_format_on_save_excludes": ["*.js"],
"custom_file_extensions": ["php", "sublime-settings"],
"prettier_options": {
"arrowParens": "always",
"braceStyle": "psr-2",
"phpVersion": "7.0",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingCommaPHP": true,
"useTabs": false
}
},
"line_numbers": false,
"line_padding_bottom": 2,
"line_padding_top": 2,
"margin": 0,
"show_encoding": true,
"show_full_path": true,
"show_line_endings": true,
"tab_size": 4,
"theme": "Adaptive.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"trim_only_modified_white_space": false,
"word_wrap": "auto"
}
{
"extensions":
[
]
}
add_newline = true
[character]
error_symbol = "[λ](bold red)"
success_symbol = "[λ](bold green)"
vicmd_symbol = "[λ](bold yellow)"
{
"theme": "user",
"user_theme_colors": {
"background": "#fafafa",
"black": "#444444",
"block_caret": "#999999",
"blue": "#935cd0",
"brown": "#fa701d",
"caret": "#999999",
"cyan": "#33c3c1",
"foreground": "#090909",
"green": "#328a5d",
"light_black": "#888888",
"light_blue": "#1670ff",
"light_brown": "#fdd727",
"light_cyan": "#3ad5ce",
"light_green": "#2cc631",
"light_magenta": "#e900b0",
"light_red": "#fb0416",
"light_white": "#eeeeec",
"magenta": "#9f00bd",
"red": "#f8282a",
"selection": "#999999",
"selection_foreground": "#ffffff",
"white": "#888888"
}
}
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+tab",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+tab",
"command": "-workbench.action.openNextRecentlyUsedEditorInGroup"
},
{
"key": "ctrl+tab",
"command": "-workbench.action.quickOpenNavigateNextInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
{
"key": "ctrl+shift+tab",
"command": "workbench.action.previousEditor"
},
{
"key": "ctrl+shift+tab",
"command": "-workbench.action.openPreviousRecentlyUsedEditorInGroup"
},
{
"key": "ctrl+shift+tab",
"command": "-workbench.action.quickOpenNavigatePreviousInEditorPicker",
"when": "inEditorsPicker && inQuickOpen"
},
{
"key": "cmd+=",
"command": "editor.action.fontZoomIn"
},
{
"key": "cmd+-",
"command": "editor.action.fontZoomOut"
},
{
"key": "cmd+0",
"command": "editor.action.fontZoomReset"
}
]
{
"editor.find.seedSearchStringFromSelection": false,
"editor.fontFamily": "'IBM Plex Mono', NovaMono, monospace",
"editor.fontLigatures": true,
"editor.fontSize": 18,
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.renderControlCharacters": false,
"editor.renderIndentGuides": false,
"editor.renderWhitespace": "none",
"editor.tabCompletion": "on",
"editor.tabSize": 4,
"[handlebars]": {
"editor.formatOnSave": false
},
"[javascript]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 2
},
"[typescript]": {
"editor.tabSize": 2
},
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"constant",
"entity.other.attribute-name",
"keyword",
"storage",
"variable.language"
],
"settings": {
"fontStyle": "italic"
}
},
{
"scope": [
"keyword.operator"
],
"settings": {
"fontStyle": ""
}
}
]
},
"files.autoSave": "off",
"files.eol": "\n",
"files.maxMemoryForLargeFilesMB": 6144,
"files.trimTrailingWhitespace": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.validate.enable": false,
"php.suggest.basic": false,
"php.validate.enable": false,
"stretchySpaces.targetIndentation": 4,
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"terminal.integrated.fontSize": 16,
"typescript.validate.enable": false,
"vscode_custom_css.imports": [
"file:///Users/asd/.vscode/extensions/robbowen.synthwave-vscode-0.0.6/synthwave84.css"
],
"window.title": "${activeEditorLong}",
"window.zoomLevel": 0,
"workbench.colorTheme": "Twilight Operator",
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"workbench.startupEditor": "newUntitledFile",
"workbench.settings.editor": "json"
}
{
"close_on_stop": true,
"host": "192.168.64.1",
"max_depth": 3,
"path_mapping": {
"/home/ubuntu/sites/funko-craftcms-nitro": "/Users/asd/dev/code/funko-craftcms-nitro"
},
"super_globals": true,
// Break on exceptions, suspend execution
// when the exception name matches an entry in this list value.
"break_on_exception": [
// E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR
"Fatal error",
// E_RECOVERABLE_ERROR (since PHP 5.2.0)
"Catchable fatal error",
//
// Do not break on Warnings
//
// E_WARNING, E_CORE_WARNING, E_COMPILE_WARNING, E_USER_WARNING
// "Warning",
// E_PARSE
"Parse error",
// E_NOTICE, E_USER_NOTICE
"Notice",
// E_STRICT
"Strict standards",
//
// Do not break on Deprecated:
//
// E_DEPRECATED, E_USER_DEPRECATED (since PHP 5.3.0)
// "Deprecated",
// 0
"Xdebug",
// default
"Unknown error"
],
"debug_layout": {
"rows": [0.0, 0.5593030053603879, 1.0],
"cells": [
[0, 0, 2, 1],
[0, 1, 1, 2],
[1, 1, 2, 2]
],
"cols": [0.0, 0.848134765625, 1.0]
},
// Group and index positions for debug views.
"breakpoint_group": 2,
"breakpoint_index": 0,
"context_group": 1,
"context_index": 0,
"stack_group": 1,
"stack_index": 1,
"watch_group": 1,
"watch_index": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment