Move to Chezmoi

This commit is contained in:
Tony Blyler 2022-04-22 10:06:53 -04:00
parent f216c4ff2c
commit e3498e73b5
59 changed files with 499 additions and 2240 deletions

1
.chezmoiroot Normal file
View file

@ -0,0 +1 @@
chezmoi

View file

@ -1,3 +1,3 @@
# Dotfiles
## Useful configuration files ranging from shell scripts to configurations
This is intended to be used with [homeshick](https://github.com/andsens/homeshick)
This is intended to be used with [chezmoi](https://github.com/twpayne/chezmoi)

0
home/bin/i3lock → chezmoi/bin/executable_i3lock Executable file → Normal file
View file

View file

5
chezmoi/dot_zprofile Normal file
View file

@ -0,0 +1,5 @@
source "${HOME}/.zshrc.d/cbi.sh" 2>/dev/null
if [ "$TTY" = '/dev/tty1' ]; then
startx
exit
fi

49
chezmoi/dot_zshenv Normal file
View file

@ -0,0 +1,49 @@
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
export LANG='en_US.UTF-8'
for editor in nvim vim nano; do
if command -v "$editor" &> /dev/null; then
export EDITOR="$editor"
break
fi
done
# if we're in vs code's terminal, set the editor to vs code
if [ "${TERM_PROGRAM:-noop}" = "vscode" ]; then
export EDITOR='code'
export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
fi
export VISUAL="${EDITOR}"
if [ -d "${HOME}/bin" ]; then
export PATH="${HOME}/bin:${PATH}"
fi
if [ -d "${HOME}/.local/bin" ]; then
export PATH="${HOME}/.local/bin:$PATH"
fi
. "$HOME/.cargo/env" 2>/dev/null
if command -v go &> /dev/null; then
GOPATH="$(go env GOPATH)"
if [ -d "${GOPATH}" ]; then
export GOPATH
export PATH="${GOPATH}/bin:${PATH}"
else
unset GOPATH
fi
fi
. /etc/profile.d/flatpak.sh 2>/dev/null
# if rootless docker has a unix domain socket, use it!
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
fi
if command -v fzf &> /dev/null && command -v ag &> /dev/null; then
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
fi

122
chezmoi/dot_zshrc Normal file
View file

@ -0,0 +1,122 @@
#!/usr/bin/zsh
zmodload zsh/datetime
autoload -Uz \
colors \
compinit \
vcs_info
compinit
colors
autoload -Uz bashcompinit
bashcompinit
setopt \
ALWAYS_TO_END \
INC_APPEND_HISTORY \
AUTO_CD \
AUTO_PUSHD \
BEEP \
COMPLETE_IN_WORD \
EXTENDED_GLOB \
EXTENDED_HISTORY \
HIST_IGNORE_DUPS \
HIST_IGNORE_SPACE \
HIST_REDUCE_BLANKS \
HIST_VERIFY \
INTERACTIVE_COMMENTS \
LONG_LIST_JOBS \
NOMATCH \
NOTIFY \
PROMPT_SUBST \
PUSHD_IGNORE_DUPS \
PUSHD_MINUS \
SHARE_HISTORY
NEWLINE=$'\n'
PS_SEPARATOR=" > "
function precmd() {
vcs_info
vcs_info_hookadd set-message vcs_test_hook
}
VCS_ROOT_DIR=''
function +vi-git-vcs-set-message-hook() {
VCS_ROOT_DIR="${hook_com[base]}"
if [ -z "$VCS_ROOT_DIR" ]; then
return
fi
if [[ "${VCS_ROOT_DIR:0:${#HOME}}" = "${HOME}" ]]; then
VCS_ROOT_DIR="~${VCS_ROOT_DIR:${#HOME}}"
fi
hook_com[misc]="$(2> /dev/null git status --short | awk '{counts[$1]++} END {
printed = "";
for (count_type in counts) {
printf "%s%%B%s%%b%d", printed, substr(count_type, 1, 1), counts[count_type];
printed = " ";
}
}')"
}
zstyle ':vcs_info:git*' formats "%F{green}%b%f %m${PS_SEPARATOR}"
zstyle ':vcs_info:git*' actionformats "%F{green}%b%f %K{red}%F{white}(%a)%f%k %B%m%%b${PS_SEPARATOR}"
zstyle ':vcs_info:git*+set-message:*' hooks git-vcs-set-message-hook
function pretty_pwd() {
local CURRENT_DIRECTORY="$PWD"
if [[ "${CURRENT_DIRECTORY:0:${#HOME}}" = "${HOME}" ]]; then
CURRENT_DIRECTORY="~${CURRENT_DIRECTORY:${#HOME}}"
fi
if [ -n "$VCS_ROOT_DIR" ] && [[ "${CURRENT_DIRECTORY:0:${#VCS_ROOT_DIR}}" = "${VCS_ROOT_DIR}" ]]; then
local VCS_ROOT_DIR_BASENAME="${VCS_ROOT_DIR##*/}"
local VCS_ROOT_DIR_BASENAME_COLORIZED='%B${VCS_ROOT_DIR_BASENAME}%b'
local COLORIZED_VCS_ROOT_DIR="${VCS_ROOT_DIR/%${VCS_ROOT_DIR_BASENAME}/${VCS_ROOT_DIR_BASENAME_COLORIZED}}"
CURRENT_DIRECTORY="${COLORIZED_VCS_ROOT_DIR}${CURRENT_DIRECTORY:${#VCS_ROOT_DIR}}"
fi
print -P "%F{blue}${CURRENT_DIRECTORY}%f"
}
function ps1_ssh() {
if [ -z "$SSH_CONNECTION" ]; then
return
fi
echo "SSH from ${SSH_CONNECTION%% *}${PS_SEPARATOR}"
}
export PS1="%(?..%K{red}%F{white}%?%f%k${PS_SEPARATOR})\$(pretty_pwd)${PS_SEPARATOR}\${vcs_info_msg_0_}%F{${color[grey]:-white}}%*%f${NEWLINE}%(!.%F{red}#.%F{yellow}\$)%f "
export RPS1="%F{${color[grey]:-white}}\$(ps1_ssh)%n@%m%f"
HISTFILE="${HOME}/.histfile"
HISTSIZE=10485760
SAVEHIST=10485760
bindkey '^R' history-incremental-search-backward
bindkey -e
zstyle ':completion:*' menu select
bindkey '^[[Z' reverse-menu-complete
export TERM='xterm-256color'
ZSH_COMPLETIONS_DIR="${HOME}/.zcompletions"
mkdir -p "$ZSH_COMPLETIONS_DIR"
fpath=("$ZSH_COMPLETIONS_DIR" $fpath)
# load any file that ends with .zsh or .sh and is executable
for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
if ! [ -x "${SCRIPT}" ]; then
continue
fi
source "${SCRIPT}"
done
compinit
bashcompinit

View file

@ -0,0 +1,35 @@
if [ "$EDITOR" = 'nvim' ]; then
alias vi='nvim'
alias vim='nvim'
alias vimdiff="nvim -d"
alias view="nvim -R"
fi
# use reflink cp if supported (yay CoW)
if 2>&1 cp --help | grep -qF -- --reflink; then
alias cp='cp -i --reflink=auto'
else
alias cp='cp -i'
fi
alias mv='mv -i'
if command -v docker-compose &> /dev/null; then
alias dco='docker-compose'
fi
case "$OSTYPE" in
darwin*)
if command -v gtar &> /dev/null; then
alias tar='gtar'
fi
if command -v gsed &> /dev/null; then
alias sed='gsed'
fi
;;
linux*)
alias open='xdg-open'
;;
esac

