203 lines
6.9 KiB
Bash
203 lines
6.9 KiB
Bash
# If you come from bash you might have to change your $PATH.
|
|
export GOPATH="$HOME/go"
|
|
export PATH=$PATH:$HOME/.local/bin:$GOPATH/bin:$HOME/scripts
|
|
|
|
# Path to your oh-my-zsh installation.
|
|
export ZSH="/home/solomon/.oh-my-zsh"
|
|
|
|
ZSH_THEME="inkletblotsh"
|
|
|
|
# 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=/home/solomon/.config/zsh
|
|
|
|
# Which plugins would you like to load?
|
|
# Standard plugins can be found in $ZSH/plugins/
|
|
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
|
|
# Example format: plugins=(rails git textmate ruby lighthouse)
|
|
# Add wisely, as too many plugins slow down shell startup.
|
|
plugins=(git
|
|
battery
|
|
git-flow
|
|
git-prompt vi-mode)
|
|
|
|
source $ZSH/oh-my-zsh.sh
|
|
|
|
# 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
|
|
# Probably shoud be vim or vi or even nano but it's annoying me.
|
|
export EDITOR='nvim'
|
|
else
|
|
export EDITOR='nvim'
|
|
fi
|
|
|
|
HISTSIZE=1000000
|
|
SAVEHIST=1000000
|
|
|
|
# Load aliases and shortcuts if existent.
|
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
|
|
|
|
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
|
|
|
|
# vi mode
|
|
bindkey -v
|
|
export KEYTIMEOUT=1
|
|
|
|
# use vim keys in tab complete menu:
|
|
bindkey -v '^?' backward-delete-char
|
|
|
|
# use lf to switch directories and bind it to ctrl-o
|
|
lfcd() {
|
|
tmp="$(mktemp -uq)"
|
|
trap 'rm -f $tmp >/dev/null 2>&1' HUP INT QUIT TERM PWR EXIT
|
|
lf -last-dir-path="$tmp" "$@"
|
|
if [ -f "$tmp" ]; then
|
|
dir="$(cat "$tmp")"
|
|
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
|
fi
|
|
}
|
|
|
|
# lf
|
|
bindkey -s '^o' '^ulfcd\n'
|
|
|
|
# tmux sessioniser
|
|
bindkey -s '^t' '^utms\n'
|
|
|
|
# zk related things
|
|
bindkey -s '^n' '^uzk edit --interactive --sort modified-\n'
|
|
|
|
function pomo() {
|
|
arg1=$1
|
|
shift
|
|
args="$*"
|
|
|
|
min=${arg1:?Example: pomo 25 Take a break}
|
|
sec=$((min * 60))
|
|
msg="${args:?Example: pomo 25 Take a break}"
|
|
|
|
while true; do
|
|
date '+%H:%M' && sleep "${sec:?}" && notify-send -u critical -t 0 -a pomo "${msg:?}"
|
|
done
|
|
}
|
|
|
|
# Dracula Theme (for zsh-syntax-highlighting)
|
|
#
|
|
# https://github.com/zenorocha/dracula-theme
|
|
#
|
|
# Copyright 2021, All rights reserved
|
|
#
|
|
# Code licensed under the MIT license
|
|
# http://zenorocha.mit-license.org
|
|
#
|
|
# @author George Pickering <@bigpick>
|
|
# @author Zeno Rocha <hi@zenorocha.com>
|
|
# Paste this files contents inside your ~/.zshrc before you activate zsh-syntax-highlighting
|
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main cursor)
|
|
typeset -gA ZSH_HIGHLIGHT_STYLES
|
|
# Default groupings per, https://spec.draculatheme.com, try to logically separate
|
|
# possible ZSH_HIGHLIGHT_STYLES settings accordingly...?
|
|
#
|
|
# Italics not yet supported by zsh; potentially soon:
|
|
# https://github.com/zsh-users/zsh-syntax-highlighting/issues/432
|
|
# https://www.zsh.org/mla/workers/2021/msg00678.html
|
|
# ... in hopes that they will, labelling accordingly with ,italic where appropriate
|
|
#
|
|
# Main highlighter styling: https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters/main.md
|
|
#
|
|
## General
|
|
### Diffs
|
|
### Markup
|
|
## Classes
|
|
## Comments
|
|
ZSH_HIGHLIGHT_STYLES[comment]='fg=#6272A4'
|
|
## Constants
|
|
## Entitites
|
|
## Functions/methods
|
|
ZSH_HIGHLIGHT_STYLES[alias]='fg=#50FA7B'
|
|
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=#50FA7B'
|
|
ZSH_HIGHLIGHT_STYLES[global-alias]='fg=#50FA7B'
|
|
ZSH_HIGHLIGHT_STYLES[function]='fg=#50FA7B'
|
|
ZSH_HIGHLIGHT_STYLES[command]='fg=#50FA7B'
|
|
ZSH_HIGHLIGHT_STYLES[precommand]='fg=#50FA7B,italic'
|
|
ZSH_HIGHLIGHT_STYLES[autodirectory]='fg=#FFB86C,italic'
|
|
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=#FFB86C'
|
|
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=#FFB86C'
|
|
ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=#BD93F9'
|
|
## Keywords
|
|
## Built ins
|
|
ZSH_HIGHLIGHT_STYLES[builtin]='fg=#8BE9FD'
|
|
ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=#8BE9FD'
|
|
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=#8BE9FD'
|
|
## Punctuation
|
|
ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#FF79C6'
|
|
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-unquoted]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]='fg=#FF79C6'
|
|
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]='fg=#FF79C6'
|
|
ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]='fg=#FF79C6'
|
|
## Serializable / Configuration Languages
|
|
## Storage
|
|
## Strings
|
|
ZSH_HIGHLIGHT_STYLES[command-substitution-quoted]='fg=#F1FA8C'
|
|
ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter-quoted]='fg=#F1FA8C'
|
|
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=#F1FA8C'
|
|
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]='fg=#FF5555'
|
|
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=#F1FA8C'
|
|
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]='fg=#FF5555'
|
|
ZSH_HIGHLIGHT_STYLES[rc-quote]='fg=#F1FA8C'
|
|
## Variables
|
|
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument-unclosed]='fg=#FF5555'
|
|
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[assign]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[named-fd]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[numeric-fd]='fg=#F8F8F2'
|
|
## No category relevant in spec
|
|
ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=#FF5555'
|
|
ZSH_HIGHLIGHT_STYLES[path]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[path_pathseparator]='fg=#FF79C6'
|
|
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]='fg=#FF79C6'
|
|
ZSH_HIGHLIGHT_STYLES[globbing]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=#BD93F9'
|
|
#ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=?'
|
|
#ZSH_HIGHLIGHT_STYLES[command-substitution-unquoted]='fg=?'
|
|
#ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=?'
|
|
#ZSH_HIGHLIGHT_STYLES[arithmetic-expansion]='fg=?'
|
|
ZSH_HIGHLIGHT_STYLES[back-quoted-argument-unclosed]='fg=#FF5555'
|
|
ZSH_HIGHLIGHT_STYLES[redirection]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[arg0]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[default]='fg=#F8F8F2'
|
|
ZSH_HIGHLIGHT_STYLES[cursor]='standout'
|
|
|
|
|
|
if [ -f /etc/hostname ]; then
|
|
HOST=$(cat /etc/hostname)
|
|
else
|
|
HOST=$(hostname)
|
|
fi
|
|
|
|
if [ "$HOST" = "holocene" ] ; then
|
|
source /usr/share/zsh/site-functions/zsh-syntax-highlighting.zsh
|
|
elif [ "$HOST" = "boost" ] ; then
|
|
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
else
|
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
fi
|
|
|
|
|
|
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
|
export SDKMAN_DIR="$HOME/.sdkman"
|
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|