View file

@ -0,0 +1,5 @@
if [ -r ~/.asdf/asdf.sh ]; then
. ~/.asdf/asdf.sh
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
fi

View file

@ -0,0 +1,3 @@
if [ -r /usr/share/autojump/autojump.sh ]; then
source /usr/share/autojump/autojump.sh
fi

View file

@ -0,0 +1,3 @@
if command -v aws_completer &> /dev/null; then
complete -C "$(command -v aws_completer)" aws
fi

View file

@ -0,0 +1,17 @@
if command -v mpv &> /dev/null && command -v fzf &> /dev/null; then
if [[ "$OSTYPE" = linux* ]]; then
function camera() {
(
set -euo pipefail
printf "%s\0" /dev/video* |
fzf --print0 --read0 -m -1 --height="$((LINES/4))" |
xargs -0 -P 0 -I {} mpv \
-vf=hflip \
--demuxer-lavf-format=video4linux2 \
--demuxer-lavf-o-set=input_format=mjpeg \
av://v4l2:{}
)
}
fi
fi

View file

@ -0,0 +1,18 @@
(
set -euo pipefail
CHEZMOI_PATH="$(command -v chezmoi 2> /dev/null)"
COMPLETION_FILE="${ZSH_COMPLETIONS_DIR}/_chezmoi"
if [ -r "$COMPLETION_FILE" ]; then
COMPLETION_FILE_CTIME="$(stat -c %Z "$COMPLETION_FILE")"
CHEZMOI_FILE_CTIME="$(stat -c %Z "${CHEZMOI_PATH}")"
if [ "$COMPLETION_FILE_CTIME" -ge "$CHEZMOI_FILE_CTIME" ]; then
exit 0
fi
fi
chezmoi completion zsh > "$COMPLETION_FILE"
chmod +x "$COMPLETION_FILE"
)

View file

@ -0,0 +1,129 @@
# MIT License
# Copyright (c) 2009-2022 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# System clipboard integration
#
# This file has support for doing system clipboard copy and paste operations
# from the command line in a generic cross-platform fashion.
#
# This is uses essentially the same heuristic as neovim, with the additional
# special support for Cygwin.
# See: https://github.com/neovim/neovim/blob/e682d799fa3cf2e80a02d00c6ea874599d58f0e7/runtime/autoload/provider/clipboard.vim#L55-L121
#
# - pbcopy, pbpaste (macOS)
# - cygwin (Windows running Cygwin)
# - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
# - xclip (if $DISPLAY is set)
# - xsel (if $DISPLAY is set)
# - lemonade (for SSH) https://github.com/pocke/lemonade
# - doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/
# - win32yank (Windows)
# - tmux (if $TMUX is set)
#
# Defines two functions, clipcopy and clippaste, based on the detected platform.
##
#
# clipcopy - Copy data to clipboard
#
# Usage:
#
# <command> | clipcopy - copies stdin to clipboard
#
# clipcopy <file> - copies a file's contents to clipboard
#
##
#
# clippaste - "Paste" data from clipboard to stdout
#
# Usage:
#
# clippaste - writes clipboard's contents to stdout
#
# clippaste | <command> - pastes contents and pipes it to another process
#
# clippaste > <file> - paste contents to a file
#
# Examples:
#
# # Pipe to another process
# clippaste | grep foo
#
# # Paste to a file
# clippaste > file.txt
#
function detect-clipboard() {
emulate -L zsh
if [[ "${OSTYPE}" == darwin* ]] && (( ${+commands[pbcopy]} )) && (( ${+commands[pbpaste]} )); then
function clipcopy() { pbcopy < "${1:-/dev/stdin}"; }
function clippaste() { pbpaste; }
elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then
function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; }
function clippaste() { cat /dev/clipboard; }
elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then
function clipcopy() { wl-copy < "${1:-/dev/stdin}"; }
function clippaste() { wl-paste; }
elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xclip]} )); then
function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
function clippaste() { xclip -out -selection clipboard; }
elif [ -n "${DISPLAY:-}" ] && (( ${+commands[xsel]} )); then
function clipcopy() { xsel --clipboard --input < "${1:-/dev/stdin}"; }
function clippaste() { xsel --clipboard --output; }
elif (( ${+commands[lemonade]} )); then
function clipcopy() { lemonade copy < "${1:-/dev/stdin}"; }
function clippaste() { lemonade paste; }
elif (( ${+commands[doitclient]} )); then
function clipcopy() { doitclient wclip < "${1:-/dev/stdin}"; }
function clippaste() { doitclient wclip -r; }
elif (( ${+commands[win32yank]} )); then
function clipcopy() { win32yank -i < "${1:-/dev/stdin}"; }
function clippaste() { win32yank -o; }
elif [[ $OSTYPE == linux-android* ]] && (( $+commands[termux-clipboard-set] )); then
function clipcopy() { termux-clipboard-set < "${1:-/dev/stdin}"; }
function clippaste() { termux-clipboard-get; }
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clippaste() { tmux save-buffer -; }
elif [[ $(uname -r) = *icrosoft* ]]; then
function clipcopy() { clip.exe < "${1:-/dev/stdin}"; }
function clippaste() { powershell.exe -noprofile -command Get-Clipboard; }
else
function _retry_clipboard_detection_or_fail() {
local clipcmd="${1}"; shift
if detect-clipboard; then
"${clipcmd}" "$@"
else
print "${clipcmd}: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
return 1
fi
}
function clipcopy() { _retry_clipboard_detection_or_fail clipcopy "$@"; }
function clippaste() { _retry_clipboard_detection_or_fail clippaste "$@"; }
return 1
fi
}
# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set,
# which is not really an error. If the user calls them, they will attempt to redetect
# (for example, perhaps the user has now installed xclip) and then either print an error
# or proceed successfully.
detect-clipboard || true

View file

@ -0,0 +1,16 @@
#!/usr/bin/zsh
if command -v dircolors &> /dev/null; then
if test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)"; then
:
else
eval "$(dircolors -b)"
fi
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

View file

View file

@ -0,0 +1,3 @@
2>/dev/null for FZF_FILE in /usr/share/doc/fzf/examples/*.zsh; do
source "$FZF_FILE"
done

View file

@ -0,0 +1,17 @@
alias g='git'
alias ga='git add'
alias gb='git branch'
alias gc='git commit -v'
alias gcl='git clone --recurse-submodules'
alias gco='git checkout'
alias gcor='git checkout --recurse-submodules'
alias gcp='git cherry-pick'
alias gd='git diff'
alias gf='git fetch'
alias gfo='git fetch origin'
alias gpsup='git push --set-upstream origin $(git_current_branch)'
alias gl='git pull'
alias gm='git merge'
alias gp='git push'
alias gst='git status'
alias gsu='git submodule update'

View file

View file

@ -0,0 +1,13 @@
if [[ "$OSTYPE" = darwin* ]]; then
pdf_join() {
(
set -euo pipefail
read -r "output_file?Name of output file: "
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" \
-o "$output_file" "$@"
open "$output_file"
)
}
fi

View file

@ -0,0 +1,43 @@
SSH_ENV_CACHE="$HOME/.ssh/environment-$SHORT_HOST"
function _start_agent() {
if _check_ssh_agent_connectivity; then
return
fi
if [[ -r "$SSH_ENV_CACHE" ]]; then
. $SSH_ENV_CACHE &> /dev/null
if _check_ssh_agent_connectivity; then
return
fi
fi
echo -n >! "$SSH_ENV_CACHE"
chmod 600 "$SSH_ENV_CACHE"
ssh-agent -s > "$SSH_ENV_CACHE"
. "$SSH_ENV_CACHE" > /dev/null
}
function _check_ssh_agent_connectivity() {
ssh-add -l &> /dev/null
if [[ $? -eq 2 ]]; then
return 1
fi
}
function add_ssh_keys() {
declare -a NEW_IDENTITIES
SSH_AGENT_IDENTITIES="$(ssh-add -l || true)"
2>/dev/null for IDENTITY_FILE in ~/.ssh/id_*~*.pub; do
if [[ "$SSH_AGENT_IDENTITIES" != *"$(ssh-keygen -lf "$IDENTITY_FILE")"* ]]; then
NEW_IDENTITIES+=("$IDENTITY_FILE")
fi
done
if [[ ${#NEW_IDENTITIES} -gt 0 ]]; then
ssh-add ${^NEW_IDENTITIES}
fi
}
_start_agent && add_ssh_keys

View file

View file

@ -0,0 +1,5 @@
if command -v tag &> /dev/null; then
export TAG_SEARCH_PROG=ag # replace with rg for ripgrep
tag() { command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null }
alias ag=tag # replace with rg for ripgrep
fi

View file

@ -150,7 +150,7 @@ font:
#style: Bold Italic
# Point size
size: 10.0
size: 9.0
# Offset is the extra space around each character. `offset.y` can be thought
# of as modifying the line spacing, and `offset.x` as modifying the letter

View file

@ -0,0 +1,12 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhistcnt =2
let g:netrw_dirhist_2='/home/tony.blyler/repos/table-data-indexing-job/docker'
let g:netrw_dirhist_1='/home/tony.blyler/.zshrc.d'
let g:netrw_dirhist_0='/home/tony.blyler/go/bin'
let g:netrw_dirhist_9='/home/tony.blyler/repos/user-v2-service'
let g:netrw_dirhist_8='/home/tony.blyler/.config/i3'
let g:netrw_dirhist_7='/home/tony.blyler/.config/sway'
let g:netrw_dirhist_6='/home/tony.blyler/.zshrc.d'
let g:netrw_dirhist_5='/dev/shm'
let g:netrw_dirhist_4='/home/tony.blyler/repos/cbi-site/src'
let g:netrw_dirhist_3='/home/tony.blyler/.config/alacritty'

View file

@ -1,5 +1,5 @@
require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
ignore_install = {}, -- List of parsers to ignore installing
highlight = {

File diff suppressed because it is too large Load diff

View file

@ -1,296 +0,0 @@
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- navigation ----------------------------------------------------------------
# if you're running tmux within iTerm2
# - and tmux is 1.9 or 1.9a
# - and iTerm2 is configured to let option key act as +Esc
# - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys
# then uncomment the following line to make Meta + arrow keys mapping work
#set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D"
# -- windows & pane creation ---------------------------------------------------
# new window retains current path, possible values are:
# - true
# - false (default)
tmux_conf_new_window_retain_current_path=false
# new pane retains current path, possible values are:
# - true (default)
# - false
tmux_conf_new_pane_retain_current_path=true
# new pane tries to reconnect ssh sessions (experimental), possible values are:
# - true
# - false (default)
tmux_conf_new_pane_reconnect_ssh=false
# prompt for session name when creating a new session, possible values are:
# - true
# - false (default)
tmux_conf_new_session_prompt=false
# -- display -------------------------------------------------------------------
# RGB 24-bit colour support (tmux >= 2.2), possible values are:
# - true
# - false (default)
tmux_conf_theme_24b_colour=true
# window style
tmux_conf_theme_window_fg='default'
tmux_conf_theme_window_bg='default'
# highlight focused pane (tmux >= 2.1), possible values are:
# - true
# - false (default)
tmux_conf_theme_highlight_focused_pane=false
# focused pane colours:
tmux_conf_theme_focused_pane_fg='default'
tmux_conf_theme_focused_pane_bg='#0087d7' # light blue
# pane border style, possible values are:
# - thin (default)
# - fat
tmux_conf_theme_pane_border_style=thin
# pane borders colours:
tmux_conf_theme_pane_border='#444444' # gray
tmux_conf_theme_pane_active_border='#00afff' # light blue
# pane indicator colours
tmux_conf_theme_pane_indicator='#00afff' # light blue
tmux_conf_theme_pane_active_indicator='#00afff' # light blue
# status line style
tmux_conf_theme_message_fg='#000000' # black
tmux_conf_theme_message_bg='#ffff00' # yellow
tmux_conf_theme_message_attr='bold'
# status line command style (<prefix> : Escape)
tmux_conf_theme_message_command_fg='#ffff00' # yellow
tmux_conf_theme_message_command_bg='#000000' # black
tmux_conf_theme_message_command_attr='bold'
# window modes style
tmux_conf_theme_mode_fg='#000000' # black
tmux_conf_theme_mode_bg='#ffff00' # yellow
tmux_conf_theme_mode_attr='bold'
# status line style
tmux_conf_theme_status_fg='#8a8a8a' # light gray
tmux_conf_theme_status_bg='#080808' # dark gray
tmux_conf_theme_status_attr='none'
# terminal title
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_terminal_title='#h ❐ #S ● #I #W'
# window status style
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_window_status_fg='#8a8a8a' # light gray
tmux_conf_theme_window_status_bg='#080808' # dark gray
tmux_conf_theme_window_status_attr='none'
tmux_conf_theme_window_status_format='#I #W'
#tmux_conf_theme_window_status_format='#{circled_window_index} #W'
#tmux_conf_theme_window_status_format='#I #W#{?window_bell_flag,🔔,}#{?window_zoomed_flag,🔍,}'
# window current status style
# - built-in variables are:
# - #{circled_window_index}
# - #{circled_session_name}
# - #{hostname}
# - #{hostname_ssh}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_window_status_current_fg='#000000' # black
tmux_conf_theme_window_status_current_bg='#00afff' # light blue
tmux_conf_theme_window_status_current_attr='bold'
tmux_conf_theme_window_status_current_format='#I #W'
#tmux_conf_theme_window_status_current_format='#{circled_window_index} #W'
#tmux_conf_theme_window_status_current_format='#I #W#{?window_zoomed_flag,🔍,}'
# window activity status style
tmux_conf_theme_window_status_activity_fg='default'
tmux_conf_theme_window_status_activity_bg='default'
tmux_conf_theme_window_status_activity_attr='underscore'
# window bell status style
tmux_conf_theme_window_status_bell_fg='#ffff00' # yellow
tmux_conf_theme_window_status_bell_bg='default'
tmux_conf_theme_window_status_bell_attr='blink,bold'
# window last status style
tmux_conf_theme_window_status_last_fg='#00afff' # light blue
tmux_conf_theme_window_status_last_bg='default'
tmux_conf_theme_window_status_last_attr='none'
# status left/right sections separators
tmux_conf_theme_left_separator_main=''
tmux_conf_theme_left_separator_sub='|'
tmux_conf_theme_right_separator_main=''
tmux_conf_theme_right_separator_sub='|'
tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline
tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with
tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone
tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md
# status left/right content:
# - separate main sections with '|'
# - separate subsections with ','
# - built-in variables are:
# - #{battery_bar}
# - #{battery_hbar}
# - #{battery_percentage}
# - #{battery_status}
# - #{battery_vbar}
# - #{circled_session_name}
# - #{hostname_ssh}
# - #{hostname}
# - #{loadavg}
# - #{pairing}
# - #{prefix}
# - #{root}
# - #{synchronized}
# - #{uptime_y}
# - #{uptime_d} (modulo 365 when #{uptime_y} is used)
# - #{uptime_h}
# - #{uptime_m}
# - #{uptime_s}
# - #{username}
# - #{username_ssh}
tmux_conf_theme_status_left=' ❐ #S | ↑#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} '
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #{?battery_status, #{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} '
# status left style
tmux_conf_theme_status_left_fg='#000000,#e4e4e4,#e4e4e4' # black, white , white
tmux_conf_theme_status_left_bg='#ffff00,#ff00af,#00afff' # yellow, pink, white blue
tmux_conf_theme_status_left_attr='bold,none,none'
# status right style
tmux_conf_theme_status_right_fg='#8a8a8a,#e4e4e4,#000000' # light gray, white, black
tmux_conf_theme_status_right_bg='#080808,#d70000,#e4e4e4' # dark gray, red, white
tmux_conf_theme_status_right_attr='none,none,bold'
# pairing indicator
tmux_conf_theme_pairing='👓 ' # U+1F453
tmux_conf_theme_pairing_fg='none'
tmux_conf_theme_pairing_bg='none'
tmux_conf_theme_pairing_attr='none'
# prefix indicator
tmux_conf_theme_prefix='⌨ ' # U+2328
tmux_conf_theme_prefix_fg='none'
tmux_conf_theme_prefix_bg='none'
tmux_conf_theme_prefix_attr='none'
# root indicator
tmux_conf_theme_root='!'
tmux_conf_theme_root_fg='none'
tmux_conf_theme_root_bg='none'
tmux_conf_theme_root_attr='bold,blink'
# synchronized indicator
tmux_conf_theme_synchronized='🔒' # U+1F512
tmux_conf_theme_synchronized_fg='none'
tmux_conf_theme_synchronized_bg='none'
tmux_conf_theme_synchronized_attr='none'
# battery bar symbols
tmux_conf_battery_bar_symbol_full='◼'
tmux_conf_battery_bar_symbol_empty='◻'
#tmux_conf_battery_bar_symbol_full='♥'
#tmux_conf_battery_bar_symbol_empty='·'
# battery bar length (in number of symbols), possible values are:
# - auto
# - a number, e.g. 5
tmux_conf_battery_bar_length='auto'
# battery bar palette, possible values are:
# - gradient (default)
# - heat
# - 'colour_full_fg,colour_empty_fg,colour_bg'
tmux_conf_battery_bar_palette='gradient'
#tmux_conf_battery_bar_palette='#d70000,#e4e4e4,#000000' # red, white, black
# battery hbar palette, possible values are:
# - gradient (default)
# - heat
# - 'colour_low,colour_half,colour_full'
tmux_conf_battery_hbar_palette='gradient'
#tmux_conf_battery_hbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green
# battery vbar palette, possible values are:
# - gradient (default)
# - heat
# - 'colour_low,colour_half,colour_full'
tmux_conf_battery_vbar_palette='gradient'
#tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00' # red, orange, green
# symbols used to indicate whether battery is charging or discharging
#tmux_conf_battery_status_charging='↑' # U+2191
#tmux_conf_battery_status_discharging='↓' # U+2193
#tmux_conf_battery_status_charging='⚡ ' # U+26A1
tmux_conf_battery_status_charging='🔌 ' # U+1F50C
tmux_conf_battery_status_discharging='🔋 ' # U+1F50B
# clock style (when you hit <prefix> + t)
# you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right
tmux_conf_theme_clock_colour='#00afff' # light blue
tmux_conf_theme_clock_style='24'
# -- clipboard -----------------------------------------------------------------
# in copy mode, copying selection also copies to the OS clipboard
# - true
# - false (default)
# on macOS, this requires installing reattach-to-user-namespace, see README.md
# on Linux, this requires xsel or xclip
tmux_conf_copy_to_os_clipboard=false
# -- user customizations -------------------------------------------------------
# this is the place to override or undo settings
# increase history size
set -g history-limit 100000
# start with mouse mode enabled
#set -g mouse on
# force Vi mode
# really you should export VISUAL or EDITOR environment variable, see manual
#set -g status-keys vi
#set -g mode-keys vi
# replace C-b by C-a instead of using both prefixes
set -gu prefix2
unbind C-a
# unbind C-b
# set -g prefix C-a
# bind C-a send-prefix
# move status line to top
set -g status-position top

View file

@ -1,216 +0,0 @@
# 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
if [ -e /etc/profile.d/flatpak.sh ]; then
source /etc/profile.d/flatpak.sh
fi
if [ -f "${HOME}/.zshrc.d/init" ]; then
source "${HOME}/.zshrc.d/init"
fi
export PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:${PATH}"
if [ -d "${HOME}/bin" ]; then
export PATH="${HOME}/bin:${PATH}"
fi
if [ -d "${HOME}/.local/bin" ]; then
export PATH="${HOME}/.local/bin:$PATH"
fi
if command -v go &> /dev/null; then
GOPATH="$(go env GOPATH)"
if [ -d "${GOPATH}" ]; then
export GOPATH
export PATH="${GOPATH}/bin:${PATH}"
fi
fi
if (( $+commands[tag] )); then
export TAG_SEARCH_PROG=ag # replace with rg for ripgrep
tag() { command tag "$@"; source ${TAG_ALIAS_FILE:-/tmp/tag_aliases} 2>/dev/null }
alias ag=tag # replace with rg for ripgrep
fi
# oh-my-zsh {
export ZSH="${HOME}/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
HYPHEN_INSENSITIVE="true"
UPDATE_ZSH_DAYS=7
DISABLE_UPDATE_PROMPT="true"
HIST_STAMPS="mm/dd/yyyy"
plugins=(
autojump
aws
battery
brew
catimg
colorize
command-not-found
common-aliases
copydir
copyfile
docker
docker-compose
encode64
fzf
git
git-extras
gpg-agent
golang
grunt
helm
kube-ps1
kubectl
macos
minikube
node
npm
pass
pip
pod
ssh-agent
sudo
tmux
xcode
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
# }
# zsh {
HISTFILE="${HOME}/.histfile"
HISTSIZE=1048576
SAVEHIST=1048576
setopt \
appendhistory \
autocd \
beep \
extendedglob \
nomatch \
notify \
HIST_IGNORE_DUPS \
INC_APPEND_HISTORY \
SHARE_HISTORY \
HIST_REDUCE_BLANKS
# }
# general {
export LANG='en_US.UTF-8'
export TERM='xterm-256color'
export EDITOR='vim'
# if nvim is installed, effectively replace vim
if command -v nvim &> /dev/null; then
export EDITOR='nvim'
alias vi='nvim'
alias vim='nvim'
alias vimdiff="nvim -d"
alias view="nvim -R"
fi
# if we're in vs code's terminal, set the editor to vs code
if [ "${TERM_PROGRAM:-nope}" = "vscode" ]; then
export EDITOR='code'
export TAG_CMD_FMT_STRING="code --goto {{.Filename}}:{{.LineNumber}}:{{.ColumnNumber}}"
fi
export VISUAL="${EDITOR}"
# use reflink cp if supported (yay CoW)
if 2>&1 cp --help | grep -q reflink; then
alias cp='cp -i --reflink=auto'
else
alias cp='cp -i'
fi
alias mv='mv -i'
# if rootless docker has a unix domain socket, use it!
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
fi
if command -v docker-compose &> /dev/null; then
alias dco='docker-compose'
fi
if command -v minikube &> /dev/null; then
alias mk='minikube'
fi
if command -v kubectl &> /dev/null; then
alias k='kubectl'
fi
if command -v kubectx &> /dev/null; then
alias kctx='kubectx'
fi
if command -v kubens &> /dev/null; then
alias kns='kubens'
fi
CARGO_ENV="${HOME}/.cargo/env"
if [ -f "${CARGO_ENV}" ]; then
source "${CARGO_ENV}"
fi
# add awless autocompletion if available
if command -v awless &> /dev/null; then
source <(awless completion zsh)
fi
if command -v fzf &> /dev/null; then
export FZF_DEFAULT_COMMAND='ag --skip-vcs-ignores --nocolor -g "" -l'
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
fi
case "$(uname)" in
"Darwin")
pdf_join() {
join_py="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py"
echo -n "Name of output file: "
read output_file && "$join_py" -o $output_file $@ && open $output_file
}
if command -v gtar &> /dev/null; then
alias tar='gtar'
fi
if command -v gsed &> /dev/null; then
alias sed='gsed'
fi
;;
"Linux")
alias open="xdg-open"
;;
esac
# }
source "${HOME}/.homesick/repos/homeshick/homeshick.sh"
homeshick refresh 5 -q
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# load any file that ends with .zsh or .sh and is executable
for SCRIPT in "${HOME}/.zshrc.d"/**/(.|?)*(.zsh|.sh); do
if ! [ -x "${SCRIPT}" ]; then
continue
fi
source "${SCRIPT}"
done
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View file

@ -1,102 +0,0 @@
#!/bin/bash
readonly HOMESHICK_DIR="${HOME}/.homesick/repos/homeshick"
check_required_cmds() {
local -r REQUIRED_CMDS=(
'curl'
'git'
'sha256sum'
'tar'
'tmux'
'vim'
'zsh'
)
local RETURN=0
local REQUIRED_CMD
for REQUIRED_CMD in ${REQUIRED_CMDS[*]}; do
if ! command -v "${REQUIRED_CMD}" &> /dev/null; then
>&2 echo "Missing '${REQUIRED_CMD}' from PATH"
RETURN=1
fi
done
return "${RETURN}"
}
install_homeshick() {
if [ -d "${HOMESHICK_DIR}" ]; then
echo 'homeshick is already installed'
return
fi
git clone https://github.com/andsens/homeshick.git "${HOMESHICK_DIR}"
}
install_ohmyzsh() {
if [ -d "${HOME}/.oh-my-zsh" ]; then
echo 'oh-my-zsh is already installed'
return
fi
/bin/bash -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
local -r P10K_THEME_PATH="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"
if [ -d "$P10K_THEME_PATH" ]; then
return
fi
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$P10K_THEME_PATH"
}
install_custom_ohmyzsh_plugins() {
local REPOS=(
https://github.com/zsh-users/zsh-autosuggestions
https://github.com/zsh-users/zsh-syntax-highlighting
)
local REPO
local ZSH_CUSTOM_DEST
for REPO in ${REPOS[*]}; do
ZSH_CUSTOM_DEST="${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}/plugins/$(basename "${REPO}")"
if [ -d "${ZSH_CUSTOM_DEST}" ]; then
continue
fi
git clone \
"${REPO}" \
"${ZSH_CUSTOM_DEST}" || exit $?
done
}
install_tmux_conf() {
if [ -d "${HOME}/.tmux" ]; then
echo '.tmux already exists'
return
fi
(
set -e
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s .tmux/.tmux.conf ./
)
}
check_required_cmds || exit $?
echo 'installing homeshick'
install_homeshick || exit $?
echo 'installing oh-my-zsh'
install_ohmyzsh || exit $?
echo 'installing custom ohmyzsh plugins'
install_custom_ohmyzsh_plugins || exit $?
echo 'installing tmux config'
install_tmux_conf || exit $?
source "${HOMESHICK_DIR}/homeshick.sh"
homeshick clone https://github.com/tblyler/tb-dotfiles
echo 'now in zsh, run "upgrade_system"'