mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
Compare commits
No commits in common. "v1.5.0" and "main" have entirely different histories.
241 changed files with 12992 additions and 8535 deletions
11
.bash_profile
Normal file
11
.bash_profile
Normal file
|
@ -0,0 +1,11 @@
|
|||
# just to make sure we always source .bashrc
|
||||
source ~/.bashrc
|
||||
export PATH="/opt/homebrew/sbin:$PATH"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
91
.bashrc
Normal file
91
.bashrc
Normal file
|
@ -0,0 +1,91 @@
|
|||
# @jessebot's .bashrc: an ok BASH experience.
|
||||
# ------------------------------- General ---------------------------------- #
|
||||
|
||||
# fixes "scp: Received message too long 169564991" error
|
||||
# If not running interactively, don't do anything, no outputs
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# I hate bells a lot
|
||||
set bell-style none
|
||||
|
||||
# python version is subject to change, but really important for pathing
|
||||
export PYTHON_VERSION="3.12"
|
||||
|
||||
# this just makes howdoi use colors
|
||||
export HOWDOI_COLORIZE=1
|
||||
|
||||
# makes gpg prompt for passphrase in the terminal for git commit -S
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
# source all the pathing exports including XDG Base Dir Spec env vars
|
||||
. ~/.config/bash/path.sh
|
||||
|
||||
# history settings are in this file (this relies on path.sh being sourced)
|
||||
. $XDG_CONFIG_HOME/bash/history.sh
|
||||
|
||||
# everything to do with things like less and editors is in here
|
||||
. $XDG_CONFIG_HOME/bash/text_editing.sh
|
||||
|
||||
# aliases are all confined to this file, except kubernetes below
|
||||
. $XDG_CONFIG_HOME/bash/alias.sh
|
||||
|
||||
# k8s aliases and configuration
|
||||
. $XDG_CONFIG_HOME/bash/k8s.sh
|
||||
|
||||
# load additional bash completion for different commands
|
||||
. $XDG_CONFIG_HOME/bash/completion.sh
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Other Load on start #
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
# include external rc files in ~/.config/bash/personal if they exist
|
||||
personal_rc_file="$XDG_CONFIG_HOME/bash/personal/bashrc"
|
||||
if [ -f $personal_rc_file ]; then
|
||||
. $personal_rc_file
|
||||
fi
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# BASH Prompt using POWERLINE #
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
if [ -f "/.dockerenv" ]; then
|
||||
# if we're in docker, this file should exist, so show a whale in powerline
|
||||
export CURRENT_SHELL_LOCATION="🐳"
|
||||
elif [ -n "$SSH_CLIENT" ]; then
|
||||
# if $SSH_CLIENT is not empty, we're SSHed into something, so show a robot
|
||||
export CURRENT_SHELL_LOCATION="🤖"
|
||||
else
|
||||
# if not in SSH or docker, then show a house :)
|
||||
export CURRENT_SHELL_LOCATION="🏡"
|
||||
fi
|
||||
|
||||
# launch powerline only if we're not in a neovim fterm floating window
|
||||
if [ -z $FTERM_TUI ] ; then
|
||||
# powerline - a fancy extensible prompt: https://powerline.readthedocs.io
|
||||
if [ -f $pip_packages/powerline/bindings/bash/powerline.sh ]; then
|
||||
powerline-daemon -q
|
||||
POWERLINE_BASH_CONTINUATION=1
|
||||
POWERLINE_BASH_SELECT=1
|
||||
. $pip_packages/powerline/bindings/bash/powerline.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Personal MOTD using fastfetch #
|
||||
# you can set $LOCALHOST_PRESET to a fastfetch preset you have locally in: #
|
||||
# $XDG_DATA_HOME/fastfetch/presets/ #
|
||||
# -------------------------------------------------------------------------- #
|
||||
if [ ! -z $LOCALHOST_PRESET ] && [ -z $NVIM ]; then
|
||||
alias fastfetch="fastfetch --load-config $XDG_DATA_HOME/fastfetch/presets/${LOCALHOST_PRESET}.jsonc"
|
||||
fi
|
||||
|
||||
# don't print fastfetch in neovim or poetry shell by default, and don't use logo
|
||||
if [ ! -z $NVIM ] || [ ! -z $POETRY_ACTIVE ] || [ ! -z $ZELLIJ ]; then
|
||||
echo "Entering a poetry shell, so not printing fastfetch."
|
||||
else
|
||||
fastfetch
|
||||
fi
|
3
.cache/wget/wget-hsts
Normal file
3
.cache/wget/wget-hsts
Normal file
|
@ -0,0 +1,3 @@
|
|||
# HSTS 1.0 Known Hosts database for GNU Wget.
|
||||
# Edit at your own risk.
|
||||
# <hostname> <port> <incl. subdomains> <created> <max-age>
|
2
.config/asciinema/config
Normal file
2
.config/asciinema/config
Normal file
|
@ -0,0 +1,2 @@
|
|||
[record]
|
||||
command = /bin/bash --login
|
183
.config/bash/alias.sh
Normal file
183
.config/bash/alias.sh
Normal file
|
@ -0,0 +1,183 @@
|
|||
# --------------------------------------------------------------------- #
|
||||
# SHELL ALIASES #
|
||||
# --------------------------------------------------------------------- #
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ MacOS Specific ~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
if [[ $(uname) == *"Darwin"* ]]; then
|
||||
# Always use GNU sed
|
||||
alias sed='gsed'
|
||||
else
|
||||
# freetube only seems to work through flatpak on debian
|
||||
# alias freetube="flatpak run io.freetubeapp.FreeTube"
|
||||
# lutris works better through flatpak
|
||||
alias lutris="flatpak run net.lutris.Lutris"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Typos <3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
alias peotry='poetry'
|
||||
alias pign='ping'
|
||||
alias gtop='btm'
|
||||
alias gotop='btm'
|
||||
# can never spell clear
|
||||
alias celar='clear'
|
||||
alias clar='clear'
|
||||
# clear, but in dutch
|
||||
alias leegmaken='clear'
|
||||
# can't spell tree
|
||||
alias ter='tree'
|
||||
alias tre='tree'
|
||||
alias tere='tree'
|
||||
# can't spell docker
|
||||
alias docekr='docker'
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python 🐍 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# can't spell python
|
||||
alias pip="pip$PYTHON_VERSION"
|
||||
alias pthyon="python$PYTHON_VERSION"
|
||||
alias ptyhon="python$PYTHON_VERSION"
|
||||
alias pythong="python$PYTHON_VERSION"
|
||||
# alias because versions lower than python$PYTHON_VERSION still in some places
|
||||
alias python="python$PYTHON_VERSION"
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ General ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
|
||||
# allow setting wezterm tab title more easily
|
||||
alias tab='wezterm cli set-tab-title'
|
||||
|
||||
# makes wget XDG compliant (this goes to ~/.local/share/wget/wget-hsts)
|
||||
mkdir -p $XDG_DATA_HOME/wget/wget-hsts
|
||||
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget/wget-hsts"'
|
||||
|
||||
# colordiff - diff, but with colors for accessibility
|
||||
alias diff='colordiff -uw'
|
||||
|
||||
# we love a good tracer t
|
||||
alias tracert='traceroute'
|
||||
|
||||
# whoami, whereami, whoareyou?
|
||||
alias whereami='hostname'
|
||||
alias whoareyou='echo "I am $HOSTNAME, your favorite computer 🥰"'
|
||||
|
||||
# I never remember what the img2sixel command is called
|
||||
alias sixel='img2sixel'
|
||||
alias imgcat='wezterm imgcat'
|
||||
|
||||
# use btm instead of top for live system TUI dashboard
|
||||
alias top='btm'
|
||||
|
||||
# quick to do
|
||||
alias todo="$EDITOR ~/todo.md"
|
||||
|
||||
# so that w3m uses the correct XDG config location
|
||||
alias w3m="w3m -sixel -config ~/.config/w3m/config"
|
||||
|
||||
# to run my main dev environment container
|
||||
# run the docker container with my local repos dir and local ssh keys as well as my timezone already set
|
||||
if [[ "$(arch)" == "arm64" ]]; then
|
||||
alias do-ide="docker run -it --platform=linux/arm64 -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:latest-arm"
|
||||
alias do-devops="docker run -it --platform=linux/arm64 -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:arm-devops"
|
||||
alias do-full="docker run -it --platform=linux/arm64 -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:arm-full-tui"
|
||||
else
|
||||
alias do-ide="docker run -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:latest"
|
||||
alias do-devops="docker run -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:devops"
|
||||
alias do-full="docker run -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' --rm jessebot/onboardme:full-tui"
|
||||
fi
|
||||
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ls ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# lsd instead of ls for colors/icons
|
||||
alias ls='lsd -a'
|
||||
# lsd and list long, human readable file sizes, show hidden files
|
||||
alias ll='lsd -hal'
|
||||
# sort by most recent and reversed, so the most recent file is the last
|
||||
# helpful for directories with lots of files
|
||||
alias lt='lsd -atr'
|
||||
# same as above, but long
|
||||
alias llt='lsd -haltr'
|
||||
# lsd already has a fancier tree command with icons
|
||||
alias tree='lsd --tree --depth=2'
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ grep ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# always use colors
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias grpe='grep'
|
||||
alias gerp='grep'
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ git ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
|
||||
alias gc='git commit -m'
|
||||
alias gs='git status'
|
||||
# check all directories below current directory for their git status
|
||||
alias gsa='ls -1 -A | xargs -I % sh -c "if [ -d % ]; then toilet --gay -f smblock %; cd %; git status --short; cd - > /dev/null; echo ''; fi"'
|
||||
alias gd='git diff'
|
||||
alias ga='git add .'
|
||||
alias gph='git push && git push --tags'
|
||||
alias gp='git pull && git log -1'
|
||||
|
||||
# glab is gitlab's cli, but I always type gl by accident
|
||||
alias gl='glab'
|
||||
|
||||
# typos
|
||||
alias gitcommit='git commit'
|
||||
alias gitadd='git add'
|
||||
alias gti='git'
|
||||
alias gt='git'
|
||||
alias gtt='git'
|
||||
alias girt='git'
|
||||
|
||||
# Function to fix gi typos
|
||||
function gi {
|
||||
if [[ $1 = "tpull" || $1 = "pull" ]]; then
|
||||
git pull
|
||||
elif [ $1 = "tpush" ]; then
|
||||
shift
|
||||
git push $@
|
||||
elif [ $1 = "tdiff" ]; then
|
||||
# this drops the tdiff arg and then starts the arg array at the next arg
|
||||
shift
|
||||
# $@ is all of the arguments passed in
|
||||
git diff "$@"
|
||||
elif [ $1 = "tcommit" ]; then
|
||||
# this drops the tcommit arg and then starts the arg array at the next arg
|
||||
shift
|
||||
# $@ is all of the arguments passed in
|
||||
git commit "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
function gita {
|
||||
if [[ $1 = "dd" ]]; then
|
||||
shift
|
||||
git add $@
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# -------------------------- CUSTOM FUNCTIONS ----------------------------- #
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ag (search repos) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
function agr {
|
||||
if [ $2 = "y"]; then
|
||||
for $repo in $(ls -1 $REPOS); do
|
||||
cd $REPOS/$repo && git pull
|
||||
done
|
||||
fi
|
||||
ag $1 $REPOS
|
||||
}
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ base64 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
|
||||
function b64 {
|
||||
echo -n $1 | base64
|
||||
}
|
||||
|
||||
# set decode to be base64 decode
|
||||
function decode {
|
||||
echo -n $1 | base64 --decode
|
||||
}
|
||||
|
||||
## MORE ALIASES IN text_editing.sh
|
1
.config/bash/colors.sh
Normal file
1
.config/bash/colors.sh
Normal file
|
@ -0,0 +1 @@
|
|||
export JQ_COLORS="2;33:2;33:0;33:0;36:1;32:0;35:1;35"
|
1247
.config/bash/completion.sh
Normal file
1247
.config/bash/completion.sh
Normal file
File diff suppressed because it is too large
Load diff
338
.config/bash/helm_completion.sh
Normal file
338
.config/bash/helm_completion.sh
Normal file
|
@ -0,0 +1,338 @@
|
|||
# bash completion V2 for helm -*- shell-script -*-
|
||||
|
||||
__helm_debug()
|
||||
{
|
||||
if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
|
||||
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Macs have bash3 for which the bash-completion package doesn't include
|
||||
# _init_completion. This is a minimal version of that function.
|
||||
__helm_init_completion()
|
||||
{
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref "$@" cur prev words cword
|
||||
}
|
||||
|
||||
# This function calls the helm program to obtain the completion
|
||||
# results and the directive. It fills the 'out' and 'directive' vars.
|
||||
__helm_get_completion_results() {
|
||||
local requestComp lastParam lastChar args
|
||||
|
||||
# Prepare the command to request completions for the program.
|
||||
# Calling ${words[0]} instead of directly helm allows handling aliases
|
||||
args=("${words[@]:1}")
|
||||
requestComp="${words[0]} __complete ${args[*]}"
|
||||
|
||||
lastParam=${words[$((${#words[@]}-1))]}
|
||||
lastChar=${lastParam:$((${#lastParam}-1)):1}
|
||||
__helm_debug "lastParam ${lastParam}, lastChar ${lastChar}"
|
||||
|
||||
if [[ -z ${cur} && ${lastChar} != = ]]; then
|
||||
# If the last parameter is complete (there is a space following it)
|
||||
# We add an extra empty parameter so we can indicate this to the go method.
|
||||
__helm_debug "Adding extra empty parameter"
|
||||
requestComp="${requestComp} ''"
|
||||
fi
|
||||
|
||||
# When completing a flag with an = (e.g., helm -n=<TAB>)
|
||||
# bash focuses on the part after the =, so we need to remove
|
||||
# the flag part from $cur
|
||||
if [[ ${cur} == -*=* ]]; then
|
||||
cur="${cur#*=}"
|
||||
fi
|
||||
|
||||
__helm_debug "Calling ${requestComp}"
|
||||
# Use eval to handle any environment variables and such
|
||||
out=$(eval "${requestComp}" 2>/dev/null)
|
||||
|
||||
# Extract the directive integer at the very end of the output following a colon (:)
|
||||
directive=${out##*:}
|
||||
# Remove the directive
|
||||
out=${out%:*}
|
||||
if [[ ${directive} == "${out}" ]]; then
|
||||
# There is not directive specified
|
||||
directive=0
|
||||
fi
|
||||
__helm_debug "The completion directive is: ${directive}"
|
||||
__helm_debug "The completions are: ${out}"
|
||||
}
|
||||
|
||||
__helm_process_completion_results() {
|
||||
local shellCompDirectiveError=1
|
||||
local shellCompDirectiveNoSpace=2
|
||||
local shellCompDirectiveNoFileComp=4
|
||||
local shellCompDirectiveFilterFileExt=8
|
||||
local shellCompDirectiveFilterDirs=16
|
||||
local shellCompDirectiveKeepOrder=32
|
||||
|
||||
if (((directive & shellCompDirectiveError) != 0)); then
|
||||
# Error code. No completion.
|
||||
__helm_debug "Received error from custom completion go code"
|
||||
return
|
||||
else
|
||||
if (((directive & shellCompDirectiveNoSpace) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__helm_debug "Activating no space"
|
||||
compopt -o nospace
|
||||
else
|
||||
__helm_debug "No space directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveKeepOrder) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
# no sort isn't supported for bash less than < 4.4
|
||||
if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
|
||||
__helm_debug "No sort directive not supported in this version of bash"
|
||||
else
|
||||
__helm_debug "Activating keep order"
|
||||
compopt -o nosort
|
||||
fi
|
||||
else
|
||||
__helm_debug "No sort directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveNoFileComp) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__helm_debug "Activating no file completion"
|
||||
compopt +o default
|
||||
else
|
||||
__helm_debug "No file completion directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Separate activeHelp from normal completions
|
||||
local completions=()
|
||||
local activeHelp=()
|
||||
__helm_extract_activeHelp
|
||||
|
||||
if (((directive & shellCompDirectiveFilterFileExt) != 0)); then
|
||||
# File extension filtering
|
||||
local fullFilter filter filteringCmd
|
||||
|
||||
# Do not use quotes around the $completions variable or else newline
|
||||
# characters will be kept.
|
||||
for filter in ${completions[*]}; do
|
||||
fullFilter+="$filter|"
|
||||
done
|
||||
|
||||
filteringCmd="_filedir $fullFilter"
|
||||
__helm_debug "File filtering command: $filteringCmd"
|
||||
$filteringCmd
|
||||
elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
|
||||
# File completion for directories only
|
||||
|
||||
local subdir
|
||||
subdir=${completions[0]}
|
||||
if [[ -n $subdir ]]; then
|
||||
__helm_debug "Listing directories in $subdir"
|
||||
pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
|
||||
else
|
||||
__helm_debug "Listing directories in ."
|
||||
_filedir -d
|
||||
fi
|
||||
else
|
||||
__helm_handle_completion_types
|
||||
fi
|
||||
|
||||
__helm_handle_special_char "$cur" :
|
||||
__helm_handle_special_char "$cur" =
|
||||
|
||||
# Print the activeHelp statements before we finish
|
||||
if ((${#activeHelp[*]} != 0)); then
|
||||
printf "\n";
|
||||
printf "%s\n" "${activeHelp[@]}"
|
||||
printf "\n"
|
||||
|
||||
# The prompt format is only available from bash 4.4.
|
||||
# We test if it is available before using it.
|
||||
if (x=${PS1@P}) 2> /dev/null; then
|
||||
printf "%s" "${PS1@P}${COMP_LINE[@]}"
|
||||
else
|
||||
# Can't print the prompt. Just print the
|
||||
# text the user had typed, it is workable enough.
|
||||
printf "%s" "${COMP_LINE[@]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Separate activeHelp lines from real completions.
|
||||
# Fills the $activeHelp and $completions arrays.
|
||||
__helm_extract_activeHelp() {
|
||||
local activeHelpMarker="_activeHelp_ "
|
||||
local endIndex=${#activeHelpMarker}
|
||||
|
||||
while IFS='' read -r comp; do
|
||||
if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then
|
||||
comp=${comp:endIndex}
|
||||
__helm_debug "ActiveHelp found: $comp"
|
||||
if [[ -n $comp ]]; then
|
||||
activeHelp+=("$comp")
|
||||
fi
|
||||
else
|
||||
# Not an activeHelp line but a normal completion
|
||||
completions+=("$comp")
|
||||
fi
|
||||
done <<<"${out}"
|
||||
}
|
||||
|
||||
__helm_handle_completion_types() {
|
||||
__helm_debug "__helm_handle_completion_types: COMP_TYPE is $COMP_TYPE"
|
||||
|
||||
case $COMP_TYPE in
|
||||
37|42)
|
||||
# Type: menu-complete/menu-complete-backward and insert-completions
|
||||
# If the user requested inserting one completion at a time, or all
|
||||
# completions at once on the command-line we must remove the descriptions.
|
||||
# https://github.com/spf13/cobra/issues/1508
|
||||
local tab=$'\t' comp
|
||||
while IFS='' read -r comp; do
|
||||
[[ -z $comp ]] && continue
|
||||
# Strip any description
|
||||
comp=${comp%%$tab*}
|
||||
# Only consider the completions that match
|
||||
if [[ $comp == "$cur"* ]]; then
|
||||
COMPREPLY+=("$comp")
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
;;
|
||||
|
||||
*)
|
||||
# Type: complete (normal completion)
|
||||
__helm_handle_standard_completion_case
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__helm_handle_standard_completion_case() {
|
||||
local tab=$'\t' comp
|
||||
|
||||
# Short circuit to optimize if we don't have descriptions
|
||||
if [[ "${completions[*]}" != *$tab* ]]; then
|
||||
IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur")
|
||||
return 0
|
||||
fi
|
||||
|
||||
local longest=0
|
||||
local compline
|
||||
# Look for the longest completion so that we can format things nicely
|
||||
while IFS='' read -r compline; do
|
||||
[[ -z $compline ]] && continue
|
||||
# Strip any description before checking the length
|
||||
comp=${compline%%$tab*}
|
||||
# Only consider the completions that match
|
||||
[[ $comp == "$cur"* ]] || continue
|
||||
COMPREPLY+=("$compline")
|
||||
if ((${#comp}>longest)); then
|
||||
longest=${#comp}
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
|
||||
# If there is a single completion left, remove the description text
|
||||
if ((${#COMPREPLY[*]} == 1)); then
|
||||
__helm_debug "COMPREPLY[0]: ${COMPREPLY[0]}"
|
||||
comp="${COMPREPLY[0]%%$tab*}"
|
||||
__helm_debug "Removed description from single completion, which is now: ${comp}"
|
||||
COMPREPLY[0]=$comp
|
||||
else # Format the descriptions
|
||||
__helm_format_comp_descriptions $longest
|
||||
fi
|
||||
}
|
||||
|
||||
__helm_handle_special_char()
|
||||
{
|
||||
local comp="$1"
|
||||
local char=$2
|
||||
if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then
|
||||
local word=${comp%"${comp##*${char}}"}
|
||||
local idx=${#COMPREPLY[*]}
|
||||
while ((--idx >= 0)); do
|
||||
COMPREPLY[idx]=${COMPREPLY[idx]#"$word"}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
__helm_format_comp_descriptions()
|
||||
{
|
||||
local tab=$'\t'
|
||||
local comp desc maxdesclength
|
||||
local longest=$1
|
||||
|
||||
local i ci
|
||||
for ci in ${!COMPREPLY[*]}; do
|
||||
comp=${COMPREPLY[ci]}
|
||||
# Properly format the description string which follows a tab character if there is one
|
||||
if [[ "$comp" == *$tab* ]]; then
|
||||
__helm_debug "Original comp: $comp"
|
||||
desc=${comp#*$tab}
|
||||
comp=${comp%%$tab*}
|
||||
|
||||
# $COLUMNS stores the current shell width.
|
||||
# Remove an extra 4 because we add 2 spaces and 2 parentheses.
|
||||
maxdesclength=$(( COLUMNS - longest - 4 ))
|
||||
|
||||
# Make sure we can fit a description of at least 8 characters
|
||||
# if we are to align the descriptions.
|
||||
if ((maxdesclength > 8)); then
|
||||
# Add the proper number of spaces to align the descriptions
|
||||
for ((i = ${#comp} ; i < longest ; i++)); do
|
||||
comp+=" "
|
||||
done
|
||||
else
|
||||
# Don't pad the descriptions so we can fit more text after the completion
|
||||
maxdesclength=$(( COLUMNS - ${#comp} - 4 ))
|
||||
fi
|
||||
|
||||
# If there is enough space for any description text,
|
||||
# truncate the descriptions that are too long for the shell width
|
||||
if ((maxdesclength > 0)); then
|
||||
if ((${#desc} > maxdesclength)); then
|
||||
desc=${desc:0:$(( maxdesclength - 1 ))}
|
||||
desc+="…"
|
||||
fi
|
||||
comp+=" ($desc)"
|
||||
fi
|
||||
COMPREPLY[ci]=$comp
|
||||
__helm_debug "Final comp: $comp"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
__start_helm()
|
||||
{
|
||||
local cur prev words cword split
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
# Call _init_completion from the bash-completion package
|
||||
# to prepare the arguments properly
|
||||
if declare -F _init_completion >/dev/null 2>&1; then
|
||||
_init_completion -n =: || return
|
||||
else
|
||||
__helm_init_completion -n =: || return
|
||||
fi
|
||||
|
||||
__helm_debug
|
||||
__helm_debug "========= starting completion logic =========="
|
||||
__helm_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword"
|
||||
|
||||
# The user could have moved the cursor backwards on the command-line.
|
||||
# We need to trigger completion from the $cword location, so we need
|
||||
# to truncate the command-line ($words) up to the $cword location.
|
||||
words=("${words[@]:0:$cword+1}")
|
||||
__helm_debug "Truncated words[*]: ${words[*]},"
|
||||
|
||||
local out directive
|
||||
__helm_get_completion_results
|
||||
__helm_process_completion_results
|
||||
}
|
||||
|
||||
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
complete -o default -F __start_helm helm
|
||||
else
|
||||
complete -o default -o nospace -F __start_helm helm
|
||||
fi
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
19
.config/bash/history.sh
Normal file
19
.config/bash/history.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# History
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# name of the history file to create and log to
|
||||
HISTFILE="$HOME/.local/state/bash/history"
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=10000
|
||||
HISTFILESIZE=20000
|
||||
|
||||
# for setting time stamps on history
|
||||
HISTTIMEFORMAT="%d/%m/%y %T "
|
224
.config/bash/k8s.sh
Normal file
224
.config/bash/k8s.sh
Normal file
|
@ -0,0 +1,224 @@
|
|||
# Jessebot's Kubernetes helpful exports and aliases for BASH
|
||||
|
||||
# Make kubeconfig XDG base directory spec compliant
|
||||
export KUBECONFIG=$XDG_CONFIG_HOME/kube/config
|
||||
|
||||
# this is for the kubernetes plugin manager, krew
|
||||
export KREW_ROOT=$XDG_DATA_HOME/krew
|
||||
export PATH="${PATH}:$XDG_DATA_HOME/krew/bin"
|
||||
|
||||
# change this to what ever search tool you'd like,
|
||||
# e.g. "grep -i"
|
||||
export SEARCH_TOOL="ag"
|
||||
|
||||
# I always forget that krew isn't a command
|
||||
alias krew='kubectl krew'
|
||||
|
||||
alias k="kubecolor"
|
||||
alias ka="kubecolor apply -f"
|
||||
# cluster context shortcut
|
||||
alias kcc="kubecolor config get-contexts"
|
||||
alias kd="kubecolor describe"
|
||||
alias ke="kubecolor exec -it"
|
||||
alias kl="kubecolor logs -f"
|
||||
alias kdm="kubecolor describe nodes -l kubernetes.io/role=master"
|
||||
alias kdn="kubecolor describe nodes -l kubernetes.io/role=node"
|
||||
alias kg="kubecolor get"
|
||||
alias kgi="kubecolor get ingress"
|
||||
alias kgm="kubecolor get nodes -l kubernetes.io/role=master"
|
||||
alias kgn="kubecolor get nodes -l kubernetes.io/role=node"
|
||||
# get cnpg backups
|
||||
alias kgpgb="echo -e 'backups.postgresql.cnpg.io\n─────────────────────────────────────────────────────────────────' && kubecolor get backups.postgresql.cnpg.io -o custom-columns=name:.metadata.name,status:.status.phase"
|
||||
# get k8up backups
|
||||
alias kgb="kubecolor get backups -o custom-columns=name:.metadata.name,status:.status.conditions[-1].reason"
|
||||
alias kgp="kubecolor get pods -o custom-columns=name:.metadata.name,status:.status.phase"
|
||||
alias kgj="kubecolor get jobs -o custom-columns=name:.metadata.name,status:.status.conditions[0].type"
|
||||
alias kpf="kubecolor port-forward"
|
||||
alias kgsvc="kubecolor get service"
|
||||
|
||||
# get shell access to nextcloud pod in nextcloud namespace
|
||||
alias nextcloud_pod="kg pods -n nextcloud -l app.kubernetes.io/component=app,app.kubernetes.io/instance=nextcloud-web-app,app.kubernetes.io/name=nextcloud"
|
||||
alias ncsh='ke -n nextcloud $(nextcloud_pod) -- /bin/sh'
|
||||
|
||||
function kgall() {
|
||||
echo -e "\n─────────────────────────────────────────────────────────────────"
|
||||
echo -e " 🐋 Pods 🐋"
|
||||
echo -e "─────────────────────────────────────────────────────────────────\n"
|
||||
kubecolor get pods
|
||||
echo -e "\n─────────────────────────────────────────────────────────────────"
|
||||
echo -e " 💾 PVCS 💾"
|
||||
echo -e "─────────────────────────────────────────────────────────────────\n"
|
||||
kubecolor get pvc
|
||||
echo -e "\n─────────────────────────────────────────────────────────────────"
|
||||
echo -e " 🤫 Secrets 🤫"
|
||||
echo -e "─────────────────────────────────────────────────────────────────\n"
|
||||
kubecolor get secrets
|
||||
echo -e "\n─────────────────────────────────────────────────────────────────"
|
||||
echo -e " ⚙️ ConfigMaps ⚙️"
|
||||
echo -e "─────────────────────────────────────────────────────────────────\n"
|
||||
kubecolor get configmaps
|
||||
}
|
||||
|
||||
# alias a common typo
|
||||
alias gkall="kgall"
|
||||
|
||||
# print every k8s secret in plain text... very secure
|
||||
function kgcm() {
|
||||
BLUE='\033[1;34m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
if [ -z $@ ]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}kgcm CONFIGMAP_NAME${NC}\n\nDumps all the data fields for a given k8s ConfigMap in plain text\n"
|
||||
kubecolor get configmaps
|
||||
elif [[ $@ == "--help" ]]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}kgcm CONFIGMAP_NAME${NC}\n\nDumps all the data fields for a given k8s ConfigMap in plain text"
|
||||
kubecolor get configmaps
|
||||
else
|
||||
kubecolor get configmap $@ -o yaml | yq .data
|
||||
# the world isn't ready for this yet.
|
||||
#
|
||||
# input_cm=$@
|
||||
# counter=0
|
||||
# for config_data in `kg configmap $@ -o json | jq .data[]`; do
|
||||
# echo "counter is $counter"
|
||||
# parameter=`kg configmap $input_cm -o json | jq .data | jq 'keys' | jq -r .[$counter]`
|
||||
# echo "parameter is $parameter"
|
||||
# echo "input cm is $input_cm"
|
||||
|
||||
# if [[ "$parameter" == "null" ]]; then
|
||||
# break
|
||||
# elif [[ "$parameter" == *".json" ]]; then
|
||||
# echo -e "${BLUE}${parameter}${NC}:"
|
||||
# kg configmap $input_cm -o json | jq -r --arg PARAMETER "$parameter" '.data[] | select(env.parameter)'
|
||||
# echo "hi max"
|
||||
# elif [[ "$parameter" == *".yml" ]] || [[ "$parameter" == *".yaml" ]]; then
|
||||
# echo -en "${BLUE}${parameter}${NC}:\n"
|
||||
# kg configmap $@ -o yaml | yq .data | yq $parameter
|
||||
# elif [[ "$parameter" == *".cfg" ]] || [[ "$parameter" == *".conf" ]]; then
|
||||
# echo -en "${BLUE}${parameter}${NC}:\n"
|
||||
# kg configmap $@ -o json | jq .data | jq $parameter | bat -l cfg
|
||||
# else
|
||||
# value=`kg configmap $@ -o json | jq .data | jq $parameter`
|
||||
# echo -en "${BLUE}${parameter}${NC}: ${GREEN}$value${NC}\n"
|
||||
# fi
|
||||
# # tick up the counter
|
||||
# let counter++
|
||||
# done
|
||||
fi
|
||||
}
|
||||
|
||||
# print every k8s secret in plain text... very secure
|
||||
function kgsdump() {
|
||||
BLUE='\033[1;34m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
if [ -z $@ ]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}kgsdump SECRET${NC}\n\nDumps all the keys for a given k8s SECRET in plain text\n"
|
||||
kubecolor get secrets
|
||||
elif [[ $@ == "--help" ]]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}kgsdump SECRET${NC}\n\nDumps all the keys for a given k8s SECRET in plain text"
|
||||
kubecolor get secrets
|
||||
else
|
||||
counter=0
|
||||
# for every key in a secret, decode the base64 value and print it
|
||||
for secret in `kg secret $@ -o json | jq .data[]`; do
|
||||
key=`kg secret $@ -o json | jq .data | jq 'keys' | jq -r .[$counter]`
|
||||
value=`echo "$secret" | tr -d '"' | base64 --decode`
|
||||
|
||||
# pretty printing
|
||||
echo -en "${BLUE}${key}${NC}: ${GREEN}$value${NC}\n"
|
||||
|
||||
# tick up the counter
|
||||
let counter++
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
alias kgs="kgsdump"
|
||||
|
||||
# dump all secrets in your current namespace
|
||||
function kgsdumpall() {
|
||||
BLUE='\033[1;34m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
if [[ $@ == "--help" ]]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}ksgdumpall${NC}\n\nDump all the k8s secrets in the current namespace in plain text"
|
||||
else
|
||||
RES=$(kg secrets --no-headers=true | cut -d ' ' -f 1 | grep -v "tls")
|
||||
for secret in ${RES}; do
|
||||
kgsdump $secret
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# dump all tls secret manifests in the current namespace into files in current dir
|
||||
function kdumpcerts() {
|
||||
BLUE='\033[1;34m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
if [[ $@ == "--help" ]]; then
|
||||
echo -e " ${BLUE}Usage${NC}: ${GREEN}kdumpcerts [-n NAMESPACE]${NC}\n\nDump all the k8s TLS secrets in the current namespace to files in the current directory"
|
||||
elif [[ $1 == "-n" ]]; then
|
||||
namespace=$2
|
||||
echo -e "Dumping all certs for namespace ${GREEN}$namespace${NC} to files."
|
||||
kubectl get secrets -n $namespace | grep '\-tls' | awk '{print $1}' | xargs -I % sh -c "kubectl get secret -n $namespace -o yaml % > %.yaml"
|
||||
else
|
||||
echo "Dumping all certs for current namespace to files."
|
||||
kubectl get secrets | grep '\-tls' | awk '{print $1}' | xargs -I % sh -c 'kubectl get secret -o yaml % > %.yaml'
|
||||
fi
|
||||
}
|
||||
|
||||
alias kgscerts='kdumpcerts'
|
||||
|
||||
# force delete function
|
||||
function kfd() {
|
||||
kubecolor delete pod --grace-period=0 --force $1
|
||||
}
|
||||
|
||||
# set current namespace function
|
||||
function kns() {
|
||||
kubecolor config set-context $(kubecolor config current-context) --namespace=$1
|
||||
}
|
||||
|
||||
# use a new context
|
||||
function kc() {
|
||||
kubecolor config use-context $1
|
||||
}
|
||||
|
||||
# delete a crd by removing finalizers
|
||||
function kdcrd() {
|
||||
kubectl patch crd/$1 -p '{"metadata":{"finalizers":[]}}' --type=merge
|
||||
}
|
||||
|
||||
# help text for k commands
|
||||
function khelp {
|
||||
BLUE='\033[1;34m'
|
||||
GREEN='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
echo -e "${GREEN}k${NC} = ${BLUE}kubecolor${NC}";
|
||||
echo -e "${GREEN}ka${NC} = ${BLUE}k apply -f (applies a k8s yaml file to current cluster)${NC}";
|
||||
echo -e "${GREEN}kc${NC} = ${BLUE}k config use-context (switch to EXACT cluster name)${NC}";
|
||||
echo -e "${GREEN}kcc${NC} = ${BLUE}echoes current k8s cluster you're connecting to${NC}";
|
||||
echo -e "${GREEN}kd${NC} = ${BLUE}k describe${NC}";
|
||||
echo -e "${GREEN}kdcrd${NC} = ${BLUE}k delete crd${NC}";
|
||||
echo -e "${GREEN}kdn${NC} = ${BLUE}k describe nodes${NC}";
|
||||
echo -e "${GREEN}ke${NC} = ${BLUE}k exec -it${NC}";
|
||||
echo -e "${GREEN}kfd${NC} <pod-name> = ${BLUE}k force delete of pod${NC}";
|
||||
echo -e "${GREEN}kg${NC} = ${BLUE}k get${NC}";
|
||||
echo -e "${GREEN}kgall${NC} = ${BLUE}k get (pods, secrets, configmaps, PVCs)${NC}";
|
||||
echo -e "${GREEN}kgb${NC} = ${BLUE}k get backups${NC}";
|
||||
echo -e "${GREEN}kgcm${NC} = ${BLUE}k get configmaps${NC}";
|
||||
echo -e "${GREEN}kgi${NC} = ${BLUE}k get ingress${NC}";
|
||||
echo -e "${GREEN}kgj${NC} = ${BLUE}k get jobs with only name and status columns${NC}";
|
||||
echo -e "${GREEN}kgpgb${NC} = ${BLUE}k get backups.postgresql.cnpg.io${NC}";
|
||||
echo -e "${GREEN}kgp${NC} = ${BLUE}k get pods with only name and status columns${NC}";
|
||||
echo -e "${GREEN}kgs${NC} = ${BLUE}k get secrets${NC}";
|
||||
echo -e "${GREEN}kgsdump${NC} <secret> = ${BLUE}dump the contents of a secret in plain text${NC}";
|
||||
echo -e "${GREEN}kgsvc${NC} = ${BLUE}k get service${NC}";
|
||||
echo -e "${GREEN}kl${NC} = ${BLUE}k logs -f (follow logs for a pod)${NC}";
|
||||
echo -e "${GREEN}kns${NC} <namespace> = ${BLUE}switch current context to given namespace${NC}";
|
||||
echo -e "${GREEN}kpf${NC} <namespace> = ${BLUE}k port-forward${NC}";
|
||||
};
|
||||
|
||||
# helm shortcuts
|
||||
alias helmtmp='helm template . | bat -l yaml'
|
64
.config/bash/k8s_custom_complete.sh
Normal file
64
.config/bash/k8s_custom_complete.sh
Normal file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
# quick tab completion script for kubernetes commands in the current namespace
|
||||
# big thanks to this article: https://opensource.com/article/18/3/creating-bash-completion-script
|
||||
|
||||
# kubernetes secrets
|
||||
_kgsdump_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get secrets --no-headers -o custom-columns=Name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kgsdump_completions kgsdump
|
||||
complete -F _kgsdump_completions kgs
|
||||
|
||||
# kubernetes pods and logs for those pods
|
||||
_kgpod_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get pods --no-headers -o custom-columns=Name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kgpod_completions kgp
|
||||
complete -F _kgpod_completions kl
|
||||
complete -F _kgpod_completions ke
|
||||
complete -F _kgpod_completions kpf
|
||||
|
||||
# kubernetes ingress
|
||||
_kgi_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get ingress --no-headers -o custom-columns=Name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kgi_completions kgi
|
||||
|
||||
# kubernetes services
|
||||
_kgsvc_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get service --no-headers -o custom-columns=Name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kgsvc_completions kgsvc
|
||||
|
||||
# kubernetes configmaps
|
||||
_kgcm_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get configmap --no-headers -o custom-columns=name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kgcm_completions kgcm
|
||||
|
||||
|
||||
# kubernetes context
|
||||
_kc_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor config get-contexts -o name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kc_completions kc
|
||||
|
||||
# kubernetes crds
|
||||
_kdcrd_completions()
|
||||
{
|
||||
COMPREPLY=($(compgen -W "$(kubecolor get crds --no-headers -o custom-columns=name:.metadata.name)" -- "${COMP_WORDS[1]}"))
|
||||
}
|
||||
|
||||
complete -F _kdcrd_completions kdcrd
|
352
.config/bash/kubectl_completion.sh
Normal file
352
.config/bash/kubectl_completion.sh
Normal file
|
@ -0,0 +1,352 @@
|
|||
|
||||
# Copyright 2016 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# bash completion V2 for kubectl -*- shell-script -*-
|
||||
|
||||
__kubectl_debug()
|
||||
{
|
||||
if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
|
||||
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Macs have bash3 for which the bash-completion package doesn't include
|
||||
# _init_completion. This is a minimal version of that function.
|
||||
__kubectl_init_completion()
|
||||
{
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref "$@" cur prev words cword
|
||||
}
|
||||
|
||||
# This function calls the kubectl program to obtain the completion
|
||||
# results and the directive. It fills the 'out' and 'directive' vars.
|
||||
__kubectl_get_completion_results() {
|
||||
local requestComp lastParam lastChar args
|
||||
|
||||
# Prepare the command to request completions for the program.
|
||||
# Calling ${words[0]} instead of directly kubectl allows handling aliases
|
||||
args=("${words[@]:1}")
|
||||
requestComp="${words[0]} __complete ${args[*]}"
|
||||
|
||||
lastParam=${words[$((${#words[@]}-1))]}
|
||||
lastChar=${lastParam:$((${#lastParam}-1)):1}
|
||||
__kubectl_debug "lastParam ${lastParam}, lastChar ${lastChar}"
|
||||
|
||||
if [[ -z ${cur} && ${lastChar} != = ]]; then
|
||||
# If the last parameter is complete (there is a space following it)
|
||||
# We add an extra empty parameter so we can indicate this to the go method.
|
||||
__kubectl_debug "Adding extra empty parameter"
|
||||
requestComp="${requestComp} ''"
|
||||
fi
|
||||
|
||||
# When completing a flag with an = (e.g., kubectl -n=<TAB>)
|
||||
# bash focuses on the part after the =, so we need to remove
|
||||
# the flag part from $cur
|
||||
if [[ ${cur} == -*=* ]]; then
|
||||
cur="${cur#*=}"
|
||||
fi
|
||||
|
||||
__kubectl_debug "Calling ${requestComp}"
|
||||
# Use eval to handle any environment variables and such
|
||||
out=$(eval "${requestComp}" 2>/dev/null)
|
||||
|
||||
# Extract the directive integer at the very end of the output following a colon (:)
|
||||
directive=${out##*:}
|
||||
# Remove the directive
|
||||
out=${out%:*}
|
||||
if [[ ${directive} == "${out}" ]]; then
|
||||
# There is not directive specified
|
||||
directive=0
|
||||
fi
|
||||
__kubectl_debug "The completion directive is: ${directive}"
|
||||
__kubectl_debug "The completions are: ${out}"
|
||||
}
|
||||
|
||||
__kubectl_process_completion_results() {
|
||||
local shellCompDirectiveError=1
|
||||
local shellCompDirectiveNoSpace=2
|
||||
local shellCompDirectiveNoFileComp=4
|
||||
local shellCompDirectiveFilterFileExt=8
|
||||
local shellCompDirectiveFilterDirs=16
|
||||
local shellCompDirectiveKeepOrder=32
|
||||
|
||||
if (((directive & shellCompDirectiveError) != 0)); then
|
||||
# Error code. No completion.
|
||||
__kubectl_debug "Received error from custom completion go code"
|
||||
return
|
||||
else
|
||||
if (((directive & shellCompDirectiveNoSpace) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__kubectl_debug "Activating no space"
|
||||
compopt -o nospace
|
||||
else
|
||||
__kubectl_debug "No space directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveKeepOrder) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
# no sort isn't supported for bash less than < 4.4
|
||||
if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
|
||||
__kubectl_debug "No sort directive not supported in this version of bash"
|
||||
else
|
||||
__kubectl_debug "Activating keep order"
|
||||
compopt -o nosort
|
||||
fi
|
||||
else
|
||||
__kubectl_debug "No sort directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveNoFileComp) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__kubectl_debug "Activating no file completion"
|
||||
compopt +o default
|
||||
else
|
||||
__kubectl_debug "No file completion directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Separate activeHelp from normal completions
|
||||
local completions=()
|
||||
local activeHelp=()
|
||||
__kubectl_extract_activeHelp
|
||||
|
||||
if (((directive & shellCompDirectiveFilterFileExt) != 0)); then
|
||||
# File extension filtering
|
||||
local fullFilter filter filteringCmd
|
||||
|
||||
# Do not use quotes around the $completions variable or else newline
|
||||
# characters will be kept.
|
||||
for filter in ${completions[*]}; do
|
||||
fullFilter+="$filter|"
|
||||
done
|
||||
|
||||
filteringCmd="_filedir $fullFilter"
|
||||
__kubectl_debug "File filtering command: $filteringCmd"
|
||||
$filteringCmd
|
||||
elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
|
||||
# File completion for directories only
|
||||
|
||||
local subdir
|
||||
subdir=${completions[0]}
|
||||
if [[ -n $subdir ]]; then
|
||||
__kubectl_debug "Listing directories in $subdir"
|
||||
pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
|
||||
else
|
||||
__kubectl_debug "Listing directories in ."
|
||||
_filedir -d
|
||||
fi
|
||||
else
|
||||
__kubectl_handle_completion_types
|
||||
fi
|
||||
|
||||
__kubectl_handle_special_char "$cur" :
|
||||
__kubectl_handle_special_char "$cur" =
|
||||
|
||||
# Print the activeHelp statements before we finish
|
||||
if ((${#activeHelp[*]} != 0)); then
|
||||
printf "\n";
|
||||
printf "%s\n" "${activeHelp[@]}"
|
||||
printf "\n"
|
||||
|
||||
# The prompt format is only available from bash 4.4.
|
||||
# We test if it is available before using it.
|
||||
if (x=${PS1@P}) 2> /dev/null; then
|
||||
printf "%s" "${PS1@P}${COMP_LINE[@]}"
|
||||
else
|
||||
# Can't print the prompt. Just print the
|
||||
# text the user had typed, it is workable enough.
|
||||
printf "%s" "${COMP_LINE[@]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Separate activeHelp lines from real completions.
|
||||
# Fills the $activeHelp and $completions arrays.
|
||||
__kubectl_extract_activeHelp() {
|
||||
local activeHelpMarker="_activeHelp_ "
|
||||
local endIndex=${#activeHelpMarker}
|
||||
|
||||
while IFS='' read -r comp; do
|
||||
if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then
|
||||
comp=${comp:endIndex}
|
||||
__kubectl_debug "ActiveHelp found: $comp"
|
||||
if [[ -n $comp ]]; then
|
||||
activeHelp+=("$comp")
|
||||
fi
|
||||
else
|
||||
# Not an activeHelp line but a normal completion
|
||||
completions+=("$comp")
|
||||
fi
|
||||
done <<<"${out}"
|
||||
}
|
||||
|
||||
__kubectl_handle_completion_types() {
|
||||
__kubectl_debug "__kubectl_handle_completion_types: COMP_TYPE is $COMP_TYPE"
|
||||
|
||||
case $COMP_TYPE in
|
||||
37|42)
|
||||
# Type: menu-complete/menu-complete-backward and insert-completions
|
||||
# If the user requested inserting one completion at a time, or all
|
||||
# completions at once on the command-line we must remove the descriptions.
|
||||
# https://github.com/spf13/cobra/issues/1508
|
||||
local tab=$'\t' comp
|
||||
while IFS='' read -r comp; do
|
||||
[[ -z $comp ]] && continue
|
||||
# Strip any description
|
||||
comp=${comp%%$tab*}
|
||||
# Only consider the completions that match
|
||||
if [[ $comp == "$cur"* ]]; then
|
||||
COMPREPLY+=("$comp")
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
;;
|
||||
|
||||
*)
|
||||
# Type: complete (normal completion)
|
||||
__kubectl_handle_standard_completion_case
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__kubectl_handle_standard_completion_case() {
|
||||
local tab=$'\t' comp
|
||||
|
||||
# Short circuit to optimize if we don't have descriptions
|
||||
if [[ "${completions[*]}" != *$tab* ]]; then
|
||||
IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur")
|
||||
return 0
|
||||
fi
|
||||
|
||||
local longest=0
|
||||
local compline
|
||||
# Look for the longest completion so that we can format things nicely
|
||||
while IFS='' read -r compline; do
|
||||
[[ -z $compline ]] && continue
|
||||
# Strip any description before checking the length
|
||||
comp=${compline%%$tab*}
|
||||
# Only consider the completions that match
|
||||
[[ $comp == "$cur"* ]] || continue
|
||||
COMPREPLY+=("$compline")
|
||||
if ((${#comp}>longest)); then
|
||||
longest=${#comp}
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
|
||||
# If there is a single completion left, remove the description text
|
||||
if ((${#COMPREPLY[*]} == 1)); then
|
||||
__kubectl_debug "COMPREPLY[0]: ${COMPREPLY[0]}"
|
||||
comp="${COMPREPLY[0]%%$tab*}"
|
||||
__kubectl_debug "Removed description from single completion, which is now: ${comp}"
|
||||
COMPREPLY[0]=$comp
|
||||
else # Format the descriptions
|
||||
__kubectl_format_comp_descriptions $longest
|
||||
fi
|
||||
}
|
||||
|
||||
__kubectl_handle_special_char()
|
||||
{
|
||||
local comp="$1"
|
||||
local char=$2
|
||||
if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then
|
||||
local word=${comp%"${comp##*${char}}"}
|
||||
local idx=${#COMPREPLY[*]}
|
||||
while ((--idx >= 0)); do
|
||||
COMPREPLY[idx]=${COMPREPLY[idx]#"$word"}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
__kubectl_format_comp_descriptions()
|
||||
{
|
||||
local tab=$'\t'
|
||||
local comp desc maxdesclength
|
||||
local longest=$1
|
||||
|
||||
local i ci
|
||||
for ci in ${!COMPREPLY[*]}; do
|
||||
comp=${COMPREPLY[ci]}
|
||||
# Properly format the description string which follows a tab character if there is one
|
||||
if [[ "$comp" == *$tab* ]]; then
|
||||
__kubectl_debug "Original comp: $comp"
|
||||
desc=${comp#*$tab}
|
||||
comp=${comp%%$tab*}
|
||||
|
||||
# $COLUMNS stores the current shell width.
|
||||
# Remove an extra 4 because we add 2 spaces and 2 parentheses.
|
||||
maxdesclength=$(( COLUMNS - longest - 4 ))
|
||||
|
||||
# Make sure we can fit a description of at least 8 characters
|
||||
# if we are to align the descriptions.
|
||||
if ((maxdesclength > 8)); then
|
||||
# Add the proper number of spaces to align the descriptions
|
||||
for ((i = ${#comp} ; i < longest ; i++)); do
|
||||
comp+=" "
|
||||
done
|
||||
else
|
||||
# Don't pad the descriptions so we can fit more text after the completion
|
||||
maxdesclength=$(( COLUMNS - ${#comp} - 4 ))
|
||||
fi
|
||||
|
||||
# If there is enough space for any description text,
|
||||
# truncate the descriptions that are too long for the shell width
|
||||
if ((maxdesclength > 0)); then
|
||||
if ((${#desc} > maxdesclength)); then
|
||||
desc=${desc:0:$(( maxdesclength - 1 ))}
|
||||
desc+="…"
|
||||
fi
|
||||
comp+=" ($desc)"
|
||||
fi
|
||||
COMPREPLY[ci]=$comp
|
||||
__kubectl_debug "Final comp: $comp"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
__start_kubectl()
|
||||
{
|
||||
local cur prev words cword split
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
# Call _init_completion from the bash-completion package
|
||||
# to prepare the arguments properly
|
||||
if declare -F _init_completion >/dev/null 2>&1; then
|
||||
_init_completion -n =: || return
|
||||
else
|
||||
__kubectl_init_completion -n =: || return
|
||||
fi
|
||||
|
||||
__kubectl_debug
|
||||
__kubectl_debug "========= starting completion logic =========="
|
||||
__kubectl_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword"
|
||||
|
||||
# The user could have moved the cursor backwards on the command-line.
|
||||
# We need to trigger completion from the $cword location, so we need
|
||||
# to truncate the command-line ($words) up to the $cword location.
|
||||
words=("${words[@]:0:$cword+1}")
|
||||
__kubectl_debug "Truncated words[*]: ${words[*]},"
|
||||
|
||||
local out directive
|
||||
__kubectl_get_completion_results
|
||||
__kubectl_process_completion_results
|
||||
}
|
||||
|
||||
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
complete -o default -F __start_kubectl kubectl
|
||||
else
|
||||
complete -o default -o nospace -F __start_kubectl kubectl
|
||||
fi
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
390
.config/bash/lima_completion.sh
Normal file
390
.config/bash/lima_completion.sh
Normal file
|
@ -0,0 +1,390 @@
|
|||
# -------------------------------------------------------------------------- #
|
||||
# TAB COMPLETION #
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
# ~~~~~~~~~~~~~~~~ enable programmable completion features ~~~~~~~~~~~~~~~~~ #
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Terraform ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
complete -C /usr/local/bin/terraform terraform
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ macOS completion ~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
if [[ $(uname) == *"Darwin"* ]]; then
|
||||
|
||||
if [ $(uname -a | grep arm > /dev/null ; echo $?) -eq 0 ]; then
|
||||
# bash completion on macOS (arm64)
|
||||
if [ -f "/opt/homebrew/etc/profile.d/bash_completion.sh" ]; then
|
||||
. "/opt/homebrew/etc/profile.d/bash_completion.sh"
|
||||
fi
|
||||
complete -C /opt/homebrew/bin/terraform terraform
|
||||
else
|
||||
# bash completion on macOS (x86)
|
||||
if [ -f "/usr/local/etc/profile.d/bash_completion.sh" ]; then
|
||||
. "/usr/local/etc/profile.d/bash_completion.sh"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# This loads nvm (for node.js) bash_completion
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcloud ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# enables shell command completion for gcloud.
|
||||
if [ -f "$HOME/.local/bin/google-cloud-sdk/completion.bash.inc" ]; then
|
||||
. "$HOME/.local/bin/google-cloud-sdk/completion.bash.inc"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ jump ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# https://github.com/gsamokovarov/jump
|
||||
# remembers directories overtime and helps with auto-completion
|
||||
# I never use this though...
|
||||
# eval "$(jump shell bash)"
|
||||
|
||||
|
||||
|
||||
# bash completion V2 for limactl -*- shell-script -*-
|
||||
|
||||
__limactl_debug()
|
||||
{
|
||||
if [[ -n ${BASH_COMP_DEBUG_FILE-} ]]; then
|
||||
echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Macs have bash3 for which the bash-completion package doesn't include
|
||||
# _init_completion. This is a minimal version of that function.
|
||||
__limactl_init_completion()
|
||||
{
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref "$@" cur prev words cword
|
||||
}
|
||||
|
||||
# This function calls the limactl program to obtain the completion
|
||||
# results and the directive. It fills the 'out' and 'directive' vars.
|
||||
__limactl_get_completion_results() {
|
||||
local requestComp lastParam lastChar args
|
||||
|
||||
# Prepare the command to request completions for the program.
|
||||
# Calling ${words[0]} instead of directly limactl allows to handle aliases
|
||||
args=("${words[@]:1}")
|
||||
requestComp="${words[0]} __complete ${args[*]}"
|
||||
|
||||
lastParam=${words[$((${#words[@]}-1))]}
|
||||
lastChar=${lastParam:$((${#lastParam}-1)):1}
|
||||
__limactl_debug "lastParam ${lastParam}, lastChar ${lastChar}"
|
||||
|
||||
if [[ -z ${cur} && ${lastChar} != = ]]; then
|
||||
# If the last parameter is complete (there is a space following it)
|
||||
# We add an extra empty parameter so we can indicate this to the go method.
|
||||
__limactl_debug "Adding extra empty parameter"
|
||||
requestComp="${requestComp} ''"
|
||||
fi
|
||||
|
||||
# When completing a flag with an = (e.g., limactl -n=<TAB>)
|
||||
# bash focuses on the part after the =, so we need to remove
|
||||
# the flag part from $cur
|
||||
if [[ ${cur} == -*=* ]]; then
|
||||
cur="${cur#*=}"
|
||||
fi
|
||||
|
||||
__limactl_debug "Calling ${requestComp}"
|
||||
# Use eval to handle any environment variables and such
|
||||
out=$(eval "${requestComp}" 2>/dev/null)
|
||||
|
||||
# Extract the directive integer at the very end of the output following a colon (:)
|
||||
directive=${out##*:}
|
||||
# Remove the directive
|
||||
out=${out%:*}
|
||||
if [[ ${directive} == "${out}" ]]; then
|
||||
# There is not directive specified
|
||||
directive=0
|
||||
fi
|
||||
__limactl_debug "The completion directive is: ${directive}"
|
||||
__limactl_debug "The completions are: ${out}"
|
||||
}
|
||||
|
||||
__limactl_process_completion_results() {
|
||||
local shellCompDirectiveError=1
|
||||
local shellCompDirectiveNoSpace=2
|
||||
local shellCompDirectiveNoFileComp=4
|
||||
local shellCompDirectiveFilterFileExt=8
|
||||
local shellCompDirectiveFilterDirs=16
|
||||
local shellCompDirectiveKeepOrder=32
|
||||
|
||||
if (((directive & shellCompDirectiveError) != 0)); then
|
||||
# Error code. No completion.
|
||||
__limactl_debug "Received error from custom completion go code"
|
||||
return
|
||||
else
|
||||
if (((directive & shellCompDirectiveNoSpace) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__limactl_debug "Activating no space"
|
||||
compopt -o nospace
|
||||
else
|
||||
__limactl_debug "No space directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveKeepOrder) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
# no sort isn't supported for bash less than < 4.4
|
||||
if [[ ${BASH_VERSINFO[0]} -lt 4 || ( ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 4 ) ]]; then
|
||||
__limactl_debug "No sort directive not supported in this version of bash"
|
||||
else
|
||||
__limactl_debug "Activating keep order"
|
||||
compopt -o nosort
|
||||
fi
|
||||
else
|
||||
__limactl_debug "No sort directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
if (((directive & shellCompDirectiveNoFileComp) != 0)); then
|
||||
if [[ $(type -t compopt) == builtin ]]; then
|
||||
__limactl_debug "Activating no file completion"
|
||||
compopt +o default
|
||||
else
|
||||
__limactl_debug "No file completion directive not supported in this version of bash"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Separate activeHelp from normal completions
|
||||
local completions=()
|
||||
local activeHelp=()
|
||||
__limactl_extract_activeHelp
|
||||
|
||||
if (((directive & shellCompDirectiveFilterFileExt) != 0)); then
|
||||
# File extension filtering
|
||||
local fullFilter filter filteringCmd
|
||||
|
||||
# Do not use quotes around the $completions variable or else newline
|
||||
# characters will be kept.
|
||||
for filter in ${completions[*]}; do
|
||||
fullFilter+="$filter|"
|
||||
done
|
||||
|
||||
filteringCmd="_filedir $fullFilter"
|
||||
__limactl_debug "File filtering command: $filteringCmd"
|
||||
$filteringCmd
|
||||
elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
|
||||
# File completion for directories only
|
||||
|
||||
local subdir
|
||||
subdir=${completions[0]}
|
||||
if [[ -n $subdir ]]; then
|
||||
__limactl_debug "Listing directories in $subdir"
|
||||
pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
|
||||
else
|
||||
__limactl_debug "Listing directories in ."
|
||||
_filedir -d
|
||||
fi
|
||||
else
|
||||
__limactl_handle_completion_types
|
||||
fi
|
||||
|
||||
__limactl_handle_special_char "$cur" :
|
||||
__limactl_handle_special_char "$cur" =
|
||||
|
||||
# Print the activeHelp statements before we finish
|
||||
if ((${#activeHelp[*]} != 0)); then
|
||||
printf "\n";
|
||||
printf "%s\n" "${activeHelp[@]}"
|
||||
printf "\n"
|
||||
|
||||
# The prompt format is only available from bash 4.4.
|
||||
# We test if it is available before using it.
|
||||
if (x=${PS1@P}) 2> /dev/null; then
|
||||
printf "%s" "${PS1@P}${COMP_LINE[@]}"
|
||||
else
|
||||
# Can't print the prompt. Just print the
|
||||
# text the user had typed, it is workable enough.
|
||||
printf "%s" "${COMP_LINE[@]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Separate activeHelp lines from real completions.
|
||||
# Fills the $activeHelp and $completions arrays.
|
||||
__limactl_extract_activeHelp() {
|
||||
local activeHelpMarker="_activeHelp_ "
|
||||
local endIndex=${#activeHelpMarker}
|
||||
|
||||
while IFS='' read -r comp; do
|
||||
if [[ ${comp:0:endIndex} == $activeHelpMarker ]]; then
|
||||
comp=${comp:endIndex}
|
||||
__limactl_debug "ActiveHelp found: $comp"
|
||||
if [[ -n $comp ]]; then
|
||||
activeHelp+=("$comp")
|
||||
fi
|
||||
else
|
||||
# Not an activeHelp line but a normal completion
|
||||
completions+=("$comp")
|
||||
fi
|
||||
done <<<"${out}"
|
||||
}
|
||||
|
||||
__limactl_handle_completion_types() {
|
||||
__limactl_debug "__limactl_handle_completion_types: COMP_TYPE is $COMP_TYPE"
|
||||
|
||||
case $COMP_TYPE in
|
||||
37|42)
|
||||
# Type: menu-complete/menu-complete-backward and insert-completions
|
||||
# If the user requested inserting one completion at a time, or all
|
||||
# completions at once on the command-line we must remove the descriptions.
|
||||
# https://github.com/spf13/cobra/issues/1508
|
||||
local tab=$'\t' comp
|
||||
while IFS='' read -r comp; do
|
||||
[[ -z $comp ]] && continue
|
||||
# Strip any description
|
||||
comp=${comp%%$tab*}
|
||||
# Only consider the completions that match
|
||||
if [[ $comp == "$cur"* ]]; then
|
||||
COMPREPLY+=("$comp")
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
;;
|
||||
|
||||
*)
|
||||
# Type: complete (normal completion)
|
||||
__limactl_handle_standard_completion_case
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
__limactl_handle_standard_completion_case() {
|
||||
local tab=$'\t' comp
|
||||
|
||||
# Short circuit to optimize if we don't have descriptions
|
||||
if [[ "${completions[*]}" != *$tab* ]]; then
|
||||
IFS=$'\n' read -ra COMPREPLY -d '' < <(compgen -W "${completions[*]}" -- "$cur")
|
||||
return 0
|
||||
fi
|
||||
|
||||
local longest=0
|
||||
local compline
|
||||
# Look for the longest completion so that we can format things nicely
|
||||
while IFS='' read -r compline; do
|
||||
[[ -z $compline ]] && continue
|
||||
# Strip any description before checking the length
|
||||
comp=${compline%%$tab*}
|
||||
# Only consider the completions that match
|
||||
[[ $comp == "$cur"* ]] || continue
|
||||
COMPREPLY+=("$compline")
|
||||
if ((${#comp}>longest)); then
|
||||
longest=${#comp}
|
||||
fi
|
||||
done < <(printf "%s\n" "${completions[@]}")
|
||||
|
||||
# If there is a single completion left, remove the description text
|
||||
if ((${#COMPREPLY[*]} == 1)); then
|
||||
__limactl_debug "COMPREPLY[0]: ${COMPREPLY[0]}"
|
||||
comp="${COMPREPLY[0]%%$tab*}"
|
||||
__limactl_debug "Removed description from single completion, which is now: ${comp}"
|
||||
COMPREPLY[0]=$comp
|
||||
else # Format the descriptions
|
||||
__limactl_format_comp_descriptions $longest
|
||||
fi
|
||||
}
|
||||
|
||||
__limactl_handle_special_char()
|
||||
{
|
||||
local comp="$1"
|
||||
local char=$2
|
||||
if [[ "$comp" == *${char}* && "$COMP_WORDBREAKS" == *${char}* ]]; then
|
||||
local word=${comp%"${comp##*${char}}"}
|
||||
local idx=${#COMPREPLY[*]}
|
||||
while ((--idx >= 0)); do
|
||||
COMPREPLY[idx]=${COMPREPLY[idx]#"$word"}
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
__limactl_format_comp_descriptions()
|
||||
{
|
||||
local tab=$'\t'
|
||||
local comp desc maxdesclength
|
||||
local longest=$1
|
||||
|
||||
local i ci
|
||||
for ci in ${!COMPREPLY[*]}; do
|
||||
comp=${COMPREPLY[ci]}
|
||||
# Properly format the description string which follows a tab character if there is one
|
||||
if [[ "$comp" == *$tab* ]]; then
|
||||
__limactl_debug "Original comp: $comp"
|
||||
desc=${comp#*$tab}
|
||||
comp=${comp%%$tab*}
|
||||
|
||||
# $COLUMNS stores the current shell width.
|
||||
# Remove an extra 4 because we add 2 spaces and 2 parentheses.
|
||||
maxdesclength=$(( COLUMNS - longest - 4 ))
|
||||
|
||||
# Make sure we can fit a description of at least 8 characters
|
||||
# if we are to align the descriptions.
|
||||
if ((maxdesclength > 8)); then
|
||||
# Add the proper number of spaces to align the descriptions
|
||||
for ((i = ${#comp} ; i < longest ; i++)); do
|
||||
comp+=" "
|
||||
done
|
||||
else
|
||||
# Don't pad the descriptions so we can fit more text after the completion
|
||||
maxdesclength=$(( COLUMNS - ${#comp} - 4 ))
|
||||
fi
|
||||
|
||||
# If there is enough space for any description text,
|
||||
# truncate the descriptions that are too long for the shell width
|
||||
if ((maxdesclength > 0)); then
|
||||
if ((${#desc} > maxdesclength)); then
|
||||
desc=${desc:0:$(( maxdesclength - 1 ))}
|
||||
desc+="…"
|
||||
fi
|
||||
comp+=" ($desc)"
|
||||
fi
|
||||
COMPREPLY[ci]=$comp
|
||||
__limactl_debug "Final comp: $comp"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
__start_limactl()
|
||||
{
|
||||
local cur prev words cword split
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
# Call _init_completion from the bash-completion package
|
||||
# to prepare the arguments properly
|
||||
if declare -F _init_completion >/dev/null 2>&1; then
|
||||
_init_completion -n =: || return
|
||||
else
|
||||
__limactl_init_completion -n =: || return
|
||||
fi
|
||||
|
||||
__limactl_debug
|
||||
__limactl_debug "========= starting completion logic =========="
|
||||
__limactl_debug "cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${#words[@]}, cword is $cword"
|
||||
|
||||
# The user could have moved the cursor backwards on the command-line.
|
||||
# We need to trigger completion from the $cword location, so we need
|
||||
# to truncate the command-line ($words) up to the $cword location.
|
||||
words=("${words[@]:0:$cword+1}")
|
||||
__limactl_debug "Truncated words[*]: ${words[*]},"
|
||||
|
||||
local out directive
|
||||
__limactl_get_completion_results
|
||||
__limactl_process_completion_results
|
||||
}
|
||||
|
||||
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
complete -o default -F __start_limactl limactl
|
||||
else
|
||||
complete -o default -o nospace -F __start_limactl limactl
|
||||
fi
|
||||
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
60
.config/bash/minimal.sh
Normal file
60
.config/bash/minimal.sh
Normal file
|
@ -0,0 +1,60 @@
|
|||
# @jessebot's minimal browser focused rc file #
|
||||
##############################################################################
|
||||
|
||||
source ~/.config/bash/history.sh
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Pathing #
|
||||
# -------------------------------------------------------------------------- #
|
||||
# python version is subject to change
|
||||
export PYTHON_VERSION="3.12"
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Linux PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
if [[ $(uname) == *"Linux"* ]]; then
|
||||
|
||||
# iptables on debian is here
|
||||
export PATH=$PATH:/usr/sbin:/usr/share
|
||||
|
||||
# snap package manager installs commands here
|
||||
export PATH=$PATH:/snap/bin
|
||||
|
||||
# HomeBrew on Linux needs all of this to work
|
||||
export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
|
||||
export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
|
||||
export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
|
||||
export MANPATH=$MANPATH:/home/linuxbrew/.linuxbrew/share/man
|
||||
export INFOPATH=$INFOPATH:/home/linuxbrew/.linuxbrew/share/info
|
||||
export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin
|
||||
# pip packages installed via linuxbrew will be here
|
||||
pip_packages="/home/linuxbrew/.linuxbrew/lib/python$PYTHON_VERSION/site-packages"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ macOS PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# python default install location when you do: pip$PYTHON_VERSION install --user package
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
# this is for macs without apple silicon, e.g. before M1
|
||||
export PATH=$PATH:/usr/local/bin:$HOME/Library/Python/$PYTHON_VERSION/bin
|
||||
|
||||
if [[ $(uname) == *"Darwin"* ]]; then
|
||||
# don't warn me that BASH is deprecated, becasuse it is already upgraded
|
||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
# bash completion on macOS
|
||||
if [ -f "/usr/local/etc/profile.d/bash_completion.sh" ]; then
|
||||
# sources bash completion
|
||||
. "/usr/local/etc/profile.d/bash_completion.sh"
|
||||
fi
|
||||
|
||||
pip_path="lib/python$PYTHON_VERSION/site-packages"
|
||||
|
||||
# check if this apple silicon
|
||||
if [ $(uname -a | grep arm > /dev/null ; echo $?) -eq 0 ]; then
|
||||
# On M1/M2: brew default installs here
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
pip_packages="/opt/homebrew/$pip_path"
|
||||
else
|
||||
# For older macs before the M1, pre-2020
|
||||
pip_packages="/usr/local/$pip_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
source ~/.config/bash/text_editing.sh
|
137
.config/bash/path.sh
Normal file
137
.config/bash/path.sh
Normal file
|
@ -0,0 +1,137 @@
|
|||
# --------------------------------------------------------------------------
|
||||
# Pathing: Adhereing as closely as possible to XDG Base Directory Spec
|
||||
# https://specifications.freedesktop.org/basedir-spec/latest/
|
||||
# --------------------------------------------------------------------------
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ LinuxBrew PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
if [[ $(uname) == *"Linux"* ]]; then
|
||||
# iptables on debian is here
|
||||
export PATH=$PATH:/usr/sbin:/usr/share
|
||||
|
||||
# snap package manager installs commands here
|
||||
export PATH=$PATH:/snap/bin
|
||||
|
||||
# HomeBrew on Linux needs all of this to work
|
||||
export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
|
||||
export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
|
||||
export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
|
||||
export MANPATH=$MANPATH:/home/linuxbrew/.linuxbrew/share/man
|
||||
export INFOPATH=$INFOPATH:/home/linuxbrew/.linuxbrew/share/info
|
||||
export PATH=$PATH:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin
|
||||
|
||||
# pip packages with command line tools install here by default with apt installed python
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
|
||||
# make python do it's cache in ~/.cache/python
|
||||
export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python
|
||||
# not respected on Debian for some reason :shrug:
|
||||
# export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
||||
|
||||
# apt installed location of pip installed python3.x packages
|
||||
pip_packages="$HOME/.local/lib/python$PYTHON_VERSION/site-packages"
|
||||
#
|
||||
# pip packages installed via linuxbrew will be here (if python is installed via brew)
|
||||
# pip_packages="/home/linuxbrew/.linuxbrew/lib/python$PYTHON_VERSION/site-packages"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ macOS PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# powerline - a fancy extensible prompt: https://powerline.readthedocs.io
|
||||
if [[ $(uname) == *"Darwin"* ]]; then
|
||||
# don't warn me that BASH is deprecated, becasuse it is already upgraded
|
||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
|
||||
# make python do it's cache in ~/.cache/python
|
||||
export PYTHONPYCACHEPREFIX=$XDG_CACHE_HOME/python
|
||||
# put python data into $HOME/.local/share/python
|
||||
export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
||||
|
||||
# this is for python XDG spec stuff
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
|
||||
if [ $(uname -a | grep arm > /dev/null ; echo $?) -eq 0 ]; then
|
||||
# On apple silicon: brew default installs here
|
||||
export PATH=/opt/homebrew/bin:$PATH
|
||||
|
||||
# use linux/amd64 platform by default on macOS - may break KinD!
|
||||
# export DOCKER_DEFAULT_PLATFORM=linux/amd64
|
||||
|
||||
else
|
||||
if [ ! -f "/usr/local/bin/python" ]; then
|
||||
# this will link python3.11 to python which will fix poetry issues
|
||||
# ref: https://stackoverflow.com/a/74582011/3547184
|
||||
ln -s -f /usr/local/bin/python3.12 /usr/local/bin/python
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load GNU sed, called gsed, instead of MacOS's POSIX sed
|
||||
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH
|
||||
|
||||
pip_packages="$XDG_DATA_HOME/python/lib/python/site-packages"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# python default install location when you: pip$VERSION install --user package
|
||||
export PATH=$PATH:$HOME/.local/bin:/usr/local/bin
|
||||
|
||||
# Run py cmds in this file b4 the 1st prompt is displayed in interactive mode
|
||||
export PYTHONSTARTUP=$XDG_CONFIG_HOME/python/interactive_startup.py
|
||||
|
||||
# this is for python virtualenvs
|
||||
export PYENV_ROOT=$XDG_DATA_HOME/pyenv
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~ nvm/npm for javascript stuff ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# for npm to use XDG stuff
|
||||
export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
|
||||
# make sure we can run programs installed via npm
|
||||
export PATH=$PATH:$XDG_DATA_HOME/npm/bin
|
||||
|
||||
export NVM_DIR="$XDG_DATA_HOME"/nvm
|
||||
# TODO: loads nvm - maybe goes into devops build?
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ golang ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# to make it more XDG compliant
|
||||
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin:$HOME/.local/bin/go
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rust ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
export PATH="$XDG_DATA_HOME/cargo/bin:$PATH"
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pyenv ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
||||
if [ -d "$PYENV_ROOT" ]; then
|
||||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
|
||||
# Load pyenv-virtualenv automatically by adding
|
||||
# the following to ~/.bashrc:
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
fi
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ general ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
export DOCKER_CONFIG=$XDG_CONFIG_HOME/docker
|
||||
|
||||
# Make gradle use XDG
|
||||
export GRADLE_USER_HOME=$XDG_DATA_HOME/gradle
|
||||
|
||||
# make wget use XDG
|
||||
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
|
||||
|
||||
# make w3m use XDG
|
||||
export W3M_DIR="~/.local/state/w3m"
|
||||
|
||||
# add gcloud to path on macOS because they don't have a homebrew package
|
||||
export PATH=$PATH:$HOME/.local/bin/google-cloud-sdk/bin
|
||||
|
||||
# make sure we make all yamllint changes for safer linting
|
||||
export YAMLLINT_CONFIG_FILE="$XDG_CONFIG_HOME/yamllint/config.yml"
|
||||
|
||||
# linkerd - service mesh cli for k8s
|
||||
export PATH="$PATH:$HOME/.linkerd2/bin"
|
||||
|
94
.config/bash/text_editing.sh
Normal file
94
.config/bash/text_editing.sh
Normal file
|
@ -0,0 +1,94 @@
|
|||
# ------------------------------------------------------------------------- #
|
||||
# Text Editor
|
||||
# Default, in order of preference (subject to availability): nvim, vim, vi
|
||||
# ------------------------------------------------------------------------- #
|
||||
|
||||
# Default EDITOR is nvim
|
||||
if [ -n "$(which nvim)" ]; then
|
||||
export EDITOR=nvim
|
||||
# if nvim is not available, set EDITOR to vim
|
||||
else
|
||||
export EDITOR=vim
|
||||
fi
|
||||
|
||||
# always use nvim (or vim) instead of vi
|
||||
alias vi=$EDITOR
|
||||
# use nvim instead of vim when available
|
||||
alias vim=$EDITOR
|
||||
# I and many others always try to type neovim :)
|
||||
alias neovim=$EDITOR
|
||||
alias nivm=$EDITOR
|
||||
alias ivm=$EDITOR
|
||||
alias vmi=$EDITOR
|
||||
|
||||
# open vi, vim, or nvim to a specific line
|
||||
# example to open a file to line 255
|
||||
# lnvim /home/friend/somefile.py:255
|
||||
lnvim() {
|
||||
file=$(echo $1 |cut -f 1 -d ":")
|
||||
line=$(echo $1 | cut -f 2 -d ":")
|
||||
$EDITOR +$line $file
|
||||
}
|
||||
|
||||
# this is useful because I split a lot of files
|
||||
alias vsplit="$EDITOR -O"
|
||||
|
||||
# make all colors work by default, including via ssh!!
|
||||
unset TERM
|
||||
export TERM=xterm-256color
|
||||
export COLORTERM=truecolor
|
||||
|
||||
# -- This is for making some basic resizing working with various cli tools --
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------- #
|
||||
# TEXT VIEWING #
|
||||
# ------------------------------------------------------------------------- #
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# colors for less when displaying man pages
|
||||
export LESS_TERMCAP_mb=$'\e[1;32m'
|
||||
export LESS_TERMCAP_md=$'\e[1;32m'
|
||||
export LESS_TERMCAP_me=$'\e[0m'
|
||||
export LESS_TERMCAP_se=$'\e[0m'
|
||||
export LESS_TERMCAP_so=$'\e[01;33m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
export LESS_TERMCAP_us=$'\e[1;4;35m'
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
|
||||
# build current bat cache to index new themes or syntax
|
||||
# currently broken if a folder called cache exists in the directory where this runs
|
||||
# bat cache --build > /dev/null || batcat cache --build > /dev/null
|
||||
|
||||
# TODO:
|
||||
# - Write those docs with links to both apps (rich, and bat)
|
||||
# Take args:
|
||||
# -H, --head $NUMBER for head
|
||||
# -p for enabling pager
|
||||
# -t, --tail $NUMBER for tail
|
||||
#
|
||||
# Function to use the best syntax highlighting app for the job
|
||||
function dog {
|
||||
# if this is a csv file, ALWAYS use rich to print the data
|
||||
if [[ "$1" == *".csv" ]]; then
|
||||
rich "$1"
|
||||
# if this is a json file, always use jq to pretty print it
|
||||
elif [[ "$1" == *".json" ]]; then
|
||||
env cat "$1" | jq
|
||||
# if this is a YAML file, always use yq to pretty print and validate it
|
||||
# if using yq fails, fall back to bat & redirect errors to the shadow realm
|
||||
elif [[ "$1" == *".yaml" ]] || [[ "$1" == *".yml" ]]; then
|
||||
env cat "$1" | yq 2> /dev/null || bat --plain --theme=spacechalk --pager=never "$1"
|
||||
else
|
||||
# use batcat - syntax highlighting + git support
|
||||
bat --plain --theme=spacechalk --pager=never "$1" || batcat --pager=never --theme=spacechalk --plain "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
alias raw='env cat'
|
||||
alias cat='dog'
|
1252
.config/bash/yq_completion.sh
Normal file
1252
.config/bash/yq_completion.sh
Normal file
File diff suppressed because it is too large
Load diff
27
.config/bat/config
Normal file
27
.config/bat/config
Normal file
|
@ -0,0 +1,27 @@
|
|||
# This is `bat`s configuration file. Each line either contains a comment or
|
||||
# a command-line option that you want to pass to `bat` by default. You can
|
||||
# run `bat --help` to get a list of all possible configuration options.
|
||||
|
||||
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
|
||||
# for a list of all available themes
|
||||
--theme="spacechalk"
|
||||
|
||||
# Enable this to use italic text on the terminal. This is not supported on all
|
||||
# terminal emulators (like tmux, by default):
|
||||
--italic-text=always
|
||||
|
||||
# Uncomment the following line to disable automatic paging:
|
||||
--paging=never
|
||||
|
||||
# Uncomment the following line if you are using less version >= 551 and want to
|
||||
# enable mouse scrolling support in `bat` when running inside tmux. This might
|
||||
# disable text selection, unless you press shift.
|
||||
#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
|
||||
|
||||
# Syntax mappings: map a certain filename pattern to a language.
|
||||
# Example 1: use the C++ syntax for Arduino .ino files
|
||||
# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
|
||||
#--map-syntax "*.ino:C++"
|
||||
|
||||
# Map k8s helm Chart.lock to YAML syntax
|
||||
--map-syntax "Chart.lock:YAML"
|
517
.config/bat/themes/spacechalk/spacechalk.tmTheme
Normal file
517
.config/bat/themes/spacechalk/spacechalk.tmTheme
Normal file
|
@ -0,0 +1,517 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!--
|
||||
Repository: https://github.com/jessebot/dot_files
|
||||
License: AGPL: https://www.gnu.org/licenses/agpl-3.0.en.html#license-text
|
||||
Copyright (c) 2024-present Jesse Hitch <jessebot@linux.com>
|
||||
-->
|
||||
<key>name</key>
|
||||
<string>Spacechalk</string>
|
||||
<key>settings</key>
|
||||
<array>
|
||||
<!-- Global Settings -->
|
||||
<dict>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#232336</string>
|
||||
<key>foreground</key>
|
||||
<string>#bdd8ff</string>
|
||||
<key>invisibles</key>
|
||||
<string>#585858</string>
|
||||
<key>lineHighlight</key>
|
||||
<string>#5cc9fd</string>
|
||||
<key>selection</key>
|
||||
<string>#5cc9fd</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<!-- Scope Styles -->
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Comment</string>
|
||||
<key>scope</key>
|
||||
<string>comment, markup.strikethrough</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#6472b8</string>
|
||||
<key>background</key>
|
||||
<string>#212121</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>String</string>
|
||||
<key>scope</key>
|
||||
<string>string</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#a8fd57</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Number</string>
|
||||
<key>scope</key>
|
||||
<string>constant.numeric</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#bdd8ff</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Built-in constant</string>
|
||||
<key>scope</key>
|
||||
<string>constant.language</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#a8fd57</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>User-defined constant</string>
|
||||
<key>scope</key>
|
||||
<string>constant.character, constant.other</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#a8fd57</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Variable</string>
|
||||
<key>scope</key>
|
||||
<string>variable</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#5cc9fd</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Variable] parameter</string>
|
||||
<key>scope</key>
|
||||
<string>variable.parameter</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Keyword</string>
|
||||
<key>scope</key>
|
||||
<string>keyword</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#a3a8f8</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Keyword.Operator</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.operator</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#fdcd36</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Storage</string>
|
||||
<key>scope</key>
|
||||
<string>storage</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#fdcd36</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Storage type</string>
|
||||
<key>scope</key>
|
||||
<string>storage.type</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic</string>
|
||||
<key>foreground</key>
|
||||
<string>#fdcd36</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Class name</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>underline</string>
|
||||
<key>foreground</key>
|
||||
<string>#5f87ff</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Inherited class</string>
|
||||
<key>scope</key>
|
||||
<string>entity.other.inherited-class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic underline</string>
|
||||
<key>foreground</key>
|
||||
<string>#5f87ff</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Function name</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#7aa2f7</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Support] Function</string>
|
||||
<key>scope</key>
|
||||
<string>support.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f4adf4</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Function argument</string>
|
||||
<key>scope</key>
|
||||
<string>variable.parameter</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic</string>
|
||||
<key>foreground</key>
|
||||
<string>#f289f9</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Tag name</string>
|
||||
<key>scope</key>
|
||||
<string>entity.name.tag</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#a3a8f8</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Tag attribute</string>
|
||||
<key>scope</key>
|
||||
<string>entity.other.attribute-name</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#5f87ff</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Library function</string>
|
||||
<key>scope</key>
|
||||
<string>support.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Library constant</string>
|
||||
<key>scope</key>
|
||||
<string>support.constant</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Library class/type</string>
|
||||
<key>scope</key>
|
||||
<string>support.type, support.class</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Library variable</string>
|
||||
<key>scope</key>
|
||||
<string>support.other.variable</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Invalid</string>
|
||||
<key>scope</key>
|
||||
<string>invalid</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#fdcd36</string>
|
||||
<key>fontStyle</key>
|
||||
<string></string>
|
||||
<key>foreground</key>
|
||||
<string>#bdd8ff</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Invalid deprecated</string>
|
||||
<key>scope</key>
|
||||
<string>invalid.deprecated</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#fdcd36</string>
|
||||
<key>foreground</key>
|
||||
<string>#5cc9fd</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<!-- markdown -->
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Markdown][Meta] Separator</string>
|
||||
<key>scope</key>
|
||||
<string>meta.separator.markdown, punctuation.definition.thematic-break.markdown</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#6cb8e6</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Markdown] Link</string>
|
||||
<key>scope</key>
|
||||
<string>
|
||||
meta.link.reference.def.markdown,
|
||||
meta.link.inline.markdown
|
||||
</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#2569aa</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Markdown] Link Description</string>
|
||||
<key>scope</key>
|
||||
<string>
|
||||
text.html.markdown meta.link.inline.description.markdown,
|
||||
text.html.markdown meta.image.inline.description.markdown,
|
||||
text.html.markdown meta.link.reference.description.markdown,
|
||||
text.html.markdown constant.other.reference.link.markdown,
|
||||
text.html.markdown entity.name.reference.link.markdown
|
||||
</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#5cc9fd</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Markdown] Link Punctuation</string>
|
||||
<key>scope</key>
|
||||
<string>
|
||||
punctuation.definition.link.begin.markdown,
|
||||
punctuation.definition.link.end.markdown
|
||||
</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#d092fc</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>[Markdown] List Bullet</string>
|
||||
<key>scope</key>
|
||||
<string>
|
||||
text.html.markdown punctuation.definition.list_item.markdown,
|
||||
text.html.markdown markup.list.numbered.bullet.markdown
|
||||
</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f4adf4</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markup Tag Punctuation</string>
|
||||
<key>scope</key>
|
||||
<string>punctuation.definition.tag</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f4adf4</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Inline Code</string>
|
||||
<key>scope</key>
|
||||
<string>markup.raw.inline</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#fabd2f</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Heading 1</string>
|
||||
<key>scope</key>
|
||||
<string>
|
||||
markup.heading.1,
|
||||
meta.table.header.markdown-gfm
|
||||
</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic bold</string>
|
||||
<key>foreground</key>
|
||||
<string>#7aa2f7</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Heading 2</string>
|
||||
<key>scope</key>
|
||||
<string>markup.heading.2</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>bold</string>
|
||||
<key>foreground</key>
|
||||
<string>#7aa2f7</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<!-- default bat syntax is packaged from sublime and doesn't have syntax for heading 3, we'd have to add our own -->
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Heading 3</string>
|
||||
<key>scope</key>
|
||||
<string>markup.heading.3</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>italic</string>
|
||||
<key>foreground</key>
|
||||
<string>#7aa2f7</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<!-- default bat syntax is packaged from sublime and doesn't have syntax for heading 3, we'd have to add our own -->
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Heading 4</string>
|
||||
<key>scope</key>
|
||||
<string>markup.heading.4</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#7aa2f7</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<!-- markdown tables -->
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Table Cell</string>
|
||||
<key>scope</key>
|
||||
<string>meta.table.markdown-gfm</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#c0caf5</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Table Separator</string>
|
||||
<key>scope</key>
|
||||
<string>punctuation.separator.table-cell.markdown</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>fontStyle</key>
|
||||
<string>bold</string>
|
||||
<key>foreground</key>
|
||||
<string>#f289f9</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Markdown Table HEADER Separator line</string>
|
||||
<key>scope</key>
|
||||
<string>meta.table.header-separator.markdown-gfm</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>D8D5E82E-3D5B-46B5-B38A-777777777777</string>
|
||||
<key>colorSpaceName</key>
|
||||
<string>sRGB</string>
|
||||
<key>semanticClass</key>
|
||||
<string>theme.dark.spacechalk</string>
|
||||
</dict>
|
||||
</plist>
|
48
.config/cron/README.md
Normal file
48
.config/cron/README.md
Normal file
|
@ -0,0 +1,48 @@
|
|||
# ⏰ Cron jobs
|
||||
|
||||
### file structure
|
||||
|
||||
```
|
||||
.
|
||||
├── README.md
|
||||
├── root
|
||||
└── user
|
||||
```
|
||||
|
||||
## root (super user) cron jobs
|
||||
|
||||
```
|
||||
.
|
||||
├── README.md
|
||||
└── root
|
||||
├── crontab
|
||||
└── daily.sh
|
||||
```
|
||||
|
||||
Anything in `root/daily.sh` gets run by `root` every day.
|
||||
- Currently, this just runs `apt-get update/upgrade` as root to avoid sudo passwords.
|
||||
|
||||
`root/crontab` is the file that is copied into `/var/at/tabs` on macOS and `/etc/crontab.d/` on Linux.
|
||||
|
||||
## User cron jobs
|
||||
|
||||
```
|
||||
.
|
||||
└── user
|
||||
├── crontab
|
||||
├── daily.sh
|
||||
├── go_home.sh
|
||||
├── lunch.sh
|
||||
└── self_care_time.sh
|
||||
```
|
||||
|
||||
The "user" is the user that ran last ran `onboardme`. All scripts below will run as that user.
|
||||
|
||||
`user/lunch.sh` gets run at lunch time (noon) by the user, for reminders.
|
||||
`user/daily.sh` gets run daily by the user right after lunch reminders.
|
||||
- Currently, this runs `onboardme` for updating dot files, OS packages (brew, pip3.12, pipx), and neovim packages.
|
||||
- also updates `tldr`
|
||||
`user/go_home.sh` gets run at at 17:10 to remind the user to go home.
|
||||
`user/self_care_time.sh` gets run at at 22:30 to remind the user to do self care tasks.
|
||||
|
||||
`user/crontab` is the file that is copied into `/var/at/tabs` on macOS and `/etc/crontab.d/` on Linux.
|
91
.config/cron/alarms.sh
Executable file
91
.config/cron/alarms.sh
Executable file
|
@ -0,0 +1,91 @@
|
|||
#!/usr/bin/env bash
|
||||
# Simple script by JesseBot@linux to remind you to stop working
|
||||
ALARM_TYPE=$1
|
||||
SILENCE=$2
|
||||
|
||||
case $ALARM_TYPE in
|
||||
work_start_soon)
|
||||
banner_msg="Work Starts Soon"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "It's almost time to start work. Save your place and make some" \
|
||||
"follow up notes." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
work_start)
|
||||
banner_msg="Go To Work"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "It's time to start working. Open your work laptop, and clock" \
|
||||
"in: Fill in timesheet, say good morning in chat, check emails," \
|
||||
"and open important tickets." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
lunch)
|
||||
banner_msg="Take your Lunch!"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "It's time to take lunch! Go have a protein shake and or a" \
|
||||
"salad, or order something healthy to snack on during your" \
|
||||
"break, and use the time to do something for yourself" \
|
||||
":3" >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
lunch_end_soon)
|
||||
banner_msg="Lunch Hour Ends Soon."
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "Your lunch hour ends soon, so you should save what you're" \
|
||||
"doing, and make a note to follow up on any" \
|
||||
"loose ends." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
lunch_end)
|
||||
banner_msg="Lunch is over."
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "Lunch has ended. Report back to work now." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
break)
|
||||
banner_msg="Take a 5 minute break."
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "Take a 5 minute break. Get some water or green tea and perhaps" \
|
||||
"a small snack, a smackoroo, if you will." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
work_end_soon)
|
||||
banner_msg="Working Hours End Soon"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "It's almost time to stop working. Find a stopping place." \
|
||||
"Update your tickets. Save any important open tabs to your" \
|
||||
"bookmarks. Send that last email or message." >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
work_end)
|
||||
banner_msg="Working Hours Complete"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "It's time to STOP WORK! Close all programs, except your time" \
|
||||
"sheet. Fill in your timesheet, and sign off. Close your work" \
|
||||
"laptop 🎉 " >> /tmp/wall_notice
|
||||
;;
|
||||
|
||||
work_end_serious)
|
||||
banner_msg="Stop Working!!"
|
||||
figlet -c -f banner $banner_msg > /tmp/wall_notice
|
||||
echo "Over time is not worth it. You have a life outside of work." \
|
||||
"Seriously, do something else. You're more than the" \
|
||||
"productivity you give your job. Take that back for" \
|
||||
"yourself. Make or order dinner. Hang out with your friends." \
|
||||
"Do some personal hobby. Be more than work." >> /tmp/wall_notice
|
||||
;;
|
||||
esac
|
||||
|
||||
# print the text in all logged in, terminals
|
||||
wall /tmp/wall_notice
|
||||
|
||||
# If on Mac use the say program to speak the notice outloud.
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
# if they set a second variable then silence the alarm
|
||||
if [ ! -z "$SILENCE" ]; then
|
||||
say -f /tmp/wall_notice
|
||||
# if they have this file in thier home directory, also silence the alarm
|
||||
elif [ ! -e "$HOME/.alarm_silence" ]; then
|
||||
say -f /tmp/wall_notice
|
||||
fi
|
||||
fi
|
18
.config/cron/reminders_crontab
Normal file
18
.config/cron/reminders_crontab
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Start working for the day soon
|
||||
0 8 * * * ~/cron/alarms.sh work_start_soon
|
||||
# Work has begun! at 9:00
|
||||
0 9 * * * ~/cron/alarms.sh work_start
|
||||
# Lunch at noon each day
|
||||
0 12 * * * ~/cron/alarms.sh lunch
|
||||
# Reminding that lunch ends soon
|
||||
45 12 * * * ~/cron/alarms.sh lunch_end_soon
|
||||
# Lunch over at 13:00
|
||||
0 13 * * * ~/cron/alarms.sh lunch_end
|
||||
# Short Break at 14:00
|
||||
0 14 * * * ~/cron/alarms.sh break
|
||||
# Stop working for the day 17:55
|
||||
55 17 * * * ~/cron/alarms.sh work_end_soon
|
||||
# Stop working for the day 18:15
|
||||
15 18 * * * ~/cron/alarms.sh work_end
|
||||
# Remind user to hang out with their friends 19:00
|
||||
00 19 * * * ~/cron/alarms.sh work_end_serious
|
1
.config/cron/root/crontab
Normal file
1
.config/cron/root/crontab
Normal file
|
@ -0,0 +1 @@
|
|||
0 12 * * * ~/.config/cron/root/daily.sh
|
5
.config/cron/root/daily.sh
Executable file
5
.config/cron/root/daily.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
echo "apt upgrades start at:"
|
||||
date
|
||||
time apt-get update && time apt-get upgrade -y
|
||||
echo "apt upgrades complete at:"
|
||||
date
|
4
.config/cron/user/crontab
Normal file
4
.config/cron/user/crontab
Normal file
|
@ -0,0 +1,4 @@
|
|||
0 12 * * * ~/.config/cron/user/lunch.sh
|
||||
30 12 * * * ~/.config/cron/user/daily.sh
|
||||
10 17 * * * ~/.config/cron/user/go_home.sh
|
||||
30 20 * * * ~/.config/cron/user/self_care_time.sh
|
5
.config/cron/user/daily.sh
Executable file
5
.config/cron/user/daily.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
# update dot files, package managers, and neovim
|
||||
onboardme -s dot_files -s packages -s neovim_setup -p brew -p pipx -p pip3.12
|
||||
|
||||
# update tldr
|
||||
tldr --update
|
1
.config/cron/user/go_home.sh
Executable file
1
.config/cron/user/go_home.sh
Executable file
|
@ -0,0 +1 @@
|
|||
say "Time to wrap up and go shopping for dinner!"
|
1
.config/cron/user/lunch.sh
Executable file
1
.config/cron/user/lunch.sh
Executable file
|
@ -0,0 +1 @@
|
|||
say "Perhaps it's time for a bit of a break. Maybe get a snack."
|
1
.config/cron/user/self_care_time.sh
Executable file
1
.config/cron/user/self_care_time.sh
Executable file
|
@ -0,0 +1 @@
|
|||
say "time to do a self care task. You can brush your teath, do your facial care routine, tend to your hands and feet, and change into jammies."
|
43
.config/fastfetch/config.jsonc
Normal file
43
.config/fastfetch/config.jsonc
Normal file
|
@ -0,0 +1,43 @@
|
|||
// ~/.config/fastfetch/config.jsonc
|
||||
// See https://github.com/fastfetch-cli/fastfetch/wiki/Configuration for more details
|
||||
// See *.jsonc in https://github.com/fastfetch-cli/fastfetch/tree/dev/presets/examples for more examples
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"width": 22,
|
||||
"height": 14,
|
||||
"type": "sixel",
|
||||
"source": "dogontheinternet.png",
|
||||
"padding": {"top": 1,
|
||||
"left": 1,
|
||||
"right": 1}
|
||||
},
|
||||
"display": {
|
||||
"percent": {
|
||||
"Type": 9
|
||||
}, // colored percent number
|
||||
"color": {
|
||||
"keys": "magenta",
|
||||
"title": "bright_blue"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"break",
|
||||
"break",
|
||||
"title",
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"uptime",
|
||||
"packages",
|
||||
"theme",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"memory",
|
||||
"disk",
|
||||
"battery",
|
||||
"break",
|
||||
"colors",
|
||||
"break"
|
||||
]
|
||||
}
|
16
.config/gh/config.yml
Normal file
16
.config/gh/config.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
# What protocol to use when performing git operations. Supported values: ssh, https
|
||||
git_protocol: ssh
|
||||
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
|
||||
editor: nvim
|
||||
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
|
||||
prompt: enabled
|
||||
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
|
||||
pager: "rich -"
|
||||
# Aliases allow you to create nicknames for gh commands
|
||||
aliases:
|
||||
co: pr checkout
|
||||
# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
|
||||
http_unix_socket:
|
||||
# What web browser gh should use when opening URLs. If blank, will refer to environment.
|
||||
browser: w3m
|
||||
version: "1"
|
70
.config/git/config
Normal file
70
.config/git/config
Normal file
|
@ -0,0 +1,70 @@
|
|||
# set better default colors
|
||||
[color]
|
||||
ui = auto
|
||||
[color "branch"]
|
||||
current = green bold
|
||||
local = green dim
|
||||
remote = blue
|
||||
[color "diff"]
|
||||
meta = yellow bold
|
||||
frag = magenta ul
|
||||
old = magenta bold
|
||||
new = green bold
|
||||
[color "status"]
|
||||
added = green
|
||||
changed = yellow
|
||||
untracked = magenta
|
||||
|
||||
# set the default branch to main
|
||||
[init]
|
||||
defaultBranch = main
|
||||
|
||||
# always push up local branches to the remote origin
|
||||
[push]
|
||||
autoSetupRemote = true
|
||||
default = current
|
||||
|
||||
# default rebase commits to avoid merge issues
|
||||
[pull]
|
||||
rebase = true
|
||||
|
||||
# personal stuff like gpg config, username, etc
|
||||
[includeIf "gitdir:~/"]
|
||||
path = ~/.config/git/personal
|
||||
|
||||
# aliases, mostly fixing typos
|
||||
[alias]
|
||||
root = rev-parse --show-toplevel
|
||||
ad = add
|
||||
addd = add
|
||||
banch = branch
|
||||
brnach = branch
|
||||
rbanch = branch
|
||||
cm = commit
|
||||
cmmit = commit
|
||||
commmit = commit
|
||||
commti = commit
|
||||
comit = commit
|
||||
ocmmit = commit
|
||||
co = checkout
|
||||
checkotu = checkout
|
||||
hceckout = checkout
|
||||
chckout = checkout
|
||||
ceckout = checkout
|
||||
chekout = checkout
|
||||
checout = checkout
|
||||
checkut = checkout
|
||||
checkuot = checkout
|
||||
chekcout = checkout
|
||||
cehckout = checkout
|
||||
chckeout = checkout
|
||||
checkcout = checkout
|
||||
idff = diff
|
||||
psuh = push
|
||||
puhs = push
|
||||
[gpg]
|
||||
format = ssh
|
||||
[user]
|
||||
signingkey = ~/.ssh/id_rsa.pub
|
||||
[commit]
|
||||
gpgsign = true
|
23
.config/gitui/theme.ron
Normal file
23
.config/gitui/theme.ron
Normal file
|
@ -0,0 +1,23 @@
|
|||
(
|
||||
selected_tab: Cyan,
|
||||
command_fg: Black,
|
||||
selection_bg: Blue,
|
||||
selection_fg: DarkGray,
|
||||
cmdbar_bg: Blue,
|
||||
cmdbar_extra_lines_bg: Blue,
|
||||
disabled_fg: Gray,
|
||||
diff_line_add: Green,
|
||||
diff_line_delete: Red,
|
||||
diff_file_added: LightGreen,
|
||||
diff_file_removed: LightRed,
|
||||
diff_file_moved: LightMagenta,
|
||||
diff_file_modified: Yellow,
|
||||
commit_hash: Magenta,
|
||||
commit_time: LightCyan,
|
||||
commit_author: Green,
|
||||
danger_fg: Red,
|
||||
push_gauge_bg: Blue,
|
||||
push_gauge_fg: Reset,
|
||||
tag_fg: LightMagenta,
|
||||
branch_fg: LightYellow,
|
||||
)
|
21
.config/glab-cli/config.yml
Normal file
21
.config/glab-cli/config.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
# What protocol to use when performing git operations. Supported values: ssh, https
|
||||
git_protocol: ssh
|
||||
# What editor glab should run when creating issues, merge requests, etc. This is a global config that cannot be overridden by hostname.
|
||||
editor: nvim
|
||||
# What browser glab should run when opening links. This is a global config that cannot be overridden by hostname.
|
||||
browser: firefox
|
||||
# Set your desired markdown renderer style. Available options are [dark, light, notty] or set a custom style. Refer to https://github.com/charmbracelet/glamour#styles
|
||||
glamour_style: dark
|
||||
# Allow glab to automatically check for updates and notify you when there are new updates
|
||||
check_update: false
|
||||
# Whether or not to display hyperlink escapes when listing things like issues or MRs
|
||||
display_hyperlinks: true
|
||||
# configuration specific for gitlab instances
|
||||
hosts:
|
||||
gitlab.com:
|
||||
# What protocol to use to access the api endpoint. Supported values: http, https
|
||||
api_protocol: https
|
||||
# Configure host for api endpoint, defaults to the host itself
|
||||
api_host: gitlab.com
|
||||
# Your GitLab access token. Get an access token at https://gitlab.com/-/profile/personal_access_tokens
|
||||
token:
|
42
.config/k9s/config.yaml
Normal file
42
.config/k9s/config.yaml
Normal file
|
@ -0,0 +1,42 @@
|
|||
k9s:
|
||||
liveViewAutoRefresh: false
|
||||
screenDumpDir: cache/.local/state/k9s/screen-dumps
|
||||
refreshRate: 2
|
||||
maxConnRetry: 5
|
||||
readOnly: false
|
||||
noExitOnCtrlC: false
|
||||
ui:
|
||||
enableMouse: false
|
||||
headless: false
|
||||
logoless: false
|
||||
crumbsless: false
|
||||
reactive: false
|
||||
noIcons: false
|
||||
defaultsToFullScreen: false
|
||||
skin: space_chalk
|
||||
skipLatestRevCheck: false
|
||||
disablePodCounting: false
|
||||
shellPod:
|
||||
image: busybox:1.35.0
|
||||
namespace: default
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
imageScans:
|
||||
enable: false
|
||||
exclusions:
|
||||
namespaces: []
|
||||
labels: {}
|
||||
logger:
|
||||
tail: 100
|
||||
buffer: 5000
|
||||
sinceSeconds: -1
|
||||
textWrap: false
|
||||
showTime: false
|
||||
thresholds:
|
||||
cpu:
|
||||
critical: 90
|
||||
warn: 70
|
||||
memory:
|
||||
critical: 90
|
||||
warn: 70
|
115
.config/k9s/skins/space_chalk.yaml
Normal file
115
.config/k9s/skins/space_chalk.yaml
Normal file
|
@ -0,0 +1,115 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
# Dracula skin repurposed to be a spacechalky skin, slowly
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# Styles...
|
||||
foreground: &foreground "#bdd8ff"
|
||||
background: &background "#232226"
|
||||
current_line: ¤t_line "#44475a"
|
||||
selection: &selection "#44475a"
|
||||
comment: &comment "#6272a4"
|
||||
cornflower: &cornflower "#7aa2f7"
|
||||
green: &green "#C1FF87"
|
||||
orange: &orange "#ffb86c"
|
||||
pink: &pink "#f289f9"
|
||||
purple: &purple "#bd93f9"
|
||||
red: &red "#f2748a"
|
||||
yellow: &yellow "#f1fa8c"
|
||||
|
||||
# Skin...
|
||||
k9s:
|
||||
# General K9s styles
|
||||
body:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
logoColor: *green
|
||||
# Command prompt styles
|
||||
prompt:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
suggestColor: *purple
|
||||
# ClusterInfoView styles.
|
||||
info:
|
||||
fgColor: *pink
|
||||
sectionColor: *comment
|
||||
# Dialog styles.
|
||||
dialog:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
buttonFgColor: *foreground
|
||||
buttonBgColor: *purple
|
||||
buttonFocusFgColor: *yellow
|
||||
buttonFocusBgColor: *pink
|
||||
labelFgColor: *orange
|
||||
fieldFgColor: *foreground
|
||||
frame:
|
||||
# Borders styles.
|
||||
border:
|
||||
fgColor: *selection
|
||||
focusColor: *current_line
|
||||
menu:
|
||||
fgColor: *foreground
|
||||
keyColor: *pink
|
||||
# Used for favorite namespaces
|
||||
numKeyColor: *pink
|
||||
# CrumbView attributes for history navigation.
|
||||
crumbs:
|
||||
fgColor: *foreground
|
||||
bgColor: *current_line
|
||||
activeColor: *current_line
|
||||
# Resource status and update styles
|
||||
status:
|
||||
newColor: *cornflower
|
||||
modifyColor: *purple
|
||||
addColor: *green
|
||||
errorColor: *red
|
||||
highlightColor: *orange
|
||||
killColor: *comment
|
||||
completedColor: *comment
|
||||
# Border title styles.
|
||||
title:
|
||||
fgColor: *foreground
|
||||
bgColor: *current_line
|
||||
highlightColor: *orange
|
||||
counterColor: *purple
|
||||
filterColor: *pink
|
||||
views:
|
||||
# Charts skins...
|
||||
charts:
|
||||
bgColor: default
|
||||
defaultDialColors:
|
||||
- *purple
|
||||
- *red
|
||||
defaultChartColors:
|
||||
- *purple
|
||||
- *red
|
||||
# TableView attributes.
|
||||
table:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
# Header row styles.
|
||||
header:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
sorterColor: *cornflower
|
||||
# Xray view attributes.
|
||||
xray:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
cursorColor: *current_line
|
||||
graphicColor: *purple
|
||||
showIcons: false
|
||||
# YAML info styles.
|
||||
yaml:
|
||||
keyColor: *pink
|
||||
colonColor: *purple
|
||||
valueColor: *foreground
|
||||
# Logs styles.
|
||||
logs:
|
||||
fgColor: *foreground
|
||||
bgColor: *background
|
||||
indicator:
|
||||
fgColor: *foreground
|
||||
bgColor: *purple
|
||||
toggleOnColor: *green
|
||||
toggleOffColor: *cornflower
|
38
.config/lsd/colors.yaml
Normal file
38
.config/lsd/colors.yaml
Normal file
|
@ -0,0 +1,38 @@
|
|||
user: 230
|
||||
group: 187
|
||||
permission:
|
||||
read: dark_green
|
||||
write: dark_yellow
|
||||
exec: dark_red
|
||||
exec-sticky: 5
|
||||
no-access: 245
|
||||
octal: 6
|
||||
acl: dark_cyan
|
||||
context: cyan
|
||||
date:
|
||||
hour-old: 40
|
||||
day-old: 42
|
||||
older: 36
|
||||
size:
|
||||
none: 245
|
||||
small: 229
|
||||
medium: 216
|
||||
large: 172
|
||||
inode:
|
||||
valid: 13
|
||||
invalid: 245
|
||||
links:
|
||||
valid: 13
|
||||
invalid: 245
|
||||
tree-edge: 245
|
||||
git-status:
|
||||
default: 245
|
||||
unmodified: 245
|
||||
ignored: 245
|
||||
new-in-index: dark_green
|
||||
new-in-workdir: dark_green
|
||||
typechange: dark_yellow
|
||||
deleted: dark_red
|
||||
renamed: dark_green
|
||||
modified: dark_yellow
|
||||
conflicted: dark_red
|
136
.config/lsd/config.yaml
Normal file
136
.config/lsd/config.yaml
Normal file
|
@ -0,0 +1,136 @@
|
|||
# == Classic ==
|
||||
# This is a shorthand to override some of the options to be backwards compatible
|
||||
# with `ls`. It affects the "color"->"when", "sorting"->"dir-grouping", "date"
|
||||
# and "icons"->"when" options.
|
||||
# Possible values: false, true
|
||||
classic: false
|
||||
|
||||
# == Blocks ==
|
||||
# This specifies the columns and their order when using the long and the tree
|
||||
# layout.
|
||||
# Possible values: permission, user, group, size, size_value, date, name, inode
|
||||
blocks:
|
||||
- permission
|
||||
- user
|
||||
- group
|
||||
- size
|
||||
- date
|
||||
- name
|
||||
|
||||
# == Color ==
|
||||
# This has various color options. (Will be expanded in the future.)
|
||||
color:
|
||||
# When to colorize the output.
|
||||
# When "classic" is set, this is set to "never".
|
||||
# Possible values: never, auto, always
|
||||
when: auto
|
||||
# How to colorize the output.
|
||||
# When "classic" is set, this is set to "no-color".
|
||||
# Possible values: default, <theme-file-name>
|
||||
# when specifying <theme-file-name>, lsd will look up theme file
|
||||
# XDG Base Directory if relative, e.g. ~/.config/lsd/themes/<theme-file-name>.yaml,
|
||||
# The file path if absolute
|
||||
theme: custom
|
||||
|
||||
# == Date ==
|
||||
# This specifies the date format for the date column. The freeform format
|
||||
# accepts an strftime like string.
|
||||
# When "classic" is set, this is set to "date".
|
||||
# Possible values: date, relative, '+<date_format>'
|
||||
# `date_format` will be a `strftime` formatted value. e.g. `date: '+%d %b %y %X'` will give you a date like this: 17 Jun 21 20:14:55
|
||||
date: date
|
||||
|
||||
# == Dereference ==
|
||||
# Whether to dereference symbolic links.
|
||||
# Possible values: false, true
|
||||
dereference: false
|
||||
|
||||
# == Display ==
|
||||
# What items to display. Do not specify this for the default behavior.
|
||||
# Possible values: all, almost-all, directory-only
|
||||
# display: all
|
||||
|
||||
# == Icons ==
|
||||
icons:
|
||||
# When to use icons.
|
||||
# When "classic" is set, this is set to "never".
|
||||
# Possible values: always, auto, never
|
||||
when: auto
|
||||
# Which icon theme to use.
|
||||
# Possible values: fancy, unicode
|
||||
theme: fancy
|
||||
# Separator between icon and the name
|
||||
# Default to 1 space
|
||||
separator: " "
|
||||
|
||||
# == Ignore Globs ==
|
||||
# A list of globs to ignore when listing.
|
||||
# ignore-globs:
|
||||
# - .git
|
||||
|
||||
# == Indicators ==
|
||||
# Whether to add indicator characters to certain listed files.
|
||||
# Possible values: false, true
|
||||
indicators: false
|
||||
|
||||
# == Layout ==
|
||||
# Which layout to use. "oneline" might be a bit confusing here and should be
|
||||
# called "one-per-line". It might be changed in the future.
|
||||
# Possible values: grid, tree, oneline
|
||||
layout: grid
|
||||
|
||||
# == Recursion ==
|
||||
recursion:
|
||||
# Whether to enable recursion.
|
||||
# Possible values: false, true
|
||||
enabled: false
|
||||
# How deep the recursion should go. This has to be a positive integer. Leave
|
||||
# it unspecified for (virtually) infinite.
|
||||
# depth: 3
|
||||
|
||||
# == Size ==
|
||||
# Specifies the format of the size column.
|
||||
# Possible values: default, short, bytes
|
||||
size: default
|
||||
|
||||
# == Permission ==
|
||||
# Specify the format of the permission column
|
||||
# Possible value: rwx, octal
|
||||
permission: rwx
|
||||
|
||||
# == Sorting ==
|
||||
sorting:
|
||||
# Specify what to sort by.
|
||||
# Possible values: extension, name, time, size, version
|
||||
column: name
|
||||
# Whether to reverse the sorting.
|
||||
# Possible values: false, true
|
||||
reverse: false
|
||||
# Whether to group directories together and where.
|
||||
# When "classic" is set, this is set to "none".
|
||||
# Possible values: first, last, none
|
||||
dir-grouping: none
|
||||
|
||||
# == No Symlink ==
|
||||
# Whether to omit showing symlink targets
|
||||
# Possible values: false, true
|
||||
no-symlink: false
|
||||
|
||||
# == Total size ==
|
||||
# Whether to display the total size of directories.
|
||||
# Possible values: false, true
|
||||
total-size: false
|
||||
|
||||
# == Hyperlink ==
|
||||
# Attach hyperlink to filenames
|
||||
# Possible values: always, auto, never
|
||||
hyperlink: never
|
||||
|
||||
# == Symlink arrow ==
|
||||
# Specifies how the symlink arrow display, chars in both ascii and utf8
|
||||
symlink-arrow: ⇒
|
||||
|
||||
# == Header ==
|
||||
# Whether to display block headers.
|
||||
# Possible values: false, true
|
||||
header: false
|
15
.config/lsimg/config.yaml
Normal file
15
.config/lsimg/config.yaml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
# Number of colors your terminal displays, typically something like: 16 or 256
|
||||
number_of_term_colors: 256
|
||||
timeout: 0.25
|
||||
tiles:
|
||||
# Width AND height of each tile in the montage
|
||||
size: 250
|
||||
# width and height default to the tiles.size param above, unless
|
||||
# explicitly set to numeric value other than 0
|
||||
width: 0
|
||||
height: 0
|
||||
# number of tiles to display per row, tries to autocalculate
|
||||
display_per_row: 0
|
||||
# font size for image name below image. default: $((tilewidth/10))
|
||||
font_size: 14
|
6
.config/mail/README.md
Normal file
6
.config/mail/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
Currently on Protonmail and Protoncalendar.
|
||||
- [Guide on Proton and Mutt](https://brian-thompson.medium.com/setting-up-the-mutt-mail-client-with-protonmail-49c042486b3)
|
||||
|
||||
But interested in checking out these projects for inspiration only,
|
||||
because not everything has to be google calendar/icalendar, oof:
|
||||
https://wiki.nikiv.dev/macos/apps/fantastical#links
|
42
.config/neomutt/key_bindings.neomuttrc
Normal file
42
.config/neomutt/key_bindings.neomuttrc
Normal file
|
@ -0,0 +1,42 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
# - Neomutt Key Bindings/Remapping -
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# ❤ VI key bindings for moving around, so that neomutt feels like vim ❤
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# G to get to the last attachment, entry, or email and gg to get to the first
|
||||
bind attach,browser,index G last-entry
|
||||
bind attach,browser,index g noop
|
||||
bind attach,browser,index gg first-entry
|
||||
|
||||
# index page, where you view the list of emails, uses j to go down, k to go up
|
||||
bind index j next-entry
|
||||
bind index k previous-entry
|
||||
|
||||
# same as above, but for pagers (viewing emails)
|
||||
bind pager G bottom
|
||||
bind pager g noop
|
||||
bind pager gg top
|
||||
bind pager j next-line
|
||||
bind pager k previous-line
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# don't know what this does, but trying to use anything other than Esc...
|
||||
# set meta_key = yes
|
||||
|
||||
# current use of Esc is nonsense. Change it to abort
|
||||
set abort_key = "<Esc>"
|
||||
# ESCDELAY = 0 ???
|
||||
|
||||
|
||||
# Viewing html emails quickly, but with an external viewer
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Unbinds V from version (which just printed the version of neomutt)
|
||||
bind index,pager V noop
|
||||
|
||||
# Make quick html view macro
|
||||
macro index,pager V "<view-attachments><search>html<enter><view-mailcap><exit><clear-flag>N<previous-entry>"
|
14
.config/neomutt/mailcap
Normal file
14
.config/neomutt/mailcap
Normal file
|
@ -0,0 +1,14 @@
|
|||
# This file tells neomutt what program to open for what file type
|
||||
# Read more here: https://neomutt.org/guide/mimesupport
|
||||
|
||||
# any image should be handled by sixel right now
|
||||
image/*; img2sixel %s; needsterminal
|
||||
|
||||
# text/html; zellij action new-pane -c -- w3m -sixel -config ~/.config/w3m/config -T text/html -F %s; nametemplate=%s.html
|
||||
# for displaying html files in a new split in iterm2 with w3m and sixel
|
||||
text/html; (clear && w3m-splits %s); nametemplate=%s.html
|
||||
|
||||
# use default program (preview in macOS)
|
||||
application/pdf; open %s
|
||||
# pdf files open in zathura, a hackable document viewer with hotkeys
|
||||
# application/pdf; zathura %s
|
139
.config/neomutt/neomuttrc
Normal file
139
.config/neomutt/neomuttrc
Normal file
|
@ -0,0 +1,139 @@
|
|||
# A first attempt at using neomutt as a primary desktop email client
|
||||
|
||||
# ----------------------- general -------------------------------
|
||||
# bell on new mails - even though I normally hate bells
|
||||
set beep_new
|
||||
|
||||
# -------------------------- Themeing ---------------------------
|
||||
# basic space_chalk color scheme
|
||||
source ~/.config/neomutt/themes/spacechalk/neomutt_spacechalk_colors.muttrc
|
||||
|
||||
# powerline for status lines and pager lines
|
||||
source ~/.config/neomutt/themes/spacechalk/powerline.neomuttrc
|
||||
|
||||
# ------------------------- Temp files ---------------------------
|
||||
set certificate_file=~/.local/state/neomutt/certificates
|
||||
|
||||
|
||||
# ------------- index settings, your list of emails -------------
|
||||
#
|
||||
# No help bar at the top of index
|
||||
unset help
|
||||
|
||||
# sort the inbox by newest first
|
||||
set sort = reverse-threads
|
||||
|
||||
set sidebar_visible = yes
|
||||
|
||||
|
||||
# ----------------- viewing email attachments -------------------
|
||||
|
||||
# handing MIME types (html, pdf, jpg, gif, etc)
|
||||
set mailcap_path = ~/.config/neomutt/mailcap
|
||||
|
||||
# view other kinds of plain(ish) text before html
|
||||
alternative_order text/plain text/enriched text/html text/*
|
||||
|
||||
# set - will always ask for a key after an external command
|
||||
# unset - wait for key only if the external command returned a non-zero status
|
||||
unset wait_key
|
||||
|
||||
|
||||
# --------- composing email: new messages, replies, and forwards -------------
|
||||
# use neovim by default
|
||||
set editor = "nvim"
|
||||
|
||||
# show headers when composing
|
||||
set edit_headers
|
||||
|
||||
# format of subject when forwarding
|
||||
set forward_format = "Fwd: %s"
|
||||
|
||||
# reply to Reply to: field
|
||||
set reply_to
|
||||
|
||||
# reply to person's name
|
||||
set reverse_name
|
||||
|
||||
# include message in replies
|
||||
set include
|
||||
|
||||
# include message in forwards
|
||||
set forward_quote
|
||||
|
||||
# signature, this gets appended to your emails, you have to create this file
|
||||
set signature= "~/.config/neomutt/signature"
|
||||
|
||||
# Character set on sent messages:
|
||||
set send_charset = "utf-8"
|
||||
|
||||
# If there is no charset given on incoming msg, its probably windows:
|
||||
# set assumed_charset = "iso-8859-1"
|
||||
|
||||
# ----------------- Email address, Password, and Name ---------------------
|
||||
# sources secret variables from a file that looks like (without comments):
|
||||
# $my_name="Your Name"
|
||||
# $my_user="You@yourprovider.tld"
|
||||
## if protonmail, $my_pass should be the password from protonmail-bridge
|
||||
# $my_pass="Your Password"
|
||||
source ~/.config/neomutt/keys
|
||||
|
||||
# --------------------- Key binding and remapping ---------------------------
|
||||
# In it's own file for organization sake
|
||||
source ~/.config/neomutt/key_bindings.neomuttrc
|
||||
|
||||
# --------------------------- IMAP settings --------------------------- #
|
||||
# recieving mail
|
||||
# Local protonmail-bridge host server: 127.0.0.1
|
||||
# Protonmail-bridge imap port: 1143
|
||||
# --------------------------------------------------------------------- #
|
||||
# ("+" substitutes for `folder`)
|
||||
set mbox_type = Maildir
|
||||
set folder = ~/.local/share/offlineimap
|
||||
source ~/.config/neomutt/mailboxes
|
||||
set record = +Sent
|
||||
set postponed = +Drafts
|
||||
set trash = +Trash
|
||||
set spoolfile = +INBOX
|
||||
# ----------------------------- Caching ---------------------------------
|
||||
# Store message headers locally to speed things up. If header_cache is a folder,
|
||||
# Mutt will create sub cache folders for each account which speeds things up more
|
||||
# -----------------------------------------------------------------------
|
||||
# CREATE THIS FOLDER. REMOVE IT IF IT IS A FILE AND CREATE AS FOLDER
|
||||
set header_cache = ~/.local/state/neomutt
|
||||
|
||||
# --------------------------- Caching 2 ---------------------------------
|
||||
# Store mail locally to speed things up, like searching message bodies. Can be
|
||||
# same folder as header_cache. Costs disk space if you have a lot of email
|
||||
# -----------------------------------------------------------------------
|
||||
# I'm using this folder because it's more XDG spec
|
||||
set message_cachedir = ~/.local/state/neomutt
|
||||
|
||||
# Allow Mutt to open a new IMAP connection automatically.
|
||||
unset imap_passive
|
||||
|
||||
# Keep the IMAP connection alive by polling intermittently (time in seconds)
|
||||
# this is 5 minutes
|
||||
set imap_keepalive = 300
|
||||
|
||||
# How often to check for new mail (time in seconds).
|
||||
# this is six minutes
|
||||
set mail_check = 360
|
||||
|
||||
# ------------ SMTP (Simple Mail Transfer Protocol) settings ----------
|
||||
# sending mail
|
||||
# Local protonmail-bridge host server: 127.0.0.1
|
||||
# Protonmail-bridge smtp port: 1025
|
||||
# ---------------------------------------------------------------------
|
||||
set smtp_pass = $my_pass
|
||||
set realname = $my_name
|
||||
set from = $my_user
|
||||
set use_from = yes
|
||||
|
||||
set smtp_url = smtp://$my_user:$smtp_pass@127.0.0.1:1025
|
||||
|
||||
# ----------------------- security :shrug: ----------------------------
|
||||
set ssl_force_tls = yes
|
||||
set ssl_starttls = yes
|
||||
# When set , postponed messages that are marked for encryption will be self-encrypted. NeoMutt will first try to encrypt using the value specified in $pgp_default_key or $smime_default_key. If those are not set, it will try the deprecated $postpone_encrypt_as. (Crypto only) Default: no
|
||||
# set postpone_encrypt = yes
|
|
@ -0,0 +1,123 @@
|
|||
# Space Chalk Theme for NeoMutt
|
||||
#
|
||||
# Based on Neonwolf Color Scheme for Mutt:
|
||||
# https://gitlab.com/h3xx/mutt-colors-neonwolf
|
||||
#
|
||||
# color69 - cornflower blue
|
||||
# color81 - SteelBlue1
|
||||
# color156 - GreenYellow, softer neon green
|
||||
# color160 - Red3 - a darker red - too dark
|
||||
# color207 - MediumOrchid1 - soft magenta
|
||||
# color204 - IndianRed1 like a softer pinkish red
|
||||
# color214 - Orange1 - slightly light orange
|
||||
# color227 - LightGoldenrod1 - slightly pale yellow
|
||||
# color232 - blackest gray
|
||||
# color235 - extremely dark gray
|
||||
# color237 - dark gray
|
||||
# color241 - Grey39 - medium gray
|
||||
# color244 - Grey50 - lighter medium gray
|
||||
# color255 - Grey93 - lightest gray before write
|
||||
#
|
||||
# Syntax: color <key> <foreground_color> <background_color> e.g.
|
||||
# color error white red (white text on red background for errors)
|
||||
|
||||
# ----------------------- basic colors --------------------------
|
||||
color error color204 color237 # message line error text
|
||||
color tilde color81 color235 # vi-like tildes marking blank lines
|
||||
color message color156 color237
|
||||
color markers brightcolor232 color227 # wrapped-line /^\+/ markers
|
||||
color attachment brightcolor207 color237 # attachment headers
|
||||
color search color232 color156 # search patterns in pager
|
||||
color status brightcolor232 color69
|
||||
color indicator brightcolor214 color237 # selected email in index
|
||||
color tree brightcolor207 color235 # arrow in threads (`-->')
|
||||
|
||||
# basic monochrome screen
|
||||
mono bold bold
|
||||
mono underline underline
|
||||
mono indicator reverse
|
||||
mono error bold
|
||||
mono header bold "^(From|Subject|Date|To|Cc|Bcc):"
|
||||
mono quoted bold
|
||||
|
||||
# ----------------- custom index highlights ---------------------
|
||||
color index color160 color235 "~A" # all messages
|
||||
color index color214 color235 "~E" # expired messages
|
||||
color index brightcolor156 color235 "~N" # new messages
|
||||
color index color156 color235 "~O" # old messages
|
||||
color index color244 color235 "~R" # read messages
|
||||
color index brightcolor69 color235 "~Q" # messages that have been replied to
|
||||
color index brightcolor156 color235 "~U" # unread messages
|
||||
color index brightcolor156 color235 "~U~$" # unread, unreferenced messages
|
||||
color index color227 color235 "~v" # messages part of a collapsed thread
|
||||
color index color227 color235 "~P" # messages from me
|
||||
#color index color69 color235 "~p!~F" # messages to me
|
||||
#color index color69 color235 "~N~p!~F" # new messages to me
|
||||
#color index color69 color235 "~U~p!~F" # unread messages to me
|
||||
#color index color244 color235 "~R~p!~F" # messages to me
|
||||
color index brightcolor207 color235 "~F" # flagged messages
|
||||
color index_flags color227 color235 "~F" # jesse test
|
||||
# Entire index line
|
||||
color index brightcolor207 color235 "~F~p" # flagged messages to me
|
||||
color index brightcolor207 color235 "~N~F" # new flagged messages
|
||||
color index brightcolor207 color235 "~N~F~p" # new flagged messages to me
|
||||
color index brightcolor207 color235 "~U~F~p" # new flagged messages to me
|
||||
color index color232 color204 "!~N ~D" # deleted messages
|
||||
color index color232 color204 "~N ~D" # deleted new messages
|
||||
color index color244 color235 "~v~(!~N)" # collapsed thread with no unread
|
||||
color index color81 color235 "~v~(~N)" # collapsed thread with some unread
|
||||
color index color81 color235 "~N~v~(~N)" # collapsed thread with unread parent
|
||||
|
||||
# statusbg used to indicated flagged when foreground color shows other status
|
||||
# for collapsed thread
|
||||
color index color160 color235 "~v~(~F)!~N" # collapsed thread with flagged, no unread
|
||||
color index color81 color235 "~v~(~F~N)" # collapsed thread with some unread & flagged
|
||||
color index color81 color235 "~N~v~(~F~N)" # collapsed thread with unread parent & flagged
|
||||
color index color81 color235 "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged
|
||||
color index color69 color235 "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly
|
||||
color index color81 color160 "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial)
|
||||
color index color227 color235 "~T" # tagged messages
|
||||
color index brightcolor227 color235 "~T~F" # tagged, flagged messages
|
||||
color index brightcolor227 color235 "~T~N" # tagged, new messages
|
||||
color index brightcolor227 color235 "~T~U" # tagged, unread messages
|
||||
|
||||
|
||||
# message headers ----------------------------------------------
|
||||
color hdrdefault brightcolor227 color237
|
||||
color header brightcolor214 color236 "^Date"
|
||||
color header color207 color237 "^From"
|
||||
color header brightcolor69 color236 "^To"
|
||||
color header brightcolor81 color236 "^(Cc|Bcc)"
|
||||
color header brightcolor156 color237 "^Subject"
|
||||
|
||||
# body ---------------------------------------------------------
|
||||
|
||||
color quoted color69 color237
|
||||
color quoted1 color207 color237
|
||||
color quoted2 color69 color237
|
||||
color quoted3 color227 color237
|
||||
color quoted4 color214 color237
|
||||
color signature color81 color237 # everything below /^--\s*$/
|
||||
|
||||
color bold color255 color235
|
||||
color underline color235 color244
|
||||
color normal color244 color235
|
||||
|
||||
## pgp
|
||||
|
||||
color body color160 color235 "(BAD signature)"
|
||||
color body color69 color235 "(Good signature)"
|
||||
color body color237 color235 "^gpg: Good signature .*"
|
||||
color body color241 color235 "^gpg: "
|
||||
color body color241 color160 "^gpg: BAD signature from.*"
|
||||
mono body bold "^gpg: Good signature"
|
||||
mono body bold "^gpg: BAD signature from.*"
|
||||
|
||||
# yes, an insane URL regex
|
||||
color body brightcolor69 color235 "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
|
||||
# and a heavy handed email regex
|
||||
color body brightcolor69 color235 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"
|
||||
|
||||
# simplified regex for URL & email
|
||||
#color body magenta default "(ftp|https?|gopher|news|telnet|finger)://[^ \"\t\r\n]+"
|
||||
#color body magenta default "[-a-z_0-9.]+@[-a-z_0-9.]+"
|
196
.config/neomutt/themes/spacechalk/powerline.neomuttrc
Normal file
196
.config/neomutt/themes/spacechalk/powerline.neomuttrc
Normal file
|
@ -0,0 +1,196 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
# Powerline theme for NeoMutt using NerdFonts
|
||||
# loose fork of https://github.com/sheoak/neomutt-powerline-nerdfonts
|
||||
#
|
||||
# Works best with space-chalk theme
|
||||
#
|
||||
# color syntax is: color [field to color] [text color] [background color] #
|
||||
# #
|
||||
# color69 - cornflower blue
|
||||
# color81 - SteelBlue1
|
||||
# color156 - GreenYellow, softer neon green
|
||||
# color160 - Red3 - a darker red - too dark
|
||||
# color207 - MediumOrchid1 - soft magenta
|
||||
# color213 - Orchid - softest magenta
|
||||
# color204 - IndianRed1 like a softer pinkish red
|
||||
# color214 - Orange1 - slightly light orange
|
||||
# color227 - LightGoldenrod1 - slightly pale yellow
|
||||
# color232 - blackest gray
|
||||
# color235 - extremely dark gray
|
||||
# color237 - dark gray
|
||||
# color241 - Grey39 - medium gray
|
||||
# color244 - Grey50 - lighter medium gray
|
||||
# color255 - Grey93 - lightest gray before write
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# INDEX - the main mailbox screen
|
||||
# REF: https://neomutt.org/guide/reference.html#index-format
|
||||
# Index format will be, in the following order:
|
||||
#
|
||||
# %{%d %b} sender's timezone short date format
|
||||
# %Z all of the below %zc,%zs,%zt
|
||||
# %zc Message crypto flags " "
|
||||
# %zs Message status flags " "
|
||||
# %zt Message tag flags " " and " ﴥ "
|
||||
# %-16.16L Sender name or email addresss (16 characters)
|
||||
# %?M?(%1M)& ? Number of hidden messages if the thread is collapsed
|
||||
# %?X?&·? Number of attachments
|
||||
# %s Subject of the message
|
||||
# ---------------------------------------------------------------
|
||||
# not sure how to make this work only only show star or delete: %?zt?%zt&·?
|
||||
# ---------------------------------------------------------------
|
||||
set index_format=" %{%d %b} ·%Z %-16.16L %?M?(%1M)& ? %?X?&·? %s"
|
||||
|
||||
|
||||
# Pager format (uses index_format) will be, in the following order:
|
||||
#
|
||||
# %T the appropriate to_character " ﴥ "
|
||||
# %n Author's real name (or address if missing)
|
||||
# %zc Message crypto flags " "
|
||||
# Message crypto flags
|
||||
# The appropriate character from the $to_chars string
|
||||
# Subject of the message
|
||||
# Date field
|
||||
# Filename of the original message folder (think mailbox)
|
||||
# Time in Hours:Minutes
|
||||
# Number of MIME attachments
|
||||
# Progress indicator for the built-in pager (how much of the file has been displayed)
|
||||
# ----------------------------------------------------------------------------
|
||||
set pager_format="%T %n %zc%s%* %{!%d %b · %H:%M} %?X? %X ? %P "
|
||||
|
||||
|
||||
# ---------------------------- STATUS BAR ----------------------------------- #
|
||||
#
|
||||
# REF: https://neomutt.org/guide/reference.html#status-format
|
||||
#
|
||||
# | Symbol | Description |
|
||||
# | ----------------------------------------------------------------------|
|
||||
# | %f | The full pathname of the current mailbox (folder) |
|
||||
# | %?F? %F? | Number of flagged messages |
|
||||
# | %n | Number of new messages in the mailbox (unread, unseen) |
|
||||
# | %R | Number of read messages in the mailbox |
|
||||
# | %?d? %d ? | Number of deleted messages |
|
||||
# | %?p? %p? | Number of postponed (Draft) messages |
|
||||
# | %t ?%?F? | Number of tagged messages in the mailbox |
|
||||
# | %?V? %V ? | Currently active limit pattern, if any |
|
||||
# | %S | Current sorting mode ($sort) e.g. date recieved |
|
||||
# ------------------------------------------------------------------------
|
||||
set status_format = " %f %?F? %F ? %n %R %?d? %d?%?p? %p? %?t? %t? %> %?V? \"%V\" %M ? %S "
|
||||
|
||||
# ----------------------- VFOLDER LINE ------------------------------------
|
||||
# REF: https://neomutt.org/guide/reference.html#folder-format
|
||||
# folder format will be, in the following order:
|
||||
#
|
||||
# "N" if mailbox has new mail, " " (space) otherwise
|
||||
# Number of unread messages in the mailbox
|
||||
# Number of messages in the mailbox
|
||||
# Filename ("/" is appended to directory names, "@" to symbolic links and "*" to executable files)
|
||||
# ----------------------------------------------------------------------------
|
||||
set vfolder_format = " %N %?n?%3n& ? %8m · %f"
|
||||
|
||||
# ------------------ attach format -----------------------------
|
||||
# REF: https://neomutt.org/guide/reference.html#attach_format
|
||||
# attach format will be, in the following order:
|
||||
#
|
||||
# Unlink (=to delete) flag
|
||||
# Deleted flag
|
||||
# Graphic tree characters
|
||||
# Size (see formatstrings-size)
|
||||
# Major MIME type/MIME subtype
|
||||
# ----------------------------------------------------------------------------
|
||||
set attach_format = "%u%D %T%-75.75d %?T?%& ? %5s · %m/%M"
|
||||
|
||||
# not addressed to me
|
||||
# to me
|
||||
# group
|
||||
# CC
|
||||
# ﴥ Sent by me
|
||||
# mailing list
|
||||
set to_chars="ﴥ"
|
||||
|
||||
# unchanged mailbox, changed, read only, attach mode
|
||||
set status_chars = " "
|
||||
|
||||
# mail is signed, & the signature is successfully verified
|
||||
# mail is PGP encrypted
|
||||
# mail is signed, but not verified
|
||||
# mail contains a PGP public key?
|
||||
# <space> mail has no crypto info
|
||||
ifdef crypt_chars set crypt_chars = " "
|
||||
|
||||
# Symbols for flags
|
||||
# The mail is tagged.
|
||||
# The mail is flagged as important.
|
||||
# The mail is marked for deletion.
|
||||
# The mail has attachments marked for deletion.
|
||||
# The mail has been replied to.
|
||||
# <space> The mail is Old (Unread but seen).
|
||||
# The mail is New (Unread but not seen).
|
||||
# <space> The mail thread is Old (Unread but seen).
|
||||
# <space> The mail thread is New (Unread but not seen).
|
||||
# <space> The mail is read - %S expando.
|
||||
# <space> The mail is read - %Z expando.
|
||||
set flag_chars = " "
|
||||
|
||||
set hidden_tags = "unread,draft,flagged,passed,replied,attachment,signed,encrypted"
|
||||
tag-transforms "replied" "↻ " \
|
||||
"encrytpted" "" \
|
||||
"signed" "" \
|
||||
"attachment" "" \
|
||||
|
||||
# The formats must start with 'G' and the entire sequence is case sensitive.
|
||||
tag-formats "replied" "GR" \
|
||||
"encrypted" "GE" \
|
||||
"signed" "GS" \
|
||||
"attachment" "GA" \
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# ------------ coloring the status bar to look like powerline -------------- #
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
# default
|
||||
color status color239 color235
|
||||
|
||||
# this is for the mailbox, first segment
|
||||
color status color237 color69 '( [^ ]+ )' 1
|
||||
|
||||
# flagged/tagged messages
|
||||
color status yellow color241 '\s* [0-9]+ \s*'
|
||||
|
||||
# unread messages
|
||||
color status color156 color240 '\s* [0-9]+ \s*'
|
||||
|
||||
# read messages
|
||||
color status color75 color239 '\s* [0-9]+ \s*'
|
||||
|
||||
# deleted messages
|
||||
color status color204 color238 '\s* [0-9]+\s*'
|
||||
|
||||
# postponed messages (drafts)
|
||||
color status color213 color238 '\s* [0-9]+ \s*'
|
||||
|
||||
# dividers for left side
|
||||
color status color69 color241 '( ).*' 1
|
||||
color status color238 color235 ' '
|
||||
|
||||
# -------------------- Right side of status bar ----------------------
|
||||
|
||||
# divider for the left edge of right side if search is being done
|
||||
color status color239 color235 ''
|
||||
|
||||
# Sorting method, e.g. sorted by date (oldest to newest)
|
||||
color status color214 color239 '( [^ ]+ )' 1
|
||||
|
||||
# the ending quote for the search term is white
|
||||
color status color251 color241 '(" )[0-9]+' 1
|
||||
|
||||
# number of how many times we found the search term is green
|
||||
color status green color241 '([0-9]+ ) ' 1
|
||||
|
||||
# number of how many times we found the search term is green
|
||||
color status color251 color241 '( )' 1
|
||||
|
||||
# number of how many times we found the search term is green
|
||||
color status color213 color241 '("[^ ]+" )' 1
|
||||
|
||||
# ------------------ PAGER COLORFORMATTING -------------------
|
3
.config/npm/npmrc
Normal file
3
.config/npm/npmrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
prefix=${XDG_DATA_HOME}/npm
|
||||
cache=${XDG_CACHE_HOME}/npm
|
||||
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js
|
9
.config/nvim/after/ftplugin/bash.lua
Normal file
9
.config/nvim/after/ftplugin/bash.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- only set 81 character line limit on Python, Go, YAML, and shell scripts
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
callback = function()
|
||||
-- highlighted column 81, to keep lines to average terminal size
|
||||
vim.opt.colorcolumn = '81'
|
||||
end,
|
||||
})
|
4
.config/nvim/after/ftplugin/dockerfile.lua
Normal file
4
.config/nvim/after/ftplugin/dockerfile.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
-- disable lsp semantic highlighting for parameter/variable in
|
||||
-- Dockerfile because it competes with treesitter and is worse
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.parameter.dockerfile', {})
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.variable.dockerfile', {})
|
1
.config/nvim/after/ftplugin/go.lua
Normal file
1
.config/nvim/after/ftplugin/go.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.opt.colorcolumn = '81'
|
9
.config/nvim/after/ftplugin/markdown.lua
Normal file
9
.config/nvim/after/ftplugin/markdown.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- enable spellcheck for TXT (text) and MD (markdown) filetypes
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.txt", "*.md", "*.mdx"},
|
||||
callback = function()
|
||||
vim.cmd("set spell")
|
||||
end,
|
||||
})
|
1
.config/nvim/after/ftplugin/python.lua
Normal file
1
.config/nvim/after/ftplugin/python.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.opt.colorcolumn = '81'
|
9
.config/nvim/after/ftplugin/sh.lua
Normal file
9
.config/nvim/after/ftplugin/sh.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- only set 81 character line limit on Python, Go, YAML, and shell scripts
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
callback = function()
|
||||
-- highlighted column 81, to keep lines to average terminal size
|
||||
vim.opt.colorcolumn = '81'
|
||||
end,
|
||||
})
|
1
.config/nvim/after/ftplugin/yaml.lua
Normal file
1
.config/nvim/after/ftplugin/yaml.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.opt.colorcolumn = '81'
|
84
.config/nvim/after/queries/gotmpl/highlights.scm
Normal file
84
.config/nvim/after/queries/gotmpl/highlights.scm
Normal file
|
@ -0,0 +1,84 @@
|
|||
; Identifiers
|
||||
|
||||
[
|
||||
(field)
|
||||
(field_identifier)
|
||||
] @property
|
||||
|
||||
(variable) @variable
|
||||
|
||||
; Function calls
|
||||
|
||||
(function_call
|
||||
function: (identifier) @function)
|
||||
|
||||
(method_call
|
||||
method: (selector_expression
|
||||
field: (field_identifier) @method))
|
||||
|
||||
; Operators
|
||||
|
||||
"|" @operator
|
||||
":=" @operator
|
||||
|
||||
; Builtin functions
|
||||
|
||||
((identifier) @function.builtin
|
||||
(#match? @function.builtin "^(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|ge|gt|ge)$"))
|
||||
|
||||
; Delimiters
|
||||
|
||||
"." @punctuation.delimiter
|
||||
"," @punctuation.delimiter
|
||||
|
||||
"{{" @punctuation.bracket
|
||||
"}}" @punctuation.bracket
|
||||
"{{-" @punctuation.bracket
|
||||
"-}}" @punctuation.bracket
|
||||
")" @punctuation.bracket
|
||||
"(" @punctuation.bracket
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"else"
|
||||
"else if"
|
||||
"if"
|
||||
"with"
|
||||
] @conditional
|
||||
|
||||
[
|
||||
"range"
|
||||
"end"
|
||||
"template"
|
||||
"define"
|
||||
"block"
|
||||
] @keyword
|
||||
|
||||
; Literals
|
||||
|
||||
[
|
||||
(interpreted_string_literal)
|
||||
(raw_string_literal)
|
||||
(rune_literal)
|
||||
] @string
|
||||
|
||||
(escape_sequence) @string.special
|
||||
|
||||
[
|
||||
(int_literal)
|
||||
(float_literal)
|
||||
(imaginary_literal)
|
||||
] @number
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
[
|
||||
(nil)
|
||||
] @constant.builtin
|
||||
|
||||
(comment) @comment
|
||||
(ERROR) @error
|
1
.config/nvim/after/queries/gotmpl/injections.scm
Normal file
1
.config/nvim/after/queries/gotmpl/injections.scm
Normal file
|
@ -0,0 +1 @@
|
|||
(text) @yaml
|
15
.config/nvim/after/queries/python/highlights.scm
Normal file
15
.config/nvim/after/queries/python/highlights.scm
Normal file
|
@ -0,0 +1,15 @@
|
|||
; extends
|
||||
|
||||
; Module docstring
|
||||
(module . (expression_statement (string) @comment))
|
||||
|
||||
; Class docstring
|
||||
(class_definition
|
||||
body: (block . (expression_statement (string) @comment)))
|
||||
|
||||
; Function/method docstring
|
||||
(function_definition
|
||||
body: (block . (expression_statement (string) @comment)))
|
||||
|
||||
; Attribute docstring
|
||||
((expression_statement (assignment)) . (expression_statement (string) @comment))
|
67
.config/nvim/init.lua
Normal file
67
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,67 @@
|
|||
-- sometimes neovim can't remember where python is if you install with linuxbrew
|
||||
-- if vim.loop.os_uname().sysname == 'Linux'
|
||||
-- then
|
||||
-- vim.g.python3_host_prog = '/home/linuxbrew/.linuxbrew/bin/python3.11'
|
||||
-- end
|
||||
|
||||
-- turn off the mouse scrolling because it is confusing
|
||||
vim.opt.mousescroll = 'ver:0,hor:0'
|
||||
|
||||
-- line numbers for debugging and screen sharing, takes up 4 columns
|
||||
vim.opt.number = true
|
||||
vim.opt.numberwidth = 4
|
||||
|
||||
-- highlight current line
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- vim.opt.termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- make searching case insensitive
|
||||
vim.opt.ignorecase = true
|
||||
-- make searching case sensitive if at least one character is cap
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- load plugins
|
||||
require('user.lazy')
|
||||
|
||||
-- --------- Plugin configs that have to be called after lazy --------------
|
||||
-- starting page for neovim - dashbaord plugin
|
||||
require('user.dashboard')
|
||||
|
||||
-- tab line at top of window for tabs when there's more than one tab :) -- might switch to bufferline
|
||||
require('user.barbar')
|
||||
|
||||
-- status line at bottom of window for cool file facts
|
||||
require('user.lualine')
|
||||
|
||||
-- directory tree; can open with :Neotree
|
||||
require('user.neo-tree')
|
||||
|
||||
-- scrollbar on the right side of the screen that also shows errors
|
||||
require("user.gitsigns")
|
||||
require("user.scrollbar")
|
||||
|
||||
-- more configurable terminal for neovim
|
||||
require("user.toggleterm")
|
||||
|
||||
-- Language Server configs and other syntax checking and highlight tools
|
||||
require('user.lsp-configs')
|
||||
|
||||
-- Run startup autocommands
|
||||
require('user.autocommands')
|
||||
|
||||
-- treesitter is for sytax highlighting
|
||||
require('user.tree-sitter')
|
||||
|
||||
-- folding and indentation
|
||||
require('user.indent')
|
||||
|
||||
-- completion from nvim-cmp
|
||||
require('user.completion')
|
||||
|
||||
-- syntax highlighting for hex codes
|
||||
require('user.nvim-colorizer')
|
||||
|
||||
-- experiment to give you a remote git permalink URL for your your current line
|
||||
require('user.git_url')
|
42
.config/nvim/lua/user/ale.lua
Normal file
42
.config/nvim/lua/user/ale.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
-- ALE:
|
||||
-- linter for warning and errors, using *existing* linter tools
|
||||
-- --------------------------------------------------------------------
|
||||
-- always enabled by default
|
||||
vim.g.ale_enabled = 1
|
||||
|
||||
-- so we know what exactly about ale is complaining
|
||||
vim.g.ale_echo_msg_error_str = ''
|
||||
vim.g.ale_echo_msg_warning_str = ''
|
||||
vim.g.ale_echo_msg_format = '%severity% ALE: [%linter%]: %s'
|
||||
|
||||
-- prettier error/warning signs for the sign column
|
||||
vim.g.ale_sign_error = ''
|
||||
vim.g.ale_sign_warning = ''
|
||||
|
||||
-- speed up ALE
|
||||
vim.g.ale_lint_on_text_changed = 'never'
|
||||
|
||||
vim.cmd[[
|
||||
let g:ale_linters = {
|
||||
\ 'python': ['ruff', 'flake8'],
|
||||
\}
|
||||
]]
|
||||
|
||||
-- this doesn't seem to work for python right now
|
||||
vim.cmd[[
|
||||
let g:ale_fixers = {
|
||||
\ 'python': ['ruff'],
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\}
|
||||
]]
|
||||
-- automatically apply above fixers
|
||||
vim.g.ale_fix_on_save = 1
|
||||
|
||||
-- TODO: how do you do these in lines below in lua?
|
||||
-- put errors in our status line
|
||||
vim.cmd [[let g:airline#extensions#ale#enabled = 1]]
|
||||
|
||||
-- map the keys Ctrl+j and Ctrl+k to moving between errors
|
||||
-- this doesn't seem to work?
|
||||
vim.cmd [[nmap <silent> <C-k> <Plug>(ale_previous_wrap)]]
|
||||
vim.cmd [[nmap <silent> <C-j> <Plug>(ale_next_wrap)]]
|
124
.config/nvim/lua/user/autocommands.lua
Normal file
124
.config/nvim/lua/user/autocommands.lua
Normal file
|
@ -0,0 +1,124 @@
|
|||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
------------------------------------------------------------
|
||||
-- Autocommands to run immediately for for ALL file types --
|
||||
------------------------------------------------------------
|
||||
|
||||
-- on file enter, set file format to unix
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*"},
|
||||
callback = function()
|
||||
-- verify the buffer is modifiable before setting fileformat
|
||||
local modifiable = vim.api.nvim_buf_get_option(0, 'modifiable')
|
||||
if modifiable then
|
||||
vim.cmd("set fileformat=unix")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- delete whitespace on save - https://vi.stackexchange.com/a/41388
|
||||
autocmd({ "BufWritePre", "ExitPre" }, {
|
||||
pattern = {"*"},
|
||||
callback = function()
|
||||
local save_cursor = vim.fn.getpos(".")
|
||||
pcall(function() vim.cmd [[%s/\s\+$//e]] end)
|
||||
vim.fn.setpos(".", save_cursor)
|
||||
end,
|
||||
})
|
||||
|
||||
-------------------------------------------------------------
|
||||
-- Autocommands to run immediately for SPECIFIC file types --
|
||||
-------------------------------------------------------------
|
||||
|
||||
-- set file type to dockerfile if Dockerfile anywhere in the file name
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"Dockerfile*"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "dockerfile"
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the file type to PHP if the extension is php.tpl
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {
|
||||
"*.php.tpl",
|
||||
},
|
||||
callback = function()
|
||||
vim.bo.filetype = "php"
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the file type to helm based on files ending in tpl
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {
|
||||
"*/templates/*.tpl",
|
||||
"*/templates/*.yaml",
|
||||
"*/.github/workflows/*.yaml",
|
||||
"*/.github/workflows/*.yml",
|
||||
},
|
||||
callback = function()
|
||||
vim.bo.filetype = "helm"
|
||||
end,
|
||||
})
|
||||
|
||||
-- this catches any stray helm files that weren't where we expected them
|
||||
autocmd("FileType", {
|
||||
pattern = { "mustache" },
|
||||
callback = function()
|
||||
if vim.fn.expand("%:e") == "tpl" then
|
||||
vim.bo.filetype = "helm"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the file type to cfg for wireguard configs
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*/etc/wireguard/wg*.conf"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "cfg"
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the file type to YAML for kubeconfig files and helm chart lock files
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*/kubeconfig", "*/.config/kube/config", "Chart.lock"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "yaml"
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the file type to CSS for tcss
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.tcss"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "scss"
|
||||
vim.cmd("set foldmethod=indent")
|
||||
end,
|
||||
})
|
||||
|
||||
-- set the filetype for literally everything else
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
callback = function()
|
||||
if vim.opt.foldmethod:get() == "expr" then
|
||||
vim.schedule(function()
|
||||
vim.opt.foldmethod = "expr"
|
||||
end)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- set TXT (text files) to filetype markdown
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"*.txt"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "markdown"
|
||||
end,
|
||||
})
|
||||
|
||||
-- set file type to groovy if Jenkinsfile is the file name
|
||||
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"Jenkinsfile"},
|
||||
callback = function()
|
||||
vim.bo.filetype = "groovy"
|
||||
end,
|
||||
})
|
86
.config/nvim/lua/user/barbar.lua
Normal file
86
.config/nvim/lua/user/barbar.lua
Normal file
|
@ -0,0 +1,86 @@
|
|||
-- Set barbar's options
|
||||
require("bufferline").setup({
|
||||
-- Enable/disable animations
|
||||
animation = true,
|
||||
|
||||
-- Enable/disable auto-hiding the tab bar when there is a single buffer
|
||||
auto_hide = true,
|
||||
|
||||
-- Enable/disable current/total tabpages indicator (top right corner)
|
||||
tabpages = true,
|
||||
|
||||
-- Enable/disable close button
|
||||
closable = true,
|
||||
|
||||
-- Enables/disable clickable tabs
|
||||
-- - left-click: go to buffer
|
||||
-- - middle-click: delete buffer
|
||||
clickable = true,
|
||||
|
||||
-- Excludes buffers from the tabline
|
||||
exclude_ft = {'dashboard', 'TelescopePrompt'},
|
||||
-- exclude_name = {'package.json'},
|
||||
|
||||
-- Hide inactive buffers and file extensions. Other options are `alternate`, `current`, and `visible`.
|
||||
hide = {extensions = true, inactive = false},
|
||||
|
||||
-- Disable highlighting alternate buffers
|
||||
highlight_alternate = false,
|
||||
|
||||
-- Disable highlighting file icons in inactive buffers
|
||||
highlight_inactive_file_icons = false,
|
||||
|
||||
-- Enable highlighting visible buffers
|
||||
highlight_visible = true,
|
||||
|
||||
-- Enable/disable icons
|
||||
-- if set to 'numbers', will show buffer index in the tabline
|
||||
-- if set to 'both', will show buffer index and icons in the tabline
|
||||
icons = {
|
||||
filetype = { enabled = true },
|
||||
diagnostics = {
|
||||
{ enabled = true, icon = '' }, -- ERROR
|
||||
{ enabled = false, icon = '' }, -- WARN
|
||||
{ enabled = false, icon = '' }, -- INFO
|
||||
{ enabled = true, icon = '' }, -- HINT
|
||||
},
|
||||
-- Configure icons on the bufferline
|
||||
separator = { left = '▎'},
|
||||
inactive = {
|
||||
separator = { left = '▎' },
|
||||
},
|
||||
custom_colors = false,
|
||||
button = '',
|
||||
close_tab_modified = '',
|
||||
pinned = { button = ''},
|
||||
},
|
||||
|
||||
-- If true, new buffers will be inserted at the start/end of the list.
|
||||
-- Default is to insert after current buffer.
|
||||
insert_at_end = false,
|
||||
insert_at_start = false,
|
||||
|
||||
-- Sets the maximum padding width with which to surround each tab
|
||||
maximum_padding = 2,
|
||||
|
||||
-- Sets the minimum padding width with which to surround each tab
|
||||
minimum_padding = 1,
|
||||
|
||||
-- Sets the maximum buffer name length.
|
||||
maximum_length = 30,
|
||||
|
||||
-- If set, the letters for each buffer in buffer-pick mode will be
|
||||
-- assigned based on their name. Otherwise or in case all letters are
|
||||
-- already assigned, the behavior is to assign letters in order of
|
||||
-- usability (see order below)
|
||||
semantic_letters = true,
|
||||
|
||||
-- New buffer letters are assigned in this order. This order is
|
||||
-- optimal for the qwerty keyboard layout but might need adjustement
|
||||
-- for other layouts.
|
||||
letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',
|
||||
|
||||
-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
|
||||
-- where X is the buffer number. But only a static string is accepted here.
|
||||
no_name_title = nil,
|
||||
})
|
45
.config/nvim/lua/user/bbq.lua
Normal file
45
.config/nvim/lua/user/bbq.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
require("barbecue").setup({
|
||||
theme = {
|
||||
normal = { bg = "NONE", fg = "#bdd8ff" },
|
||||
|
||||
ellipsis = { fg = "#585858" },
|
||||
separator = { fg = "#585858" },
|
||||
context_operator = { fg = "#fdcd36" },
|
||||
|
||||
modified = { fg = "#ff8d87" },
|
||||
|
||||
context = { fg = "#bdd8ff" },
|
||||
basename = { fg = "#bdd8ff", bold = true },
|
||||
context_file = { fg = "#bdd8ff" },
|
||||
dirname = { fg = "#bdd8ff" },
|
||||
|
||||
context_null = { fg = "#585858" },
|
||||
|
||||
context_string = { fg = "#a8fd57" },
|
||||
context_number = { fg = "#f7fb53" },
|
||||
context_boolean = { fg = "#fdcd36" },
|
||||
context_type_parameter = { fg = "#C1FF87" },
|
||||
|
||||
context_variable = { fg = "#2569aa" },
|
||||
context_constant = { fg = "#2ac3de" },
|
||||
context_property = { fg = "#5cc9fd" },
|
||||
|
||||
context_module = { fg = "#5f87ff" },
|
||||
context_class = { fg = "#7aa2f7" },
|
||||
context_function = { fg = "#3d59a1" },
|
||||
context_method = { fg = "#6DF2E5" },
|
||||
|
||||
context_namespace = { fg = "#f7fb53" },
|
||||
context_package = { fg = "#737aa2" },
|
||||
context_field = { fg = "#a3a8f8" },
|
||||
context_constructor = { fg = "#565f89" },
|
||||
context_enum = { fg = "#f289f9" },
|
||||
context_interface = { fg = "#fdcd36" },
|
||||
context_array = { fg = "#7dcfff" },
|
||||
context_object = { fg = "#d092fc" },
|
||||
context_key = { fg = "#5cc9fd" },
|
||||
context_enum_member = { fg = "#a8fd57 " },
|
||||
context_struct = { fg = "#d092fc" },
|
||||
context_event = { fg = "#ff8d87" },
|
||||
}
|
||||
})
|
90
.config/nvim/lua/user/completion.lua
Normal file
90
.config/nvim/lua/user/completion.lua
Normal file
|
@ -0,0 +1,90 @@
|
|||
-- Set up nvim-cmp: https://github.com/hrsh7th/nvim-cmp/
|
||||
local cmp = require('cmp')
|
||||
|
||||
local has_words_before = function()
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-c>'] = cmp.mapping.abort(),
|
||||
-- Accept currently selected item.
|
||||
-- Set `select` to `false` to only confirm explicitly selected items.
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function()
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'color_names'},
|
||||
{ name = 'emoji'},
|
||||
{ name = 'nvim_lua'},
|
||||
{ name = 'nerdfont'},
|
||||
{ name = 'path'},
|
||||
{ name = 'buffer'},
|
||||
})
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
-- cmp.setup.filetype('gitcommit', {
|
||||
-- sources = cmp.config.sources({
|
||||
-- -- You can specify the `cmp_git` source if you were installed it.
|
||||
-- { name = 'cmp_git' },
|
||||
-- }, {
|
||||
-- { name = 'buffer' },
|
||||
-- })
|
||||
-- })
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
-- require('lspconfig').jedi_language_server.setup {
|
||||
-- capabilities = capabilities
|
||||
-- }
|
156
.config/nvim/lua/user/dashboard.lua
Normal file
156
.config/nvim/lua/user/dashboard.lua
Normal file
|
@ -0,0 +1,156 @@
|
|||
-- do not try to indent the starting dashboard
|
||||
vim.g.indentLine_fileTypeExclude = [['dashboard']]
|
||||
|
||||
local db = require("dashboard")
|
||||
|
||||
-- ⣿ ⣿ c o l o r s ⣿ ⣿ --
|
||||
local icon_color = 'Keyword'
|
||||
local keymap_color = 'Function'
|
||||
local description_color = 'String'
|
||||
|
||||
-- for printing the neovim version under the image
|
||||
local version = vim.version()
|
||||
|
||||
db.setup({
|
||||
theme = 'doom',
|
||||
config = {
|
||||
header = {
|
||||
' ',
|
||||
' ',
|
||||
os.date(" %A, %d-%m-%Y %H:%M"),
|
||||
' ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⠿⢛⡛⣛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣶⣾⣷⣿⣿⣶⣶⣤⣌⣙⣛⡻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣬⡙⠿⠿⠟⠛⢛⣛⠛⠛⠛⠛⠻⠿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢛⣉⣩⣵⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣶⣶⣦⣍⣉⣙⡛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟ ',
|
||||
' ⣿⣿⣿⣿⣿⡿⠟⣫⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⠉⠛⣿⣿⣿⣿⣿⣿⡟⢠ ',
|
||||
' ⣿⣿⡟⢉⣱⡶⢟⣉⢥⣮⣭⡛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣮⣙⠿⠿⠿⠛⢡⣿ ',
|
||||
' ⡿⢋⣴⣿⡏⣠⣿⡁⠀⢸⣿⣿⡎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀⣰⣿⣿ ',
|
||||
' ⣴⣿⣿⣿⡇⠹⣿⣿⣿⣿⡿⢟⣼⣿⣿⣿⣿⠿⠟⣛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣷⣬⣭⠭⠵⠶⠿⣟⣛⣭⣷⣶⣴⣿⣟⣻⣦⡝⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢫⣵⣶⠶⢶⣮⣍⢻⣿⣿⣿⣎ ',
|
||||
' ⣿⣿⣿⣿⢻⣭⣴⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⣿⣿⣅⠀⢀⣿⣿⡇⢻⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣮⡃⢀⡀⠀⠀⠀⠀⠉⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣮⣍⡻⢿⣿⣿⣿⣿⣿⣧⡹⣿⣿⣿⣿⣿⣿⢇⣾⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣦⣙⠿⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠛⠿⣿⣿⣿⣿⣷⣬⡻⣿⣿⣿⣿⣷⣮⣭⣉⣉⣩⣴⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣷⣬⡻⡓⠦⣤⣤⣤⣄⣀⣀⣀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠛⢿⣿⣎⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡘⠷⣶⣾⣿⣿⡿⠿⠿⠿⢿⣟⣛⣛⣛⣛⣛⣉⣭⣭⣭⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⡻⣭⣶⣦⣤⣤⣴⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⠿⢋⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⣫ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣫⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⣵⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢏⣴⣿⣿⣿⣿ ',
|
||||
' ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢡⣿⣿⣿⣿⣿⣿ ',
|
||||
' ',
|
||||
"N E O V I M - v " .. version.major .. "." .. version.minor,
|
||||
' ',
|
||||
},
|
||||
center = {
|
||||
-- list of configurable dashboard entries
|
||||
{
|
||||
-- the icon for the list entry
|
||||
icon = " ",
|
||||
-- the highlight group to use for the icon
|
||||
icon_hl = icon_color,
|
||||
-- the description of the entry to the right of the icon
|
||||
desc = "Recents ",
|
||||
-- the highlight group to use for the desctiption text
|
||||
desc_hl = description_color,
|
||||
-- the shortcut key you can press to run this entry
|
||||
key = "r",
|
||||
-- the highlight group to use for the shortcut key help text
|
||||
key_hl = keymap_color,
|
||||
-- the command to run for this entry
|
||||
action = "Telescope oldfiles",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = icon_color,
|
||||
desc = "Find File ",
|
||||
desc_hl = description_color,
|
||||
key = "f",
|
||||
key_hl = keymap_color,
|
||||
action = "Telescope find_files",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = icon_color,
|
||||
desc = "New File ",
|
||||
desc_hl = description_color,
|
||||
key = "n",
|
||||
key_hl = keymap_color,
|
||||
action = "lua dashNewFile()",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = icon_color,
|
||||
desc = "Update Plugins ",
|
||||
desc_hl = description_color,
|
||||
key = "u",
|
||||
key_hl = keymap_color,
|
||||
action = "Lazy sync",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = icon_color,
|
||||
desc = "Rebuild Dictionary ",
|
||||
desc_hl = description_color,
|
||||
key = "s",
|
||||
key_hl = keymap_color,
|
||||
action = "mkspell! $XDG_CONFIG_HOME/nvim/spell/en.utf-8.add",
|
||||
},
|
||||
{
|
||||
icon = " ",
|
||||
icon_hl = icon_color,
|
||||
desc = "Exit ",
|
||||
desc_hl = description_color,
|
||||
key = "q",
|
||||
key_hl = keymap_color,
|
||||
action = "exit",
|
||||
},
|
||||
},
|
||||
footer = {
|
||||
"type :help<Enter> or <F1> for on-line help"
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
-- this is for a floating window prompt for a new file
|
||||
local Input = require('nui.input')
|
||||
local event = require('nui.utils.autocmd').event
|
||||
|
||||
_G.dashNewFile = function()
|
||||
local input= Input({
|
||||
buf_options = {
|
||||
filetype = "dashboardPrompt",
|
||||
},
|
||||
position = '50%',
|
||||
size = {
|
||||
width = 40,
|
||||
},
|
||||
-- border map
|
||||
border = {
|
||||
style = 'rounded',
|
||||
text = {
|
||||
top = ' Enter name of new file to create ',
|
||||
top_align = 'center',
|
||||
},
|
||||
padding = { 0, 1 },
|
||||
},
|
||||
relative = 'editor',
|
||||
win_options = {
|
||||
winhighlight = 'Normal:Normal,FloatBorder:LineNr',
|
||||
},
|
||||
},
|
||||
-- prompt for user
|
||||
{
|
||||
prompt = '',
|
||||
default_value = '',
|
||||
on_close = function()
|
||||
require('notify').notify('New file was not created!', 'error')
|
||||
end,
|
||||
on_submit = function(value)
|
||||
vim.fn.execute('edit ' .. value)
|
||||
end,
|
||||
})
|
||||
input:on(event.BufLeave, function() input:unmount() end)
|
||||
input:mount()
|
||||
end
|
230
.config/nvim/lua/user/galaxyline.lua
Normal file
230
.config/nvim/lua/user/galaxyline.lua
Normal file
|
@ -0,0 +1,230 @@
|
|||
-- ------------------- from airline ---------------------------
|
||||
-- changing separators to match personal powerline for shell
|
||||
-- vim.g.airline_left_sep = ''
|
||||
-- vim.g.airline_right_sep = ''
|
||||
-- vim.g.airline_section_z = ' %l (%{LinePercent()}) %v'
|
||||
|
||||
|
||||
local gl = require('galaxyline')
|
||||
local gls = gl.section
|
||||
gl.short_line_list = {'LuaTree','vista','dbui'}
|
||||
|
||||
local colors = {
|
||||
bg = '#232336',
|
||||
yellow = '#f7fb53',
|
||||
orange = '#fdcd36',
|
||||
purple = '#a3a8f8',
|
||||
green = '#a8fd57',
|
||||
cornflowerblue = '#5f87ff',
|
||||
magenta = '#f289f9',
|
||||
pink = '#ffaff9',
|
||||
grey = '#585858',
|
||||
grey46 = '#3E3E3E',
|
||||
blue = '#5cc9fd',
|
||||
red = '#f2748a'
|
||||
}
|
||||
|
||||
local buffer_not_empty = function()
|
||||
if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- "no": "N·OPER",
|
||||
-- "s": "lllllll,
|
||||
-- "S": "S·LINE",
|
||||
-- "^S": "S·BLCK",
|
||||
-- "ic": "I·COMP",
|
||||
-- "ix": "I·C-X ",
|
||||
-- "Rv": "V·RPLC",
|
||||
-- "Rc": "R·COMP",
|
||||
-- "Rx": "R·C-X ",
|
||||
-- "cv": "VIM·EX",
|
||||
-- "ce": "NRM·EX",
|
||||
-- "r": "PROMPT",
|
||||
-- "rm": "-MORE-",
|
||||
-- "r?": "CNFIRM",
|
||||
-- "!": "!SHELL",
|
||||
-- "t": "TERM "
|
||||
|
||||
-- these are the colors for the first mode segment
|
||||
local mode_colors = {n = colors.cornflowerblue,
|
||||
i = colors.green,
|
||||
c = colors.blue,
|
||||
v = colors.magenta,
|
||||
V = colors.pink,
|
||||
R = colors.orange,
|
||||
['!'] = colors.orange,
|
||||
[''] = colors.magenta}
|
||||
|
||||
gls.left[1] = {
|
||||
ViMode = {
|
||||
-- this determines the Name of the mode displayed
|
||||
provider = function()
|
||||
local alias = {n = 'normal',
|
||||
i = ' insert',
|
||||
c = ' cmd',
|
||||
R = ' replace',
|
||||
v = ' visual',
|
||||
V = ' visual line',
|
||||
['!'] = '🐚 cmd',
|
||||
[''] = ' visual block'}
|
||||
|
||||
-- this sets the highlight colors of each vim mode
|
||||
vim.api.nvim_command('hi GalaxyViMode guibg='..mode_colors[vim.fn.mode()])
|
||||
vim.api.nvim_command('hi ViModeSeparator guifg='..mode_colors[vim.fn.mode()])
|
||||
return ' ' .. alias[vim.fn.mode()]
|
||||
end,
|
||||
|
||||
-- separator icon and highlight color
|
||||
separator = ' ',
|
||||
separator_highlight = {colors.cornflowerblue,colors.grey46},
|
||||
|
||||
-- default highlight for the whole mode
|
||||
highlight = {colors.grey46,colors.cornflowerblue,'bold'},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
gls.left[2] ={
|
||||
FileIcon = {
|
||||
provider = 'FileIcon',
|
||||
condition = buffer_not_empty,
|
||||
highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.grey46},
|
||||
},
|
||||
}
|
||||
|
||||
gls.left[3] = {
|
||||
FileName = {
|
||||
provider = {'FileName','FileSize'},
|
||||
condition = buffer_not_empty,
|
||||
separator = '',
|
||||
separator_highlight = {colors.grey46,colors.cornflowerblue},
|
||||
highlight = {colors.blue,colors.grey46}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[4] = {
|
||||
GitIcon = {
|
||||
provider = function() return ' ' end,
|
||||
condition = buffer_not_empty,
|
||||
highlight = {colors.orange,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[5] = {
|
||||
GitBranch = {
|
||||
provider = 'GitBranch',
|
||||
condition = buffer_not_empty,
|
||||
highlight = {colors.grey46,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
|
||||
local checkwidth = function()
|
||||
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||
if squeeze_width > 40 then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
gls.left[6] = {
|
||||
DiffAdd = {
|
||||
provider = 'DiffAdd',
|
||||
condition = checkwidth,
|
||||
icon = ' ',
|
||||
highlight = {colors.green,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
gls.left[7] = {
|
||||
DiffModified = {
|
||||
provider = 'DiffModified',
|
||||
condition = checkwidth,
|
||||
icon = ' ',
|
||||
highlight = {colors.orange,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
gls.left[8] = {
|
||||
DiffRemove = {
|
||||
provider = 'DiffRemove',
|
||||
condition = checkwidth,
|
||||
icon = ' ',
|
||||
highlight = {colors.red,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[9] = {
|
||||
LeftEnd = {
|
||||
provider = function() return '' end,
|
||||
separator = '',
|
||||
separator_highlight = {colors.cornflowerblue,colors.bg},
|
||||
highlight = {colors.cornflowerblue,colors.cornflowerblue}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[10] = {
|
||||
DiagnosticError = {
|
||||
provider = 'DiagnosticError',
|
||||
icon = ' ',
|
||||
highlight = {colors.red,colors.bg}
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[11] = {
|
||||
Space = {
|
||||
provider = function () return ' ' end
|
||||
}
|
||||
}
|
||||
|
||||
gls.left[12] = {
|
||||
DiagnosticWarn = {
|
||||
provider = 'DiagnosticWarn',
|
||||
icon = ' ',
|
||||
highlight = {colors.blue,colors.bg},
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[1] = {
|
||||
LineInfo = {
|
||||
provider = 'LineColumn',
|
||||
separator = ' ',
|
||||
separator_highlight = {colors.bg,colors.cornflowerblue},
|
||||
highlight = {colors.grey46,colors.cornflowerblue},
|
||||
},
|
||||
}
|
||||
|
||||
gls.right[2] = {
|
||||
PerCent = {
|
||||
provider = 'LinePercent',
|
||||
separator = '',
|
||||
separator_highlight = {colors.grey46,colors.cornflowerblue},
|
||||
highlight = {colors.blue,colors.grey46},
|
||||
}
|
||||
}
|
||||
|
||||
gls.right[3] = {
|
||||
ScrollBar = {
|
||||
provider = 'ScrollBar',
|
||||
highlight = {colors.green,colors.cornflowerblue},
|
||||
}
|
||||
}
|
||||
|
||||
gls.short_line_left[1] = {
|
||||
BufferType = {
|
||||
provider = 'FileTypeName',
|
||||
separator = '',
|
||||
separator_highlight = {colors.cornflowerblue,colors.bg},
|
||||
highlight = {colors.grey,colors.cornflowerblue}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gls.short_line_right[1] = {
|
||||
BufferIcon = {
|
||||
provider= 'BufferIcon',
|
||||
separator = '',
|
||||
separator_highlight = {colors.cornflowerblue,colors.bg},
|
||||
highlight = {colors.grey,colors.cornflowerblue}
|
||||
}
|
||||
}
|
49
.config/nvim/lua/user/git_url.lua
Normal file
49
.config/nvim/lua/user/git_url.lua
Normal file
|
@ -0,0 +1,49 @@
|
|||
-- fetches the current line you're on as a remote git web url
|
||||
local function get_git_url()
|
||||
|
||||
-- this gets the full origin like git@github.com:jessebot/onboardme.git
|
||||
local remote_origin = vim.fn.system("git remote get-url origin")
|
||||
|
||||
-- split into git@github.com and jessebot/onboardme.git
|
||||
local base_domain, owner_repo = string.match(remote_origin, "(.*):(.*)")
|
||||
base_domain = string.gsub(base_domain, "^git[@]", "")
|
||||
|
||||
-- generate intial url of git web app
|
||||
local gh_url = "https://" .. base_domain .. "/"
|
||||
|
||||
-- git repo root directory
|
||||
local git_root_dir = vim.fn.system("git rev-parse --show-prefix"):gsub("[\n\r]", " ")
|
||||
-- get the name of the current opened file
|
||||
local current_file = vim.fn.expand('%:t')
|
||||
-- get the current line number
|
||||
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
|
||||
-- combine file path, naem of file, and line number
|
||||
local file_line = git_root_dir .. current_file .. "#L" .. current_line
|
||||
file_line = string.gsub(file_line, "%s+", "")
|
||||
|
||||
-- get name of branch
|
||||
local branch = vim.fn.system("git branch --show")
|
||||
|
||||
-- changes jessebot/onboardme.git to jessebot/onboardme/blob/main/
|
||||
local repo_branch_url = owner_repo:gsub(".git", "/blob/" .. branch)
|
||||
|
||||
-- combines https://github.com/ + jessebot/onboardme/blob/main/ + path/file.txt#1
|
||||
gh_url = gh_url .. repo_branch_url .. "/" .. file_line
|
||||
|
||||
-- remove all new lines and white space
|
||||
gh_url = string.gsub(gh_url, "%s+", "")
|
||||
gh_url = string.gsub(gh_url, "[\n\r]", "")
|
||||
|
||||
print("External git link is:")
|
||||
print(gh_url)
|
||||
end
|
||||
|
||||
-- adds a command called :GitUrl
|
||||
vim.api.nvim_create_user_command(
|
||||
'GitUrl',
|
||||
function()
|
||||
get_git_url()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
39
.config/nvim/lua/user/gitsigns.lua
Normal file
39
.config/nvim/lua/user/gitsigns.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
require('gitsigns').setup({
|
||||
signs = {
|
||||
add = { text = '│' },
|
||||
change = { text = '│' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = false, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
})
|
8
.config/nvim/lua/user/guard.lua
Normal file
8
.config/nvim/lua/user/guard.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
-- https://github.com/nvimdev/guard.nvim
|
||||
{
|
||||
cmd = "hadolint",
|
||||
args = "",
|
||||
fname = "Dockerfile",
|
||||
stdin = true,
|
||||
timeout = "30", --integer
|
||||
}
|
39
.config/nvim/lua/user/indent.lua
Normal file
39
.config/nvim/lua/user/indent.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
-- --------------------------------------------------------------------------
|
||||
-- INDENT ZONE
|
||||
-- --------------------------------------------------------------------------
|
||||
vim.opt.tabstop = 8
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
|
||||
-- Enable file type detection. Use the default filetype settings, so that mail
|
||||
-- gets 'tw' set to 72, 'cindent' is on in C files, etc.
|
||||
-- Also load indent files, to automatically do language-dependent indenting.
|
||||
-- filetype plugin indent on
|
||||
|
||||
-- ref: https://github.com/lukas-reineke/indent-blankline.nvim
|
||||
|
||||
local highlight = {
|
||||
"DarkBlueGray",
|
||||
"BlueGray"
|
||||
}
|
||||
|
||||
local hooks = require "ibl.hooks"
|
||||
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "DarkBlueGray", { fg = "#47476c" })
|
||||
vim.api.nvim_set_hl(0, "BlueGray", { fg = "#5b5b8b" })
|
||||
end)
|
||||
|
||||
require("ibl").setup {
|
||||
indent = { highlight = highlight },
|
||||
|
||||
-- :echo &filetype
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"dashboard",
|
||||
"markdown"
|
||||
}
|
||||
}
|
||||
}
|
121
.config/nvim/lua/user/keymap.lua
Normal file
121
.config/nvim/lua/user/keymap.lua
Normal file
|
@ -0,0 +1,121 @@
|
|||
-- ~~~~~~~~~~~~~~~~~~~~~~~ Key Mappings for Neovim ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
-- leader key is the default modifier key for neovim. We map leader to <Space>
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Enter to fold code (collapses code block)
|
||||
vim.keymap.set('n', '<enter>', 'za')
|
||||
|
||||
-- neotree - launches a file browser on the left hand side of the screen
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>n',
|
||||
'<cmd>NeoTreeShowToggle<cr>',
|
||||
{ desc = "🌳 Neotree - a file browser tree for neovim" }
|
||||
)
|
||||
|
||||
-- ---------------------- markdown table formatting -------------------------
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>tm',
|
||||
'<cmd>TableModeToggle<cr>',
|
||||
{ desc = " Table Mode - format your markdown tables as you go" }
|
||||
)
|
||||
|
||||
-- ------------------------ terminal windows ----------------------------
|
||||
|
||||
-- CTRL+t keybindings to toggle terminal
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<C-t>',
|
||||
'<CMD>ToggleTerm<CR>',
|
||||
{ desc = " ToggleTerm - terminal for neovim" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
't',
|
||||
'<C-t>',
|
||||
'<C-\\><C-n><CMD>ToggleTerm<CR>',
|
||||
{ desc = " ToggleTerm - terminal for neovim" }
|
||||
)
|
||||
|
||||
-- ------------------------ external app windows -----------------------------
|
||||
|
||||
-- cmatrix - goofy "The Matrix" terminal wallpaper
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>M',
|
||||
'<cmd>Matrix<cr>',
|
||||
{ desc = " The Matrix™️" }
|
||||
)
|
||||
|
||||
-- gitui - a TUI for git
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>g',
|
||||
'<cmd>Gitui<cr>',
|
||||
{ desc = " gitui - terminal UI for git" }
|
||||
)
|
||||
|
||||
-- k9s - a TUI dashboard for k8s
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>K',
|
||||
'<cmd>K9s<cr>',
|
||||
{ desc = " k9s - kubernetes dashboard" }
|
||||
)
|
||||
|
||||
-- bpython - colorful and rich python interpretter
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>p',
|
||||
'<cmd>Bpython<cr>',
|
||||
{ desc = " bpython - color + docs in interactive python" }
|
||||
)
|
||||
|
||||
-- ---------------------- Telescope windows ----------------------------
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
"<leader>:",
|
||||
"<cmd>Telescope commands<cr>",
|
||||
{ desc = "🔭 All Commands" }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>H',
|
||||
'<cmd>Telescope highlights<CR>',
|
||||
{ desc = "🔭 Telescope for highlight groups in current buffer" }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>h',
|
||||
'<cmd>Telescope command_history<CR>',
|
||||
{ desc = "🔭 Telescope for command history" }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
"<leader>ff",
|
||||
"<cmd>Telescope find_files<cr>",
|
||||
{ desc = "🔭 Find Files (cwd)" }
|
||||
)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
"<leader>fr",
|
||||
"<cmd>Telescope oldfiles<cr>",
|
||||
{ desc = "🔭 Files Recently Opened in Neovim" }
|
||||
)
|
||||
|
||||
-- --------------------------- Diagnostics ------------------------------
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>d",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
{
|
||||
silent = true,
|
||||
noremap = true,
|
||||
desc = "🐛 Diagnostics for the active buffer"
|
||||
}
|
||||
)
|
466
.config/nvim/lua/user/lazy.lua
Normal file
466
.config/nvim/lua/user/lazy.lua
Normal file
|
@ -0,0 +1,466 @@
|
|||
-- installs lazy, our plugin manager for neovim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local plugins = {
|
||||
-- ------------ makes sure the nerdfont icons and colorscheme ------------
|
||||
-- preferred colorscheme right now
|
||||
{
|
||||
'space-chalk/spacechalk.nvim',
|
||||
lazy = false, -- loaded during startup since it's the main colorscheme
|
||||
priority = 1000, -- load this before all other start plugins
|
||||
config = function()
|
||||
-- load the colorscheme here
|
||||
vim.cmd.colorscheme('spacechalk')
|
||||
vim.g.colors_name = 'spacechalk'
|
||||
end,
|
||||
},
|
||||
-- -------------------- startup screen for neovim ------------------------
|
||||
{
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
}
|
||||
},
|
||||
-- -------------------------- status line --------------------------------
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
lazy = false,
|
||||
priority = 900, -- load this b4 all other plugins, except colorscheme
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
},
|
||||
|
||||
-- --------------- fancy terminal, use CTRL+t to try it out --------------
|
||||
{
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = "*",
|
||||
opts = {--[[ things you want to change go here]]}
|
||||
}
|
||||
},
|
||||
|
||||
-- -------------------- floating window plugins --------------------------
|
||||
-- -----------------------------------------------------------------------
|
||||
-- noicer ui - experimental
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
enabled = false,
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
-- bottom_search = true,
|
||||
-- command_palette = true,
|
||||
long_message_to_split = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<S-Enter>",
|
||||
function()
|
||||
require("noice").redirect(vim.fn.getcmdline())
|
||||
end,
|
||||
mode = "c",
|
||||
desc = "Redirect Cmdline"
|
||||
},
|
||||
{
|
||||
"<leader>nl",
|
||||
function()
|
||||
require("noice").cmd("last")
|
||||
end,
|
||||
desc = "Noice Last Message"
|
||||
},
|
||||
{
|
||||
"<leader>nh",
|
||||
function()
|
||||
require("noice").cmd("history")
|
||||
end,
|
||||
desc = "Noice History"
|
||||
},
|
||||
{
|
||||
"<leader>na",
|
||||
function()
|
||||
require("noice").cmd("all")
|
||||
end,
|
||||
desc = "Noice All"
|
||||
},
|
||||
{
|
||||
"<c-f>",
|
||||
function()
|
||||
if not require("noice.lsp").scroll(4) then return "<c-f>" end
|
||||
end,
|
||||
silent = true,
|
||||
expr = true,
|
||||
desc = "Scroll forward",
|
||||
mode = {"i", "n", "s"}
|
||||
},
|
||||
{
|
||||
"<c-b>",
|
||||
function()
|
||||
if not require("noice.lsp").scroll(-4) then return "<c-b>" end
|
||||
end,
|
||||
silent = true,
|
||||
expr = true,
|
||||
desc = "Scroll backward",
|
||||
mode = {"i", "n", "s"}
|
||||
},
|
||||
},
|
||||
},
|
||||
-- ------------------ sidebar file directory tree -----------------------
|
||||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
cmd = "Neotree",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
},
|
||||
-- ---------------- scroll bar for the right hand side -------------------
|
||||
{
|
||||
"petertriho/nvim-scrollbar"
|
||||
},
|
||||
-- ------------------------------ tab line -------------------------------
|
||||
{
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = {'nvim-tree/nvim-web-devicons'},
|
||||
lazy = true,
|
||||
},
|
||||
-- this was for barbeque before it was replaced with dropbar.api
|
||||
-- {
|
||||
-- kinds = {
|
||||
-- File = "",
|
||||
-- Module = "",
|
||||
-- Namespace = "",
|
||||
-- Package = "",
|
||||
-- Class = "",
|
||||
-- Method = "",
|
||||
-- Property = "",
|
||||
-- Field = "🌾",
|
||||
-- Constructor = "",
|
||||
-- Enum = "",
|
||||
-- Interface = "",
|
||||
-- Function = "",
|
||||
-- Variable = "",
|
||||
-- Constant = "",
|
||||
-- String = "",
|
||||
-- Number = "",
|
||||
-- Boolean = "",
|
||||
-- Array = "",
|
||||
-- Object = "",
|
||||
-- Key = "",
|
||||
-- Null = "",
|
||||
-- EnumMember = "",
|
||||
-- Struct = "",
|
||||
-- Event = "",
|
||||
-- Operator = "",
|
||||
-- TypeParameter = "",
|
||||
-- },
|
||||
-- },
|
||||
-- code refence at top of window
|
||||
{
|
||||
'Bekaboo/dropbar.nvim',
|
||||
version = "v14.1.0",
|
||||
-- optional, but required for fuzzy finder support
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make'
|
||||
},
|
||||
config = function()
|
||||
local dropbar_api = require('dropbar.api')
|
||||
vim.keymap.set('n', '<Leader>;', dropbar_api.pick, { desc = 'Pick symbols in winbar' })
|
||||
vim.keymap.set('n', '[;', dropbar_api.goto_context_start, { desc = 'Go to start of current context' })
|
||||
vim.keymap.set('n', '];', dropbar_api.select_next_context, { desc = 'Select next context' })
|
||||
end
|
||||
},
|
||||
-- ------------------ dimming inactive windows ---------------------------
|
||||
{
|
||||
'levouh/tint.nvim',
|
||||
opts = function()
|
||||
require("tint").setup()
|
||||
end
|
||||
},
|
||||
|
||||
-- puts a git + or - in side line to show git changes in file
|
||||
{
|
||||
'lewis6991/gitsigns.nvim'
|
||||
},
|
||||
-- ---------------- syntax highlighting installer ------------------------
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
priority = 700, -- load this after colorscheme, statusline, and lsp
|
||||
config = function()
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevelstart = 99
|
||||
end,
|
||||
build = ":TSUpdateSync"
|
||||
},
|
||||
-- add visual lines for indentation
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl"
|
||||
},
|
||||
-- because indenting is still broken in treesitter for python
|
||||
-- ref: https://github.com/nvim-treesitter/nvim-treesitter/issues/1136
|
||||
{
|
||||
"yioneko/nvim-yati",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
-- to dim surround code 'junegunn/limelight.config/vim'
|
||||
-- {'junegunn/limelight.vim'},
|
||||
-- this replaces limelight, still in testing phase
|
||||
{
|
||||
'folke/twilight.nvim'
|
||||
},
|
||||
-- for markdown tables -- maybe not working?
|
||||
{
|
||||
'dhruvasagar/vim-table-mode'
|
||||
},
|
||||
|
||||
-- markdown table of contents generator
|
||||
{
|
||||
'mzlogin/vim-markdown-toc'
|
||||
},
|
||||
|
||||
-- formatting helm charts properly
|
||||
{
|
||||
'towolf/vim-helm',
|
||||
ft = {'helm'},
|
||||
enabled = true,
|
||||
},
|
||||
-- ---------------- Language Server Protocol Plugins ---------------------
|
||||
-- snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (not jit.os:find("Windows"))
|
||||
and "echo -e 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp"
|
||||
or nil,
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
opts = {
|
||||
history = true,
|
||||
delete_check_events = "TextChanged",
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
require("luasnip").jump(1)
|
||||
end,
|
||||
mode = "s"
|
||||
},
|
||||
{
|
||||
"<s-tab>",
|
||||
function()
|
||||
require("luasnip").jump(-1)
|
||||
end,
|
||||
mode = { "i", "s" }
|
||||
},
|
||||
},
|
||||
},
|
||||
-- --------- completion for the above language servers and more ----------
|
||||
-- our preferred neovim autocompletion plugin
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
-- load cmp on InsertEnter
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'hrsh7th/cmp-buffer',
|
||||
'hrsh7th/cmp-path',
|
||||
'hrsh7th/cmp-cmdline',
|
||||
-- emojis and nerfont icon completions
|
||||
'hrsh7th/cmp-emoji',
|
||||
'chrisgrieser/cmp-nerdfont',
|
||||
-- nvim lua api completion
|
||||
'hrsh7th/cmp-nvim-lua'
|
||||
},
|
||||
},
|
||||
-- this helps to configure the built-in language server protocol for nvim
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
lazy = false,
|
||||
priority = 800, -- load this after colorscheme and statusline
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
-- :MasonUpdate updates LSP installer registry contents
|
||||
-- :TSUpdateSync updates the nvim_treesitter compiling stuff
|
||||
build = {":MasonUpdate", ":TSUpdateSync"}
|
||||
},
|
||||
-- may replace null-ls since was deprecated
|
||||
-- https://github.com/nvimdev/guard.nvim
|
||||
--{
|
||||
-- 'nvimdev/guard.nvim'
|
||||
--},
|
||||
-- Diagnostics with leader key + d
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
cmd = {
|
||||
'Trouble',
|
||||
'TroubleToggle'
|
||||
},
|
||||
opts = function()
|
||||
require("trouble").setup {
|
||||
-- leave it empty to use the default settings
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"folke/trouble.nvim"
|
||||
},
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
}
|
||||
},
|
||||
-- ------------------- fuzzy completion for files ------------------------
|
||||
-- telescope: extendable fuzzy finder over lists
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
version = false, -- telescope did only one release, so use HEAD for now
|
||||
cmd = "Telescope",
|
||||
dependencies = {'nvim-lua/plenary.nvim'},
|
||||
key = {
|
||||
{
|
||||
"<leader>:",
|
||||
"<cmd>Telescope commands<cr>",
|
||||
desc = "All Commands"
|
||||
},
|
||||
{
|
||||
"<leader>H",
|
||||
"<cmd>Telescope highlights<cr>",
|
||||
desc = "Highlight groups for the current buffer"
|
||||
},
|
||||
{
|
||||
"<leader>h",
|
||||
"<cmd>Telescope command_history<cr>",
|
||||
desc = "Command History"
|
||||
},
|
||||
{
|
||||
"<leader>ff",
|
||||
"<cmd>Telescope files<cr>",
|
||||
desc = "Find Files (cwd)"
|
||||
},
|
||||
{
|
||||
"<leader>fr",
|
||||
"<cmd>Telescope oldfiles<cr>",
|
||||
desc = "Files Recently Opened in Neovim"
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
-- add gitbrowse to easily get git url
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
gitbrowse = {
|
||||
-- your gitbrowse configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
||||
},
|
||||
-- --------------------- Language Specific Stuff -------------------------
|
||||
{
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
-- for highlighting hex colors
|
||||
ft = {'css', 'lua', 'vim', 'html', 'js', 'scss'},
|
||||
},
|
||||
-- logging syntax and highlighting -- 'mtdl9/vim-log-highlighting'
|
||||
{
|
||||
'mtdl9/vim-log-highlighting'
|
||||
},
|
||||
-- terraform commands for neovim :)
|
||||
{
|
||||
'hashivim/vim-terraform',
|
||||
ft = "terraform",
|
||||
},
|
||||
-- search/replace in multiple files -- untested
|
||||
{
|
||||
"windwp/nvim-spectre",
|
||||
lazy = true,
|
||||
-- stylua: ignore
|
||||
},
|
||||
-- a help menu for which key does what
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
require('user.keymap')
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
},
|
||||
{
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
lazy = true
|
||||
},
|
||||
-- preview markdown in a web browser
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
ft = { "markdown" },
|
||||
build = function() vim.fn["mkdp#util#install"]() end,
|
||||
},
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
-- highlighting for grafana alloy files
|
||||
-- was "grafana/vim-alloy" https://github.com/grafana/vim-alloy
|
||||
-- now we use the below fork
|
||||
{
|
||||
"jessebot/vim-alloy"
|
||||
}
|
||||
}
|
||||
|
||||
require("lazy").setup(plugins)
|
178
.config/nvim/lua/user/lsp-configs.lua
Normal file
178
.config/nvim/lua/user/lsp-configs.lua
Normal file
|
@ -0,0 +1,178 @@
|
|||
-- makes sure the language servers configured later with lspconfig are
|
||||
-- actually available, and install them automatically if they're not
|
||||
-- !! THIS MUST BE CALLED BEFORE ANY LANGUAGE SERVER CONFIGURATION
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup {
|
||||
-- automatically install language servers setup below for lspconfig
|
||||
automatic_installation = true,
|
||||
ensure_installed = { "bashls", "jedi_language_server", "ruff", "lua_ls" }
|
||||
}
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
-- all of the below are referenced from the neovim nvim-lspconfig repo
|
||||
-- github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
|
||||
-- Setup the language servers so that they're available for our LSP client.
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
-- ansible
|
||||
lspconfig.ansiblels.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- bash
|
||||
lspconfig.bashls.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- docker
|
||||
-- when this is enabled in neovim 0.9.0+, it can compete with treesitter for
|
||||
-- highlighting, for more info, see :h lsp-semantic-highlighting
|
||||
lspconfig.dockerls.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- helm
|
||||
local configs = require('lspconfig.configs')
|
||||
local util = require('lspconfig.util')
|
||||
|
||||
if not configs.helm_ls then
|
||||
configs.helm_ls = {
|
||||
default_config = {
|
||||
cmd = {"helm_ls", "serve"},
|
||||
filetypes = {'helm'},
|
||||
root_dir = function(fname)
|
||||
return util.root_pattern('Chart.yaml')(fname)
|
||||
end,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
lspconfig.helm_ls.setup {
|
||||
filetypes = {"helm"},
|
||||
cmd = {"helm_ls", "serve"},
|
||||
}
|
||||
|
||||
-- json
|
||||
lspconfig.jsonls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = {
|
||||
["https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"] = "/*/fastfetch/config.jsonc",
|
||||
["https://docs.renovatebot.com/renovate-schema.json"] = "/*/renovate.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- lua
|
||||
lspconfig.lua_ls.setup{
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- version of Lua you're using (LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim`
|
||||
globals = {'vim'},
|
||||
},
|
||||
-- workspace = {
|
||||
-- -- Make the server aware of Neovim runtime
|
||||
-- library = vim.api.nvim_get_runtime_file("", true),
|
||||
-- },
|
||||
-- Do not send telemetry data containing a randomized but unique
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- markdown
|
||||
lspconfig.marksman.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- python
|
||||
lspconfig.jedi_language_server.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- python - ruff linting
|
||||
lspconfig.ruff.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- rust
|
||||
lspconfig.rust_analyzer.setup{
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- terraform
|
||||
lspconfig.terraformls.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- Terraform linter that can act as lsp server.
|
||||
-- Installation ref: https://github.com/terraform-linters/tflint#installation
|
||||
lspconfig.tflint.setup{}
|
||||
|
||||
-- toml
|
||||
lspconfig.taplo.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- vim -- will be removed when I finish converting everything to lua
|
||||
lspconfig.vimls.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- yaml
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls
|
||||
lspconfig.yamlls.setup {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.3-standalone-strict/all.json"] = "/manifests/*",
|
||||
["https://json.schemastore.org/github-workflow.json"] = "*/.github/workflows/*",
|
||||
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json"] = "/*argocd_app.yaml",
|
||||
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/applicationset_v1alpha1.json"] = "/*argocd_appset.yaml",
|
||||
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/appproject_v1alpha1.json"] = "/*argocd_project.yaml",
|
||||
["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/external-secrets.io/externalsecret_v1beta1.json"] = "/external_secrets/*",
|
||||
[""] = ""
|
||||
},
|
||||
}},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = ' ',
|
||||
[vim.diagnostic.severity.WARN] = ' ',
|
||||
[vim.diagnostic.severity.INFO] = ' ',
|
||||
[vim.diagnostic.severity.HINT] = ' ',
|
||||
},
|
||||
linehl = {
|
||||
[vim.diagnostic.severity.ERROR] = 'ErrorMsg',
|
||||
},
|
||||
numhl = {
|
||||
[vim.diagnostic.severity.WARN] = 'WarningMsg',
|
||||
},
|
||||
},
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
})
|
142
.config/nvim/lua/user/lualine.lua
Normal file
142
.config/nvim/lua/user/lualine.lua
Normal file
|
@ -0,0 +1,142 @@
|
|||
-- Bubbles config for lualine
|
||||
-- original author: lokesh-krishna
|
||||
-- MIT license
|
||||
|
||||
--- Background for branch and file format blocks
|
||||
--- s:gui_termbg = '#585858'
|
||||
--- Foreground for branch and file format blocks
|
||||
--- s:gui_termfg = '#c2ff87'
|
||||
|
||||
--- Background for middle block
|
||||
--- s:gui_termbg2 = '#3E3E3E'
|
||||
--- Foreground for middle block
|
||||
--- s:gui_termfg2 = '#5f87ff'
|
||||
|
||||
--- Background for normal mode and file position blocks
|
||||
--- s:gui_normalbg = '#5F87FF'
|
||||
--- Foreground for normal mode and file position blocks
|
||||
--- s:gui_normalfg = '#323232'
|
||||
|
||||
--- Background for insert mode and file position blocks
|
||||
--- s:gui_insertbg = '#a8fd57'
|
||||
--- Foreground for insert mode and file position blocks
|
||||
--- s:gui_insertfg = '#1d2652'
|
||||
|
||||
--- Background for visual mode and file position blocks
|
||||
--- s:gui_visualbg = '#2569aa'
|
||||
--- Foreground for visual mode and file position blocks
|
||||
--- s:gui_visualfg = '#a8fd57'
|
||||
|
||||
--- Background for replace mode and file position blocks
|
||||
--- s:gui_replacebg = '#f289f9'
|
||||
--- Foreground for replace mode and file position blocks
|
||||
--- s:gui_replacefg = '#323232'
|
||||
|
||||
--- Modified file alert color
|
||||
--- s:gui_alert = '#fdcd36'
|
||||
|
||||
--- Background for inactive mode
|
||||
--- s:gui_inactivebg = '#232336'
|
||||
--- Foreground for inactive mode
|
||||
--- s:gui_inactivefg = '#585858'
|
||||
|
||||
--- this is for all warnings and errors in the final section
|
||||
--- s:WARNING = [ "#323232", "#f6f76a", 237, 226 ]
|
||||
--- s:ERROR = [ "#323232", "#f289f9", 15, 167 ]
|
||||
|
||||
-- stylua: ignore
|
||||
local colors = {
|
||||
black = '#232336',
|
||||
blue = '#5F87FF',
|
||||
cyan = '#79dac8',
|
||||
green = '#a8fd57',
|
||||
grey = '#303030',
|
||||
red = '#ff5189',
|
||||
violet = '#d183e8',
|
||||
white = '#c6c6c6',
|
||||
}
|
||||
|
||||
local bubbles_theme = {
|
||||
normal = {
|
||||
a = { fg = colors.black, bg = colors.blue },
|
||||
b = { fg = colors.white, bg = colors.grey },
|
||||
c = { fg = colors.black, bg = colors.black },
|
||||
},
|
||||
|
||||
insert = { a = { fg = colors.black, bg = colors.green } },
|
||||
visual = { a = { fg = colors.black, bg = colors.cyan } },
|
||||
replace = { a = { fg = colors.black, bg = colors.red } },
|
||||
|
||||
inactive = {
|
||||
a = { fg = colors.white, bg = colors.black },
|
||||
b = { fg = colors.white, bg = colors.black },
|
||||
c = { fg = colors.black, bg = colors.black },
|
||||
},
|
||||
}
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = bubbles_theme,
|
||||
component_separators = '|',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{ 'mode', separator = { left = '' }, right_padding = 2 },
|
||||
},
|
||||
lualine_b = {
|
||||
{'filename',
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 1, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
-- for other components. (terrible name, any suggestions?)
|
||||
symbols = {
|
||||
modified = '[+]', -- Text to show when the file is modified.
|
||||
readonly = '🛑', -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = '[No Name]', -- Text to show for unnamed buffers.
|
||||
newfile = '🆕', -- Text to show for newly created file before first write
|
||||
}
|
||||
},
|
||||
{'branch'},
|
||||
{
|
||||
'diff',
|
||||
diff_color = {
|
||||
added = 'LualineGitAdd', -- Changes the diff's added color
|
||||
modified = 'LualineGitChange', -- Changes the diff's modified color
|
||||
removed = 'LualineGitDelete', -- Changes the diff's removed color you
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
lualine_c = { 'fileformat' },
|
||||
lualine_x = {},
|
||||
lualine_y = {
|
||||
'diagnostics',
|
||||
'progress',
|
||||
{ 'location', separator = { right = '' }, left_padding = 2 },
|
||||
},
|
||||
lualine_z = {
|
||||
{
|
||||
function()
|
||||
return " " .. os.date("%R")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = { 'filename' },
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
}
|
42
.config/nvim/lua/user/neo-tree.lua
Normal file
42
.config/nvim/lua/user/neo-tree.lua
Normal file
|
@ -0,0 +1,42 @@
|
|||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
require("neo-tree").setup(
|
||||
{
|
||||
close_if_last_window = true, -- Close Neo-tree if it's last window
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
icon = {
|
||||
folder_closed = " ",
|
||||
folder_open = " ",
|
||||
folder_empty = " ",
|
||||
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
|
||||
-- then these will never be used.
|
||||
default = "",
|
||||
highlight = "NeoTreeFileIcon"
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = false,
|
||||
use_git_status_colors = true,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = " ", -- redundant info if you use git_status_colors on the name
|
||||
modified = " ", -- redundant info if you use git_status_colors on the name
|
||||
deleted = " ",-- can only be used in the git_status source
|
||||
renamed = " ",-- can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = " ",
|
||||
ignored = " ",
|
||||
unstaged = " ",
|
||||
staged = " ",
|
||||
conflict = " ",
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
22
.config/nvim/lua/user/null_ls.lua
Normal file
22
.config/nvim/lua/user/null_ls.lua
Normal file
|
@ -0,0 +1,22 @@
|
|||
-- TODO: replace null_ls because it's being archived, see:
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/issues/1621
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- linting for Dockerfile best practices
|
||||
null_ls.builtins.diagnostics.hadolint,
|
||||
-- markdown linting for actual language
|
||||
-- null_ls.builtins.diagnostics.vale.with {
|
||||
-- filetypes = {
|
||||
-- 'asciidoc',
|
||||
-- 'markdown',
|
||||
-- 'tex',
|
||||
-- 'text',
|
||||
-- },
|
||||
--},
|
||||
-- this should lint github actions
|
||||
null_ls.builtins.diagnostics.actionlint
|
||||
}
|
||||
})
|
7
.config/nvim/lua/user/nvim-colorizer.lua
Normal file
7
.config/nvim/lua/user/nvim-colorizer.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
require("colorizer").setup({
|
||||
css = { rgb_fn = true; };
|
||||
'lua';
|
||||
'vim';
|
||||
'scss';
|
||||
'xml';
|
||||
})
|
63
.config/nvim/lua/user/scrollbar.lua
Normal file
63
.config/nvim/lua/user/scrollbar.lua
Normal file
|
@ -0,0 +1,63 @@
|
|||
require("scrollbar").setup({
|
||||
excluded_filetypes = {
|
||||
"prompt",
|
||||
"TelescopePrompt",
|
||||
"dashboard",
|
||||
"dashboardPrompt"
|
||||
},
|
||||
set_highlights = false,
|
||||
handlers = {
|
||||
cursor = true,
|
||||
diagnostic = true,
|
||||
handle = true,
|
||||
gitsigns = true,
|
||||
-- search = false, -- Requires hlslens
|
||||
},
|
||||
marks = {
|
||||
Error = {
|
||||
text = { "!", "!" },
|
||||
priority = 2,
|
||||
gui=nil,
|
||||
color = nil,
|
||||
cterm=nil,
|
||||
color_nr = nil, -- cterm
|
||||
highlight = "DiagnosticVirtualTextError",
|
||||
},
|
||||
Warn = {
|
||||
text = { "", "" },
|
||||
priority = 3,
|
||||
gui=nil,
|
||||
color = nil,
|
||||
cterm=nil,
|
||||
color_nr = nil, -- cterm
|
||||
highlight = "DiagnosticVirtualTextWarn",
|
||||
},
|
||||
GitAdd = {
|
||||
text = "┆",
|
||||
priority = 7,
|
||||
gui=nil,
|
||||
color = nil,
|
||||
cterm=nil,
|
||||
color_nr = nil, -- cterm
|
||||
highlight = "GitSignsAdd",
|
||||
},
|
||||
GitChange = {
|
||||
text = "┆",
|
||||
priority = 7,
|
||||
gui=nil,
|
||||
color = nil,
|
||||
cterm=nil,
|
||||
color_nr = nil, -- cterm
|
||||
highlight = "GitSignsChange",
|
||||
},
|
||||
GitDelete = {
|
||||
text = "▁",
|
||||
priority = 7,
|
||||
gui=nil,
|
||||
color = nil,
|
||||
cterm=nil,
|
||||
color_nr = nil, -- cterm
|
||||
highlight = "GitSignsDelete",
|
||||
},
|
||||
}
|
||||
})
|
93
.config/nvim/lua/user/toggleterm.lua
Normal file
93
.config/nvim/lua/user/toggleterm.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
-- this file is for customizations for terminal windows in neovim
|
||||
require("toggleterm").setup{
|
||||
-- configuration
|
||||
highlights = {
|
||||
-- highlights which map to a highlight group name and a table of it's values
|
||||
-- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
|
||||
Normal = {
|
||||
guibg = "LualineGitAdd",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
|
||||
-- -------------------------- open normal terminal ----------------------------
|
||||
-- cmatrix must be installed beforehand with brew install cmatrix
|
||||
local cmatrix = Terminal:new({
|
||||
cmd = "cmatrix",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'Matrix',
|
||||
function()
|
||||
cmatrix:toggle()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
||||
|
||||
|
||||
-- ---------------------------- open gitui -----------------------------------
|
||||
-- gitui must be installed beforehand with brew install gitui
|
||||
local gitui = Terminal:new({
|
||||
cmd = "gitui",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'Gitui',
|
||||
function()
|
||||
gitui:toggle()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
||||
|
||||
|
||||
-- ------------------------------ open k9s -----------------------------------
|
||||
-- install k9s beforehand: https://k9scli.io/topics/install/
|
||||
local k9s = Terminal:new({
|
||||
cmd = "k9s",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'K9s',
|
||||
function()
|
||||
k9s:toggle()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
||||
|
||||
|
||||
|
||||
-- ------------------------------ open bpython -------------------------------
|
||||
-- install bpython beforehand: brew install bpython
|
||||
local bpython = Terminal:new({
|
||||
cmd = "bpython",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'Bpython',
|
||||
function()
|
||||
bpython:toggle()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
52
.config/nvim/lua/user/tree-sitter.lua
Normal file
52
.config/nvim/lua/user/tree-sitter.lua
Normal file
|
@ -0,0 +1,52 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"hcl",
|
||||
"html",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"rust",
|
||||
"terraform",
|
||||
"toml",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = true,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (for "all")
|
||||
-- ignore_install = { "toml"},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these're names of parsers and NOT the filetype.
|
||||
-- e.g. disable highlighting for the `tex` filetype, you need to include
|
||||
-- `latex` in this list as this is the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
-- disable = { "toml"},
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
-- python disabled till this is resolved: github.com/nvim-treesitter/nvim-treesitter/issues/1136
|
||||
disable = { "python" },
|
||||
}
|
||||
-- checkout incremental selection:
|
||||
-- https://github.com/LazyVim/LazyVim/blob/7a8ca6222a554bdb78fb8de35404672fc4042302/lua/lazyvim/plugins/treesitter.lua#L57
|
||||
}
|
||||
|
||||
local parser_config = require'nvim-treesitter.parsers'.get_parser_configs()
|
1
.config/nvim/spell/.gitignore
vendored
Normal file
1
.config/nvim/spell/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.spl
|
130
.config/nvim/spell/en.utf-8.add
Normal file
130
.config/nvim/spell/en.utf-8.add
Normal file
|
@ -0,0 +1,130 @@
|
|||
#yperviser
|
||||
.yaml
|
||||
aarch
|
||||
AArch64
|
||||
aarch64
|
||||
ActivityPub
|
||||
AKS
|
||||
AMD64
|
||||
amd64
|
||||
Ansible
|
||||
ApplicationSet
|
||||
ApplicationSets
|
||||
ARM64
|
||||
arm64
|
||||
ARM7
|
||||
AWS
|
||||
B2
|
||||
Backblaze
|
||||
Bitwarden
|
||||
CICD
|
||||
Cloud-Init
|
||||
CNCF
|
||||
COC
|
||||
CockroachDB
|
||||
config
|
||||
CRD
|
||||
DevOps
|
||||
EC2
|
||||
ECS
|
||||
EKS
|
||||
ESO
|
||||
ESXi
|
||||
fediverse
|
||||
FQDN
|
||||
GCP
|
||||
GKE
|
||||
Grafana
|
||||
Hackintosh
|
||||
hackintosh
|
||||
Homebrew
|
||||
hostname
|
||||
hypervisor
|
||||
i386
|
||||
iTerm2
|
||||
JSON
|
||||
k3d
|
||||
k3d
|
||||
k3s
|
||||
k8s
|
||||
K8up
|
||||
k9s
|
||||
Kaniko
|
||||
Kata
|
||||
Keycloak
|
||||
kubectl
|
||||
Kubernetes
|
||||
Kubevirt
|
||||
KVM
|
||||
Kyverno
|
||||
letsencrypt
|
||||
localhost
|
||||
LTS
|
||||
LTSB
|
||||
macOS
|
||||
MetalLB
|
||||
MinIO
|
||||
MkDocs
|
||||
Multipass
|
||||
MySQL
|
||||
NeoMutt
|
||||
neovim
|
||||
Nextcloud
|
||||
NGINX
|
||||
nginx
|
||||
NVIDIA
|
||||
Nvidia
|
||||
nvim
|
||||
nvim-treesitter
|
||||
OIDC
|
||||
OSX
|
||||
passthrough
|
||||
PostgreSQL
|
||||
QEMU
|
||||
QuickStart
|
||||
RDBMS
|
||||
RDP
|
||||
Restic
|
||||
Ryzen
|
||||
S3
|
||||
smol-k8s-lab
|
||||
SOC2
|
||||
SQLite
|
||||
stdout
|
||||
sudo
|
||||
Textualize
|
||||
traefik
|
||||
virtualiser
|
||||
virtualizer
|
||||
VNC
|
||||
VPC
|
||||
VPS
|
||||
WezTerm
|
||||
WSL
|
||||
XDG_CACHE_HOME
|
||||
YAML
|
||||
Zitadel
|
||||
Lua
|
||||
tmux
|
||||
v1
|
||||
smol
|
||||
XDG_CONFIG_HOME
|
||||
BW_CLIENTID
|
||||
ClusterIssuers
|
||||
SSO
|
||||
restic
|
||||
GitLab
|
||||
env
|
||||
Bitnami
|
||||
OpenID
|
||||
jessebot
|
||||
github.com
|
||||
TLDR
|
||||
Pulumi
|
||||
SeaweedFS
|
||||
argo
|
||||
kubelet
|
||||
Infisical
|
||||
ApplicationSet
|
||||
Kargo
|
||||
RBAC
|
51
.config/offlineimap/config
Normal file
51
.config/offlineimap/config
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Offlineimap configuration file for protonmail
|
||||
#
|
||||
# examples on linux: /home/linuxbrew/.linuxbrew/etc/offlineimap.conf.minimal
|
||||
# /home/linuxbrew/.linuxbrew/etc/offlineimap.conf
|
||||
|
||||
[general]
|
||||
accounts = protonmail
|
||||
# this just runs a line of python to env vars below: from os import environ
|
||||
pythonfile = ~/.config/offlineimap/offlineimap_account_setup.py
|
||||
metadata = ~/.cache/offlineimap
|
||||
|
||||
[Account protonmail]
|
||||
remoterepository = protonmail-remote
|
||||
localrepository = protonmail-local
|
||||
|
||||
# this is to make notmuch update tags
|
||||
# postsynchook = ~/.config/offlineimap/postsync.sh
|
||||
|
||||
[Repository protonmail-local]
|
||||
type = Maildir
|
||||
localfolders = ~/.local/share/offlineimap
|
||||
sync_deletes = no
|
||||
|
||||
[Repository protonmail-remote]
|
||||
type = IMAP
|
||||
# These are just environment variables, and won't work without the python file
|
||||
remotehosteval = environ["MAIL_SERVER"]
|
||||
remoteporteval = int(environ["MAIL_PORT"])
|
||||
remoteusereval = environ["MAIL_USER"]
|
||||
remotepasseval = environ["MAIL_PASS"]
|
||||
|
||||
# this part is important for protonmail
|
||||
starttls = yes
|
||||
ssl = no
|
||||
ssl_version = tls1_2
|
||||
sslcacertfile = ~/.config/protonmail/bridge/cert.pem
|
||||
# I don't know what this does
|
||||
expunge = yes
|
||||
|
||||
# section for what folders and labels you pull
|
||||
nametrans = lambda foldername: re.sub ('^Folders.', '', foldername)
|
||||
folderfilter = lambda foldername: foldername not in ['All Mail']
|
||||
|
||||
# this generates a config for neomutt
|
||||
[mbnames]
|
||||
enabled = yes
|
||||
filename = ~/.config/neomutt/mailboxes
|
||||
header = "named-mailboxes \"\" "
|
||||
peritem = "+%(foldername)s"
|
||||
sep = "\nnamed-mailboxes \"\" "
|
||||
footer = "\n"
|
100
.config/offlineimap/generate_neomutt_sidebar.py
Executable file
100
.config/offlineimap/generate_neomutt_sidebar.py
Executable file
|
@ -0,0 +1,100 @@
|
|||
#!/usr/bin/env python3.11
|
||||
"""
|
||||
NAME: generate_neomutt_sidebar.py
|
||||
DESC: generate a prettier neomutt sidebar
|
||||
"""
|
||||
from os import path
|
||||
from xdg import xdg_config_home
|
||||
|
||||
|
||||
# you can change this if you use a different file
|
||||
MAILBOXES_PATH = path.join(xdg_config_home(), 'neomutt/mailboxes')
|
||||
|
||||
|
||||
def fix_naming(foldername=""):
|
||||
"""
|
||||
translate names of folders from a remote location to local location for
|
||||
neomutt to pick up as mailbox names for the sidebar view.
|
||||
We take labels and prepend a nerd font to them
|
||||
this will kind of fake nesting your folders by adding some lines
|
||||
"""
|
||||
# if the folder has a . in it, it might be nested
|
||||
if '.' in foldername:
|
||||
name_sections = foldername.split('.')
|
||||
|
||||
# for labels, we change from "Labels.label" to "ﮉ label"
|
||||
if "Labels" in name_sections[0]:
|
||||
return f"\"ﮉ {name_sections[1]}"
|
||||
|
||||
# Change indenting depending on how many . in the folder name
|
||||
if len(name_sections) == 2:
|
||||
return "\"└── " + name_sections[1].title()
|
||||
elif len(name_sections) == 3:
|
||||
return "\" └── " + name_sections[2].title()
|
||||
else:
|
||||
return foldername.replace("+", " ").title()
|
||||
|
||||
|
||||
def fix_mailboxes_file(mailbox_path=MAILBOXES_PATH,
|
||||
pin_to_top_list=["inbox", "drafts", "sent"],
|
||||
pin_to_bottom_list=["archive", "trash"]):
|
||||
"""
|
||||
Takes list of neomutt named-mailboxes generated in a file with this format:
|
||||
named-mailboxes "" "+INBOX"
|
||||
|
||||
Updates the file to have prettier descriptions like:
|
||||
named-mailboxes " Inbox" "+INBOX"
|
||||
|
||||
Also adds some tree nesting to nested directories.
|
||||
|
||||
Takes optional variables for pin_to_top_list and pin_to_bottom_list,
|
||||
to make sure certian mailboxes are put on the top vs the bottom of the
|
||||
sidebar list
|
||||
"""
|
||||
updated_lines_list = []
|
||||
end_list = []
|
||||
print(pin_to_top_list)
|
||||
|
||||
# open the mailboxes file to fix the naming
|
||||
with open(mailbox_path, 'r') as mailbox_file:
|
||||
for line in mailbox_file.readlines():
|
||||
# we first split on spaces
|
||||
sections = line.split()
|
||||
|
||||
# sometimes there's a space in the folder name; we catch it here
|
||||
if sections[2].endswith('"'):
|
||||
folder = sections[2]
|
||||
else:
|
||||
folder = " ".join(sections[2:])
|
||||
|
||||
# this fixes the folder description
|
||||
folder_description = fix_naming(folder)
|
||||
|
||||
# this is the new updated line for the for file
|
||||
new_line = f"{sections[0]} {folder_description} {folder}\n"
|
||||
|
||||
stripped_folder = folder.replace("+", "").replace('"', '').lower()
|
||||
print(stripped_folder)
|
||||
# make sure this isn't a special folder to be pinned, such as inbox
|
||||
if stripped_folder in pin_to_top_list:
|
||||
new_index = pin_to_top_list.index(stripped_folder)
|
||||
updated_lines_list.insert(new_index, new_line)
|
||||
print("Begin: ", stripped_folder)
|
||||
# pin to bottom list such as Trash
|
||||
elif stripped_folder in pin_to_bottom_list:
|
||||
new_index = pin_to_bottom_list.index(stripped_folder)
|
||||
end_list.insert(new_index, new_line)
|
||||
print("End: ", stripped_folder)
|
||||
else:
|
||||
updated_lines_list.append(new_line)
|
||||
|
||||
with open(mailbox_path, 'w') as mailbox_writing_file:
|
||||
for updated_line in updated_lines_list:
|
||||
mailbox_writing_file.write(updated_line)
|
||||
for updated_end_line in end_list:
|
||||
mailbox_writing_file.write(updated_end_line)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
fix_mailboxes_file()
|
2
.config/offlineimap/offlineimap_account_setup.py
Normal file
2
.config/offlineimap/offlineimap_account_setup.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env python3.11
|
||||
from os import environ
|
2
.config/offlineimap/postsync.sh
Executable file
2
.config/offlineimap/postsync.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
notmuch new
|
||||
notmuch tag -inbox +sent from:$MAIL_USER
|
139
.config/onboardme/config.yml
Normal file
139
.config/onboardme/config.yml
Normal file
|
@ -0,0 +1,139 @@
|
|||
# Config file for the onboardme cli command. #
|
||||
# -------------------------------------------------------------- #
|
||||
# This files should be in: ~/.config/onboardme/config.yaml #
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
---
|
||||
|
||||
log:
|
||||
# Full path to a file you'd like to log to. Creates file if it doesn't exist
|
||||
# if empty, onboardme does not log to a file
|
||||
file: ""
|
||||
# what level of logs to output (debug, info, warn, error)
|
||||
level: "warn"
|
||||
|
||||
# steps refer to a specific function in the list of functions we run
|
||||
steps:
|
||||
# mac specific steps
|
||||
Darwin:
|
||||
- dot_files
|
||||
- packages
|
||||
- font_setup
|
||||
- neovim_setup
|
||||
- cron
|
||||
- sudo_setup
|
||||
# linux specific steps
|
||||
Linux:
|
||||
- dot_files
|
||||
- packages
|
||||
- font_setup
|
||||
- neovim_setup
|
||||
- cron
|
||||
- group_setup
|
||||
|
||||
dot_files:
|
||||
# personal git repo URL for your dot files, defaults to jessebot/dot_files
|
||||
git_url: "https://github.com/jessebot/dot_files.git"
|
||||
# the branch to use for the git repo above, defaults to main
|
||||
git_branch: "main"
|
||||
# this is where the actual git config for your dot files lives
|
||||
# it can't live in ~/.git because that will affect _everything_ under ~/
|
||||
git_config_dir: "~/.config/dot_files"
|
||||
# !!CAREFUL: runs a `git reset --hard`, which will overwite/delete files in
|
||||
# $HOME that conflict with the above defined git repo url and branch.
|
||||
# You should run the following to get the files that would be overwritten:
|
||||
# onboardme -s dot_files
|
||||
# if set to true, then using onboardme -O will toggle it back to false
|
||||
overwrite: false
|
||||
|
||||
# This is the basic package config.
|
||||
package:
|
||||
# Remove any of the below pkg managers to only run the remaining pkg managers
|
||||
managers:
|
||||
# macOS specific steps
|
||||
Darwin:
|
||||
- brew
|
||||
- pip3.12
|
||||
- pipx
|
||||
# Debian/Ubuntu specific steps
|
||||
Linux:
|
||||
- apt
|
||||
- brew
|
||||
- pip3.12
|
||||
- pipx
|
||||
- flatpak
|
||||
- snap
|
||||
# list of extra existing packages groups to install
|
||||
groups:
|
||||
# any package groups in this default section are always installed
|
||||
default:
|
||||
# basic tui stuff to have a nice time in the terminal :)
|
||||
- default
|
||||
# move these package.groups.default to always install them
|
||||
optional:
|
||||
# setting up more python data science specific tooling
|
||||
- data_science
|
||||
# kubernetes and docker tools
|
||||
- devops
|
||||
# gaming always installs gui
|
||||
- gaming
|
||||
# freetube and other gui applications
|
||||
- gui
|
||||
# this configures neomutt and offlineimap
|
||||
- mail
|
||||
# sets up useful music tui stuff for spotify and youtube
|
||||
- music
|
||||
# things like zoom and slack
|
||||
- work
|
||||
|
||||
# 🚧 this section is under construction
|
||||
# cron:
|
||||
# reminders:
|
||||
# lunch:
|
||||
# enabled:
|
||||
# Linux: true
|
||||
# Darwin: true
|
||||
# # daily at noon
|
||||
# schedule: "0 12 * * *"
|
||||
# # whether or not to use the macOS "say" program
|
||||
# # not sure equivilent on linux 🤔
|
||||
# text_to_speech: true
|
||||
# blurb: "It is snack time!"
|
||||
#
|
||||
# take_breaks:
|
||||
# enabled:
|
||||
# Linux: true
|
||||
# Darwin: true
|
||||
# # hourly by default
|
||||
# schedule: "0 * * * *"
|
||||
# text_to_speech: true
|
||||
# blurb: "Take a break from your screen! Consider a glass of water and a short walk to stretch your legs."
|
||||
#
|
||||
# backups:
|
||||
# freetube:
|
||||
# # defaults to daily at 6PM in your local timezone
|
||||
# # you can use this site for schedules: https://crontab-generator.org/
|
||||
# schedule: "0 18 * * *"
|
||||
# files:
|
||||
# - history.db
|
||||
# - playlists.db
|
||||
# - profiles.db
|
||||
# - settings.db
|
||||
# from_dir:
|
||||
# Linux: "~/.config/FreeTube"
|
||||
# Darwin: "~/Library/Application\ Support/FreeTube"
|
||||
# to_dir:
|
||||
# Linux: "~/Nextcloud/freetube/linux"
|
||||
# Darwin: "~/Nextcloud/freetube/macos"
|
||||
|
||||
# 🚧 this section is under construction
|
||||
# known safe remote hosts that you expect to be able to ping and SSH into
|
||||
remote_hosts: []
|
||||
# - 192.168.42.42
|
||||
|
||||
# 🚧 this section is under construction
|
||||
# setup iptable on Linux only
|
||||
firewall: false
|
||||
|
||||
# 🚧 this section is under construction
|
||||
# set wallpapers directory. MacOS: https://apple.stackexchange.com/a/348454
|
||||
# wallpapers_dir: ""
|
416
.config/onboardme/packages.yml
Normal file
416
.config/onboardme/packages.yml
Normal file
|
@ -0,0 +1,416 @@
|
|||
---
|
||||
brew:
|
||||
emoji: "🍺"
|
||||
commands:
|
||||
list: "brew list -1"
|
||||
update: "brew update --quiet"
|
||||
upgrade: "brew upgrade --quiet"
|
||||
install: "brew install "
|
||||
cleanup: "brew cleanup"
|
||||
packages:
|
||||
# these are all for both macOS and Debian
|
||||
default:
|
||||
- nvim
|
||||
# neither macos nor debian are using 3.12 yet, so we have to install it
|
||||
- python@3.12
|
||||
# for working w/ images and making lsimg work, is lorg
|
||||
- imagemagick
|
||||
# cool interactive python with colors + docs
|
||||
- bpython
|
||||
# TUI browser
|
||||
- w3m
|
||||
# less complicated curl
|
||||
- wget
|
||||
# tmux replacement :)
|
||||
- zellij
|
||||
# recording a shell session to share with others
|
||||
- asciinema
|
||||
# scientific calculator
|
||||
- numbat
|
||||
# TUI IDE is neovim
|
||||
- neovim
|
||||
# fuzzy search, helps with completion and searching
|
||||
- fzf
|
||||
# ls replacement written in rust: https://github.com/Peltoche/lsd
|
||||
- lsd
|
||||
# A cat(1) clone with syntax highlighting and Git integration.
|
||||
- bat
|
||||
# pretty formatting and syntax highlighting
|
||||
- rich-cli
|
||||
# file TUI: https://www.geeksforgeeks.org/ranger-a-cli-file-manager/
|
||||
- ranger
|
||||
# cat images in the terminal (e.g. img2sixel imagename.png)
|
||||
- libsixel
|
||||
# ag command: like grep or ack, but more modern, for searching file text
|
||||
- the_silver_searcher
|
||||
# diff, but with colors
|
||||
- colordiff
|
||||
# prettier top alternatives in C++ and Rust respectively
|
||||
# - btop
|
||||
- bottom
|
||||
# quick system metrics, typically used as an MOTD
|
||||
- fastfetch
|
||||
# prettier du/df outputs: https://github.com/muesli/duf
|
||||
- duf
|
||||
# blocky fonts with the options for colors
|
||||
- toilet
|
||||
# less: b/c you get new features if you stay up2date, & brew is up2date
|
||||
- less
|
||||
# The Matrix screensaver for the terminal
|
||||
- cmatrix
|
||||
# terminal user interface for git
|
||||
- gitui
|
||||
# node.js
|
||||
- node
|
||||
# linter for YAML
|
||||
- yamllint
|
||||
# for parsing json via cli
|
||||
- jq
|
||||
# it's like jq but for yaml
|
||||
- yq
|
||||
# search stackoverflow e.g. howdoi extend a dictionary in python
|
||||
- howdoi
|
||||
# get the quick, short text of how to use various commands
|
||||
- tealdeer
|
||||
# password management
|
||||
- bitwarden-cli
|
||||
# TUI for gpg keys, for the lazy, like me
|
||||
- gpg-tui
|
||||
# macOS specific stuff. Won't work with LinuxBrew
|
||||
macOS:
|
||||
# for installing python programs with cli interfaces
|
||||
- pipx
|
||||
# this is installed via apt for linux
|
||||
- git
|
||||
# python 3.11 already ships with Debian bookworm, only needed for macOS
|
||||
- python@3.11
|
||||
# for hiding the top bar on an M1
|
||||
- topnotch
|
||||
# for testing apis and downloading things
|
||||
- curl
|
||||
# current version of bash 😍
|
||||
- bash
|
||||
# so that bash completion stuff works
|
||||
- "bash-completion@2"
|
||||
# FOSS video editoring software https://kdenlive.org/
|
||||
- kdenlive
|
||||
# fonts
|
||||
- "--cask homebrew/cask-fonts/font-mononoki"
|
||||
- "--cask homebrew/cask-fonts/font-symbols-only-nerd-font"
|
||||
- "--cask homebrew/cask-fonts/font-victor-mono"
|
||||
# - "--cask font-hack-nerd-font"
|
||||
# this lets us resize windows on macOS
|
||||
- "--cask rectangle"
|
||||
# default browser (cool looking firefox fork)
|
||||
- "--cask zen"
|
||||
# back browser (regular firefox fork)
|
||||
- "--cask librewolf"
|
||||
# File server cloud replacement
|
||||
- "--cask nextcloud"
|
||||
# wezterm: Rust based terminal the is cross-OS-compatible
|
||||
- "--cask wez/wezterm/wezterm"
|
||||
# gives us the default gnu/linux sed we all know and love
|
||||
- "gnu-sed"
|
||||
# remap keys on macOS
|
||||
# - "--cask karabiner-elements"
|
||||
# primary media player
|
||||
- "--cask vlc"
|
||||
# youtube replacement
|
||||
- "--cask freetube"
|
||||
# firewall
|
||||
- "--cask lulu"
|
||||
# password manager
|
||||
- "--cask bitwarden"
|
||||
# VPN
|
||||
- "--cask protonvpn"
|
||||
# libreoffice is a FOSS office suite that replaces Google Docs/Office365
|
||||
- "--cask libreoffice"
|
||||
# program to keep mac from sleeping
|
||||
- "--cask caffeine"
|
||||
# docker desktop
|
||||
# - "--cask docker"
|
||||
# colima is a docker desktop replacement
|
||||
- colima
|
||||
# opensource video editor
|
||||
- kdenlive
|
||||
devops:
|
||||
# for calculating IPs
|
||||
- ipcalc
|
||||
# this install the minio cli called mc
|
||||
- minio-mc
|
||||
# for github actions linting
|
||||
- actionlint
|
||||
# vale helps with english grammar formatting and markdown formatting
|
||||
- vale
|
||||
# for k8s helm chart development
|
||||
- helm/tap/chart-releaser
|
||||
- chart-testing
|
||||
- norwoodj/tap/helm-docs
|
||||
# for removing passwords or large files from git history
|
||||
- bfg
|
||||
- pyenv
|
||||
- pyenv-virtualenv
|
||||
# docker cli
|
||||
- docker
|
||||
# docker dashboard tui
|
||||
- lazydocker
|
||||
# linter for dockerfiles
|
||||
- hadolint
|
||||
# programming languages and their package managers
|
||||
- go
|
||||
# cli for k8s (kubernetes)
|
||||
- kubectl
|
||||
# kubectl plugin manager
|
||||
- krew
|
||||
# kubecolor, a kubectl colorizer
|
||||
- hidetatz/tap/kubecolor
|
||||
# terminal based dashbaord for k8s
|
||||
- k9s
|
||||
- kompose
|
||||
# package manager for k8s
|
||||
- helm
|
||||
# for kustomize k8s manifest directories
|
||||
- kustomize
|
||||
# gitops continuous delivery for k8s configs
|
||||
- argocd
|
||||
# KinD (Kubernetes in Docker), for small k8s clusters for testing
|
||||
- kind
|
||||
# k3s (slim k8s) in docker
|
||||
- k3d
|
||||
# generating SSL certs and random strings
|
||||
- openssl@3
|
||||
# Bitnami sealed-secrets cli: encrypt secrets in yaml files for gitops
|
||||
# - kubeseal
|
||||
# gitlab cli
|
||||
- glab
|
||||
# github cli
|
||||
- gh
|
||||
# for backups
|
||||
- restic
|
||||
# terraform for building stuff
|
||||
- tfenv
|
||||
- tflint
|
||||
- terraform-docs
|
||||
extras:
|
||||
# installs cargo and rust
|
||||
# - rustup
|
||||
# preview videos in the terminal. commented by default because it is big
|
||||
# - ffmpegthumbnailer
|
||||
# a cow that says things
|
||||
- cowsay
|
||||
# steam locomotive
|
||||
- sl
|
||||
# rainbow text
|
||||
- lolcat
|
||||
# tool for mirroring android screen
|
||||
- scrcpy
|
||||
mail:
|
||||
# fetch your mail locally for neomutt
|
||||
- offlineimap
|
||||
# anti virus mostly for mail
|
||||
- clamav
|
||||
# TUI email client
|
||||
- neomutt
|
||||
# markdown rendering
|
||||
- pandoc
|
||||
# zathura is a document viewer, that is not working yet
|
||||
# - zegervdv/zathura/zathura
|
||||
# - zegervdv/zathura/zathura-pdf-mupdf
|
||||
# proton bridge for getting mail locally
|
||||
- "--cask protonmail-bridge"
|
||||
work:
|
||||
# for work chats
|
||||
- "--cask slack"
|
||||
- "--cask zoom"
|
||||
music:
|
||||
# spotify daemon
|
||||
- spotifyd
|
||||
# spotify TUI: written in rust, but no longer maintained
|
||||
# - spotify-tui
|
||||
# music thing
|
||||
- nuclear
|
||||
Linux:
|
||||
# linuxbrew asks for this
|
||||
- gcc
|
||||
# this should solve font issues :D but...
|
||||
# linuxbrew fonts aren't working for some reason
|
||||
# - "homebrew/linux-fonts/font-mononoki"
|
||||
# - "homebrew/linux-fonts/font-symbols-only-nerd-font"
|
||||
gui:
|
||||
# wezterm: Rust based terminal the is cross-OS-compatible
|
||||
- "wez/wezterm-linuxbrew/wezterm"
|
||||
|
||||
apt:
|
||||
emoji: "🙃"
|
||||
commands:
|
||||
update: "sudo apt-get update -y"
|
||||
upgrade: "sudo apt-get upgrade -y"
|
||||
install: "sudo apt-get install -y --no-install-recommends "
|
||||
cleanup: "sudo apt-get autoremove -y"
|
||||
packages:
|
||||
default:
|
||||
- bash-completion
|
||||
- build-essential
|
||||
# this is just to keep us up to date
|
||||
- git
|
||||
- curl
|
||||
# python development
|
||||
- python3
|
||||
- python3-dev
|
||||
- python3-pip
|
||||
- pipx
|
||||
# needed for python virtual environments, especially for jedi
|
||||
- python3-venv
|
||||
# grep alternative
|
||||
- silversearcher-ag
|
||||
# this should let you use the a yubikey for auth
|
||||
- libpam-yubico
|
||||
# troubleshooting
|
||||
- sysstat
|
||||
# networking and firewall
|
||||
- iptables
|
||||
- net-tools
|
||||
# print a pretty pallete to see all colors the terminal can render
|
||||
- colortest
|
||||
# help fix locale issues
|
||||
- "locales-all"
|
||||
# for installing stuff through ssh - might not be needed with powerline anymore
|
||||
- "openssh-client"
|
||||
devops:
|
||||
- docker-ce
|
||||
# vpn
|
||||
- wireguard
|
||||
# like top but for GPUs
|
||||
- nvtop
|
||||
# was for euporie - notebooks in terminals, but gcc is already installed
|
||||
# by brew so might be able to remove this
|
||||
# - gcc-11
|
||||
gui:
|
||||
# my favorite font :)
|
||||
- fonts-mononoki
|
||||
# package manager we don't use right now
|
||||
# - snapd
|
||||
# package manager for gui apps that we also don't use
|
||||
# - flatpak
|
||||
# this is for android development
|
||||
- adb
|
||||
# needed for freetube
|
||||
- youtube-dl
|
||||
# this lets you install flatpak packages via the gui
|
||||
- gnome-software-plugin-flatpak
|
||||
# gui firewall
|
||||
- gufw
|
||||
# pdf viewer with themeing
|
||||
- zathura
|
||||
# nextcloud is a self hosted file share app
|
||||
- nextcloud-desktop
|
||||
# libreoffice is a FOSS office suite that replaces Google Docs/Office365
|
||||
- libreoffice
|
||||
# GUI interface for pulseaudio, so you can disable audio devices
|
||||
- pavucontrol
|
||||
gaming:
|
||||
# helpful for gaming on linux
|
||||
- "nvidia-driver-libs:i386"
|
||||
- "steam:i386"
|
||||
# to format disks to exFAT; FAT is too thin for modern windows 10 ISOs
|
||||
# - exfat-utils
|
||||
music:
|
||||
- vlc
|
||||
- pulseaudio
|
||||
|
||||
flatpak:
|
||||
emoji: "🫓 "
|
||||
commands:
|
||||
setup: "flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo"
|
||||
list: "flatpak list --user --columns=application"
|
||||
install: "flatpak install --user --app -y "
|
||||
packages:
|
||||
gui:
|
||||
# - "org.freedesktop.Platform/x86_64/21.08"
|
||||
# password manager
|
||||
# - com.bitwarden.desktop
|
||||
# youtube alternative
|
||||
# - io.freetubeapp.FreeTube
|
||||
gaming:
|
||||
- lutris
|
||||
|
||||
snap:
|
||||
emoji: "🫰 "
|
||||
commands:
|
||||
upgrade: "sudo snap refresh"
|
||||
list: "snap list"
|
||||
install: "sudo snap install "
|
||||
packages:
|
||||
gui:
|
||||
- core
|
||||
# screen debugger/sharing tool for android
|
||||
# - scrcpy
|
||||
|
||||
# most of this is actually for powerline, my shell prompt
|
||||
pip3.12:
|
||||
emoji: "🐍"
|
||||
commands:
|
||||
list: "pip3.12 list"
|
||||
# this is just till there's a better solution than pipx for Debian Bookworm
|
||||
# ref: https://salsa.debian.org/cpython-team/python3/-/blob/master/debian/README.venv
|
||||
install: "pip3.12 install --upgrade --user --break-system-packages "
|
||||
# env_vars:
|
||||
# PYTHONUSERBASE: ""
|
||||
packages:
|
||||
default:
|
||||
# pip itself needs to be kept up to up2date
|
||||
- pip
|
||||
# powerline: for the internal ip address prompt segment
|
||||
- netifaces
|
||||
# neovim: needed for neovim's python3 interface, I think
|
||||
- pynvim
|
||||
# powerline: (status line for tmux/BASH), this works on linux
|
||||
- "git+https://github.com/jessebot/powerline@patch-2"
|
||||
# these are powerline extensions
|
||||
- powerline-kubernetes
|
||||
- powerline-gitstatus
|
||||
# python development: linting/auto-linting
|
||||
# - ruff
|
||||
# - flake8
|
||||
# - pyflakes
|
||||
# - autoflake
|
||||
# this is needed to make python respect XDG Base directory specific
|
||||
- xdg_base_dirs
|
||||
music:
|
||||
# powerline: supposed to work spotify info
|
||||
- dbus
|
||||
|
||||
pipx:
|
||||
emoji: "🐍"
|
||||
commands:
|
||||
list: "pipx list"
|
||||
# this is just till there's a better solution than pipx for Debian Bookworm
|
||||
# ref: https://salsa.debian.org/cpython-team/python3/-/blob/master/debian/README.venv
|
||||
install: "pipx install "
|
||||
packages:
|
||||
default:
|
||||
- onboardme
|
||||
# this is for git pre-commits
|
||||
- pre-commit
|
||||
devops:
|
||||
- smol-k8s-lab
|
||||
- poetry
|
||||
- ruff
|
||||
# aws stuff
|
||||
- aws-mfa
|
||||
- euporie
|
||||
# need this for python notebooks
|
||||
# - ipykernel
|
||||
# notebook-driven development platform
|
||||
# - nbdev
|
||||
# this is for markdown notebook docs and such
|
||||
# - quarto
|
||||
# notebooks in the terminal 💚
|
||||
# - jupyterlab
|
||||
# classic python notebooks
|
||||
# - notebook
|
||||
music:
|
||||
# terminal based youtube player
|
||||
- yewtube
|
||||
# python spotify tui: https://github.com/ceuk/spotui
|
||||
- spotui
|
132
.config/powerline/colors.json
Normal file
132
.config/powerline/colors.json
Normal file
|
@ -0,0 +1,132 @@
|
|||
{
|
||||
"colors": {
|
||||
"black": 16,
|
||||
"white": 231,
|
||||
|
||||
"green": 2,
|
||||
"greenyellow": [119, "6dff7c"],
|
||||
"darkestgreen": 22,
|
||||
"darkgreen": 28,
|
||||
"mediumgreen": 70,
|
||||
"brightgreen": 148,
|
||||
|
||||
"skyblue1": 117,
|
||||
"steelblue": 67,
|
||||
"steelblue1": 75,
|
||||
"brightcyan": 159,
|
||||
"mediumcyan": 117,
|
||||
"darkestcyan": 23,
|
||||
"darkcyan": 33,
|
||||
|
||||
"blue": 12,
|
||||
"darkestblue": 24,
|
||||
"darkblue": 31,
|
||||
"cornflowerblue": [69, "5f87ff"],
|
||||
"blueishblack": [17, "232336"],
|
||||
|
||||
"magenta": [213, "ff87ff"],
|
||||
|
||||
|
||||
"red": 1,
|
||||
"darkestred": 52,
|
||||
"darkred": 88,
|
||||
"mediumred": 124,
|
||||
"brightred": 160,
|
||||
"brightestred": 196,
|
||||
|
||||
"darkestpurple": 55,
|
||||
"mediumpurple": 98,
|
||||
"brightpurple": 189,
|
||||
|
||||
"darkorange": 94,
|
||||
"darkorange3": 166,
|
||||
"mediumorange": 166,
|
||||
"brightorange": 208,
|
||||
"brightestorange": 214,
|
||||
|
||||
"yellow": 11,
|
||||
"brightyellow": 220,
|
||||
|
||||
"gray0": 233,
|
||||
"gray1": 235,
|
||||
"gray2": 236,
|
||||
"gray3": 239,
|
||||
"gray4": 240,
|
||||
"gray5": 241,
|
||||
"gray6": 244,
|
||||
"gray7": 245,
|
||||
"gray8": 247,
|
||||
"gray9": 250,
|
||||
"gray10": 252,
|
||||
|
||||
"gray11": 234,
|
||||
"gray90": 254,
|
||||
|
||||
"gray70": [249, "b3b3b3"],
|
||||
|
||||
"lightyellowgreen": 106,
|
||||
"gold3": 178,
|
||||
"orangered": 202,
|
||||
|
||||
"khaki1": 228,
|
||||
|
||||
"solarized:base03": [8, "002b36"],
|
||||
"solarized:base02": [0, "073642"],
|
||||
"solarized:base01": [10, "586e75"],
|
||||
"solarized:base00": [11, "657b83"],
|
||||
"solarized:base0": [12, "839496"],
|
||||
"solarized:base1": [14, "93a1a1"],
|
||||
"solarized:base2": [7, "eee8d5"],
|
||||
"solarized:base3": [15, "fdf6e3"],
|
||||
"solarized:yellow": [3, "b58900"],
|
||||
"solarized:orange": [9, "cb4b16"],
|
||||
"solarized:red": [1, "dc322f"],
|
||||
"solarized:magenta": [5, "d33682"],
|
||||
"solarized:violet": [13, "6c71c4"],
|
||||
"solarized:blue": [4, "268bd2"],
|
||||
"solarized:cyan": [6, "2aa198"],
|
||||
"solarized:green": [2, "859900"]
|
||||
},
|
||||
"gradients": {
|
||||
"dark_GREEN_Orange_red": [
|
||||
[22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 94, 94, 94, 94, 94, 94, 94, 88, 52],
|
||||
["006000", "006000", "006000", "006000", "006000", "006000", "006000", "006000", "006000", "036000", "076000", "0a6000", "0d6000", "106000", "126000", "146000", "166000", "186000", "1a6000", "1b6000", "1d6000", "1e6000", "206000", "216000", "236000", "246000", "256000", "266000", "286000", "296000", "2a6000", "2b6000", "2c6100", "2d6100", "2f6100", "306100", "316100", "326100", "336100", "346100", "356100", "366100", "376100", "386100", "386100", "396100", "3a6100", "3b6100", "3c6100", "3d6100", "3e6100", "3f6100", "406100", "406100", "416100", "426000", "436000", "446000", "456000", "456000", "466000", "476000", "486000", "496000", "496000", "4a6000", "4b6000", "4c6000", "4d6000", "4d6000", "4e6000", "4f6000", "506000", "506000", "516000", "526000", "536000", "536000", "546000", "556000", "566000", "566000", "576000", "586000", "596000", "596000", "5a6000", "5d6000", "616000", "646000", "686000", "6b6000", "6f6000", "726000", "766000", "796000", "7d6000", "806000", "7e5500", "6f3105", "5d0001"]
|
||||
],
|
||||
"GREEN_Orange_red": [
|
||||
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1],
|
||||
["005f00", "015f00", "025f00", "035f00", "045f00", "055f00", "065f00", "075f00", "085f00", "095f00", "0b5f00", "0c5f00", "0d5f00", "0e5f00", "0f5f00", "105f00", "115f00", "125f00", "135f00", "145f00", "165f00", "175f00", "185f00", "195f00", "1a5f00", "1b5f00", "1c5f00", "1d5f00", "1e5f00", "1f5f00", "215f00", "225f00", "235f00", "245f00", "255f00", "265f00", "275f00", "285f00", "295f00", "2a5f00", "2c5f00", "2d5f00", "2e5f00", "2f5f00", "305f00", "315f00", "325f00", "335f00", "345f00", "355f00", "375f00", "385f00", "395f00", "3a5f00", "3b5f00", "3c5f00", "3d5f00", "3e5f00", "3f5f00", "415f00", "425f00", "435f00", "445f00", "455f00", "465f00", "475f00", "485f00", "495f00", "4a5f00", "4c5f00", "4d5f00", "4e5f00", "4f5f00", "505f00", "515f00", "525f00", "535f00", "545f00", "555f00", "575f00", "585f00", "595f00", "5a5f00", "5b5f00", "5c5f00", "5d5f00", "5e5f00", "615f00", "655f00", "685f00", "6c5f00", "6f5f00", "735f00", "765f00", "7a5f00", "7d5f00", "815f00", "845f00", "815200", "702900"]
|
||||
],
|
||||
"green_yellow_red": [
|
||||
[190, 184, 178, 172, 166, 160],
|
||||
["8ae71c", "8ce71c", "8fe71c", "92e71c", "95e71d", "98e71d", "9ae71d", "9de71d", "a0e71e", "a3e71e", "a6e71e", "a8e71e", "abe71f", "aee71f", "b1e71f", "b4e71f", "b6e720", "b9e720", "bce720", "bfe720", "c2e821", "c3e721", "c5e621", "c7e521", "c9e522", "cbe422", "cde322", "cfe222", "d1e223", "d3e123", "d5e023", "d7df23", "d9df24", "dbde24", "dddd24", "dfdc24", "e1dc25", "e3db25", "e5da25", "e7d925", "e9d926", "e9d626", "e9d426", "e9d126", "e9cf27", "e9cc27", "e9ca27", "e9c727", "e9c528", "e9c228", "e9c028", "e9bd28", "e9bb29", "e9b829", "e9b629", "e9b329", "e9b12a", "e9ae2a", "e9ac2a", "e9a92a", "eaa72b", "eaa42b", "eaa22b", "ea9f2b", "ea9d2c", "ea9b2c", "ea982c", "ea962c", "ea942d", "ea912d", "ea8f2d", "ea8d2d", "ea8a2e", "ea882e", "ea862e", "ea832e", "ea812f", "ea7f2f", "ea7c2f", "ea7a2f", "eb7830", "eb7530", "eb7330", "eb7130", "eb6f31", "eb6c31", "eb6a31", "eb6831", "eb6632", "eb6332", "eb6132", "eb5f32", "eb5d33", "eb5a33", "eb5833", "eb5633", "eb5434", "eb5134", "eb4f34", "eb4d34", "ec4b35"]
|
||||
],
|
||||
"green_yellow_orange_red": [
|
||||
[2, 3, 9, 1],
|
||||
["719e07", "739d06", "759c06", "779c06", "799b06", "7b9a05", "7d9a05", "7f9905", "819805", "839805", "859704", "879704", "899604", "8b9504", "8d9504", "8f9403", "919303", "949303", "969203", "989102", "9a9102", "9c9002", "9e9002", "a08f02", "a28e01", "a48e01", "a68d01", "a88c01", "aa8c01", "ac8b00", "ae8a00", "b08a00", "b28900", "b58900", "b58700", "b68501", "b78302", "b78102", "b87f03", "b97d04", "b97b04", "ba7905", "bb7806", "bb7606", "bc7407", "bd7208", "bd7008", "be6e09", "bf6c0a", "bf6a0a", "c0690b", "c1670c", "c1650c", "c2630d", "c3610e", "c35f0e", "c45d0f", "c55b10", "c55a10", "c65811", "c75612", "c75412", "c85213", "c95014", "c94e14", "ca4c15", "cb4b16", "cb4a16", "cc4917", "cc4818", "cd4719", "cd4719", "ce461a", "ce451b", "cf441c", "cf441c", "d0431d", "d0421e", "d1411f", "d1411f", "d24020", "d23f21", "d33e22", "d33e22", "d43d23", "d43c24", "d53b25", "d53b25", "d63a26", "d63927", "d73828", "d73828", "d83729", "d8362a", "d9352b", "d9352b", "da342c", "da332d", "db322e", "dc322f"]
|
||||
],
|
||||
"yellow_red": [
|
||||
[220, 178, 172, 166, 160],
|
||||
["ffd700", "fdd500", "fbd300", "fad200", "f8d000", "f7cf00", "f5cd00", "f3cb00", "f2ca00", "f0c800", "efc700", "edc500", "ebc300", "eac200", "e8c000", "e7bf00", "e5bd00", "e3bb00", "e2ba00", "e0b800", "dfb700", "ddb500", "dbb300", "dab200", "d8b000", "d7af00", "d7ad00", "d7ab00", "d7aa00", "d7a800", "d7a700", "d7a500", "d7a300", "d7a200", "d7a000", "d79f00", "d79d00", "d79b00", "d79a00", "d79800", "d79700", "d79500", "d79300", "d79200", "d79000", "d78f00", "d78d00", "d78b00", "d78a00", "d78800", "d78700", "d78500", "d78300", "d78200", "d78000", "d77f00", "d77d00", "d77b00", "d77a00", "d77800", "d77700", "d77500", "d77300", "d77200", "d77000", "d76f00", "d76d00", "d76b00", "d76a00", "d76800", "d76700", "d76500", "d76300", "d76200", "d76000", "d75f00", "d75b00", "d75700", "d75300", "d74f00", "d74c00", "d74800", "d74400", "d74000", "d73c00", "d73900", "d73500", "d73100", "d72d00", "d72900", "d72600", "d72200", "d71e00", "d71a00", "d71600", "d71300", "d70f00", "d70b00", "d70700"]
|
||||
],
|
||||
"yellow_orange_red": [
|
||||
[3, 9, 1],
|
||||
["b58900", "b58700", "b58600", "b68501", "b68401", "b78202", "b78102", "b88003", "b87f03", "b87d03", "b97c04", "b97b04", "ba7a05", "ba7805", "bb7706", "bb7606", "bc7507", "bc7307", "bc7207", "bd7108", "bd7008", "be6e09", "be6d09", "bf6c0a", "bf6b0a", "c06a0b", "c0680b", "c0670b", "c1660c", "c1650c", "c2630d", "c2620d", "c3610e", "c3600e", "c35e0e", "c45d0f", "c45c0f", "c55b10", "c55910", "c65811", "c65711", "c75612", "c75412", "c75312", "c85213", "c85113", "c94f14", "c94e14", "ca4d15", "ca4c15", "cb4b16", "cb4a16", "cb4a17", "cc4917", "cc4918", "cc4818", "cd4819", "cd4719", "cd471a", "ce461a", "ce461b", "ce451b", "cf451c", "cf441c", "cf441d", "d0431d", "d0431e", "d0421e", "d1421f", "d1411f", "d14120", "d24020", "d24021", "d23f21", "d33f22", "d33e22", "d33e23", "d43d23", "d43d24", "d43c24", "d53c25", "d53b25", "d53b26", "d63a26", "d63a27", "d63927", "d73928", "d73828", "d73829", "d83729", "d8372a", "d8362a", "d9362b", "d9352b", "d9352c", "da342c", "da342d", "da332d", "db332e"]
|
||||
],
|
||||
"blue_red": [
|
||||
[39, 74, 68, 67, 103, 97, 96, 132, 131, 167, 203, 197],
|
||||
["19b4fe", "1bb2fc", "1db1fa", "1faff8", "22aef6", "24adf4", "26abf2", "29aaf0", "2ba9ee", "2da7ec", "30a6ea", "32a5e8", "34a3e6", "36a2e4", "39a0e2", "3b9fe1", "3d9edf", "409cdd", "429bdb", "449ad9", "4798d7", "4997d5", "4b96d3", "4d94d1", "5093cf", "5292cd", "5490cb", "578fc9", "598dc7", "5b8cc6", "5e8bc4", "6089c2", "6288c0", "6487be", "6785bc", "6984ba", "6b83b8", "6e81b6", "7080b4", "727eb2", "757db0", "777cae", "797aac", "7b79ab", "7e78a9", "8076a7", "8275a5", "8574a3", "8772a1", "89719f", "8c709d", "8e6e9b", "906d99", "926b97", "956a95", "976993", "996791", "9c668f", "9e658e", "a0638c", "a3628a", "a56188", "a75f86", "a95e84", "ac5c82", "ae5b80", "b05a7e", "b3587c", "b5577a", "b75678", "ba5476", "bc5374", "be5273", "c05071", "c34f6f", "c54e6d", "c74c6b", "ca4b69", "cc4967", "ce4865", "d14763", "d34561", "d5445f", "d7435d", "da415b", "dc4059", "de3f58", "e13d56", "e33c54", "e53a52", "e83950", "ea384e", "ec364c", "ee354a", "f13448", "f33246", "f53144", "f83042", "fa2e40"]
|
||||
],
|
||||
"white_red": [
|
||||
[231, 255, 223, 216, 209, 202, 196],
|
||||
["ffffff", "fefefe", "fdfdfd", "fdfdfd", "fcfcfc", "fbfbfb", "fafafa", "fafafa", "f9f9f9", "f8f8f8", "f7f7f7", "f7f7f7", "f6f6f6", "f5f5f5", "f4f4f4", "f4f3f4", "f3f3f3", "f2f2f2", "f1f1f1", "f0f0f0", "f0f0f0", "efefef", "eeeeee", "efecea", "f1eae4", "f2e8de", "f3e6d8", "f5e4d3", "f6e2cd", "f7e0c7", "f8dec2", "f9dcbc", "fadab6", "fad8b1", "fbd5ac", "fbd2a9", "fbcea5", "fbcaa1", "fbc79e", "fbc39a", "fbc097", "fbbc93", "fbb88f", "fbb58c", "fab188", "faad85", "faaa81", "fba67e", "fba37a", "fb9f76", "fb9c73", "fb986f", "fb946c", "fb9168", "fa8d65", "fa8961", "fa865c", "fa8256", "fb7f4f", "fb7b48", "fb7841", "fb743a", "fb7133", "fb6d2c", "fa6a23", "fa661a", "fa620e", "fa5f03", "fa5d03", "fa5b03", "fa5a03", "fa5803", "fa5703", "fa5503", "fa5303", "fa5103", "fa4f03", "fa4e03", "fa4c03", "fa4a04", "fa4804", "fa4604", "fa4404", "fa4204", "fa3f04", "fa3d04", "fa3b04", "fa3805", "fa3605", "fa3305", "fb3105", "fb2e05", "fb2a05", "fb2705", "fb2306", "fb1f06", "fb1b06", "fb1506", "fb0e06", "fa0506", "fa0007"]
|
||||
],
|
||||
"dark_green_gray": [
|
||||
[70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247],
|
||||
["51b000", "52b000", "54b000", "55b002", "56b007", "57b00d", "58b011", "59af15", "5aaf18", "5caf1b", "5daf1e", "5eaf21", "5faf23", "60ae25", "61ae27", "62ae2a", "63ae2c", "64ae2e", "65ae30", "66ae31", "67ad33", "68ad35", "69ad37", "69ad38", "6aad3a", "6bad3c", "6cac3d", "6dac3f", "6eac40", "6fac42", "70ac44", "70ac45", "71ab47", "72ab48", "73ab49", "74ab4b", "75ab4c", "75ab4e", "76aa4f", "77aa51", "78aa52", "79aa53", "79aa55", "7aaa56", "7ba957", "7ca959", "7ca95a", "7da95b", "7ea95d", "7fa95e", "7fa85f", "80a861", "81a862", "81a863", "82a865", "83a766", "83a767", "84a768", "85a76a", "85a76b", "86a66c", "87a66d", "87a66f", "88a670", "89a671", "89a672", "8aa574", "8ba575", "8ba576", "8ca577", "8da579", "8da47a", "8ea47b", "8ea47c", "8fa47d", "90a47f", "90a380", "91a381", "91a382", "92a384", "93a385", "93a286", "94a287", "94a288", "95a28a", "95a18b", "96a18c", "97a18d", "97a18e", "98a190", "98a091", "99a092", "99a093", "9aa094", "9aa096", "9b9f97", "9b9f98", "9c9f99", "9c9f9a", "9d9e9c", "9d9e9d"]
|
||||
],
|
||||
"light_green_gray": [
|
||||
[148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 187, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250],
|
||||
["a3d900", "a4d800", "a4d800", "a5d805", "a5d80d", "a6d714", "a6d719", "a6d71d", "a7d621", "a7d625", "a8d628", "a8d62b", "a8d52e", "a9d531", "a9d533", "aad536", "aad438", "aad43a", "abd43d", "abd33f", "abd341", "acd343", "acd345", "acd247", "add249", "add24b", "add14d", "aed14f", "aed151", "aed152", "afd054", "afd056", "afd058", "b0d059", "b0cf5b", "b0cf5d", "b1cf5e", "b1ce60", "b1ce62", "b1ce63", "b2ce65", "b2cd67", "b2cd68", "b3cd6a", "b3cc6b", "b3cc6d", "b3cc6e", "b4cc70", "b4cb71", "b4cb73", "b4cb75", "b5ca76", "b5ca78", "b5ca79", "b5ca7a", "b6c97c", "b6c97d", "b6c97f", "b6c880", "b6c882", "b7c883", "b7c885", "b7c786", "b7c788", "b7c789", "b8c68a", "b8c68c", "b8c68d", "b8c68f", "b8c590", "b9c591", "b9c593", "b9c494", "b9c496", "b9c497", "b9c498", "bac39a", "bac39b", "bac39d", "bac29e", "bac29f", "bac2a1", "bac2a2", "bac1a4", "bbc1a5", "bbc1a6", "bbc0a8", "bbc0a9", "bbc0aa", "bbc0ac", "bbbfad", "bbbfae", "bbbfb0", "bbbeb1", "bcbeb3", "bcbeb4", "bcbdb5", "bcbdb7", "bcbdb8", "bcbdb9", "bcbcbb"]
|
||||
]
|
||||
}
|
||||
}
|
78
.config/powerline/colorschemes/default.json
Normal file
78
.config/powerline/colorschemes/default.json
Normal file
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"name": "Default",
|
||||
"groups": {
|
||||
"information:additional": { "fg": "brightgreen", "bg": "gray4", "attrs": [] },
|
||||
"information:regular": { "fg": "gray10", "bg": "gray4", "attrs": ["bold"] },
|
||||
"information:highlighted": { "fg": "white", "bg": "gray4", "attrs": [] },
|
||||
"information:priority": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] },
|
||||
"warning:regular": { "fg": "white", "bg": "brightred", "attrs": ["bold"] },
|
||||
"critical:failure": { "fg": "white", "bg": "darkestred", "attrs": [] },
|
||||
"critical:success": { "fg": "brightgreen", "bg": "gray2", "attrs": [] },
|
||||
"background": { "fg": "gray2", "bg": "gray2", "attrs": [] },
|
||||
"background:divider": { "fg": "gray2", "bg": "gray2", "attrs": [] },
|
||||
"session": { "fg": "black", "bg": "gray10", "attrs": ["bold"] },
|
||||
"date": { "fg": "gray2", "bg": "cornflowerblue", "attrs": [] },
|
||||
"time": { "fg": "cornflowerblue", "bg": "magenta", "attrs": ["bold"] },
|
||||
"time:divider": { "fg": "cornflowerblue", "bg": "gray3", "attrs": [] },
|
||||
"email_alert": { "fg": "brightorange", "bg": "gray3", "attrs": [] },
|
||||
"email_alert_gradient": { "fg": "white", "bg": "yellow_orange_red", "attrs": ["bold"] },
|
||||
"hostname": { "fg": "cornflowerblue", "bg": "gray2", "attrs": [] },
|
||||
"weather": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"weather_temp_gradient": { "fg": "blue_red", "bg": "gray0", "attrs": [] },
|
||||
"weather_condition_hot": { "fg": "khaki1", "bg": "gray0", "attrs": [] },
|
||||
"weather_condition_snowy": { "fg": "skyblue1", "bg": "gray2", "attrs": [] },
|
||||
"weather_condition_rainy": { "fg": "skyblue1", "bg": "gray0", "attrs": [] },
|
||||
"uptime": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"external_ip": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"internal_ip": { "fg": "cornflowerblue", "bg": "gray2", "attrs": [] },
|
||||
"network_load": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"network_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] },
|
||||
"network_load_sent_gradient": "network_load_gradient",
|
||||
"network_load_recv_gradient": "network_load_gradient",
|
||||
"network_load:divider": "background:divider",
|
||||
"system_load": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"system_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] },
|
||||
"environment_variable": { "fg": "white", "bg": "gray1", "attrs": [] },
|
||||
"cpu_load_percent": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"cpu_load_percent_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0", "attrs": [] },
|
||||
"battery": { "fg": "brightorange", "bg": "gray2", "attrs": [] },
|
||||
"battery_online": { "fg": "green", "bg": "gray2", "attrs": [] },
|
||||
"battery_offline": { "fg": "brightorange", "bg": "gray2", "attrs": [] },
|
||||
"battery_gradient": { "fg": "white_red", "bg": "gray2", "attrs": [] },
|
||||
"battery_full": { "fg": "green", "bg": "gray2", "attrs": [] },
|
||||
"battery_empty": { "fg": "magenta", "bg": "gray2", "attrs": [] },
|
||||
"player": { "fg": "gray10", "bg": "black", "attrs": [] },
|
||||
"user": { "fg": "white", "bg": "darkblue", "attrs": ["bold"] },
|
||||
"branch": { "fg": "gray9", "bg": "gray2", "attrs": [] },
|
||||
"branch_dirty": { "fg": "brightyellow", "bg": "gray2", "attrs": [] },
|
||||
"branch_clean": { "fg": "gray9", "bg": "gray2", "attrs": [] },
|
||||
"branch:divider": { "fg": "gray7", "bg": "gray2", "attrs": [] },
|
||||
"stash": "branch_dirty",
|
||||
"stash:divider": "branch:divider",
|
||||
"newline_prompt": { "fg": "green", "bg": "gray3", "attrs": [] },
|
||||
"cwd": { "fg": "green", "bg": "gray3", "attrs": [] },
|
||||
"cwd:current_folder": { "fg": "greenyellow", "bg": "gray3", "attrs": [] },
|
||||
"cwd:divider": { "fg": "gray7", "bg": "gray3", "attrs": [] },
|
||||
"virtualenv": { "fg": "gray2", "bg": "steelblue1", "attrs": [] },
|
||||
"attached_clients": { "fg": "gray8", "bg": "gray0", "attrs": [] },
|
||||
"gitstatus": { "fg": "gray2", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_branch": { "fg": "gray8", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_branch_clean": { "fg": "green", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_branch_dirty": { "fg": "magenta", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_branch_detached": { "fg": "mediumpurple", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_tag": { "fg": "steelblue", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_behind": { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_ahead": { "fg": "green", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_staged": { "fg": "blue", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_unmerged": { "fg": "brightestorange", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_changed": { "fg": "yellow", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_untracked": { "fg": "brightyellow", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus_stashed": { "fg": "steelblue", "bg": "gray2", "attrs": [] },
|
||||
"gitstatus:divider": { "fg": "gray2", "bg": "gray2", "attrs": [] },
|
||||
"kubernetes_cluster": { "fg": "white", "bg": "darkestblue", "attrs": [] },
|
||||
"kubernetes_cluster:alert": { "fg": "gray2", "bg": "darkestred", "attrs": [] },
|
||||
"kubernetes_namespace": { "fg": "gray2", "bg": "steelblue1", "attrs": [] },
|
||||
"kubernetes_namespace:alert": { "fg": "gray2", "bg": "darkred", "attrs": [] },
|
||||
"kubernetes:divider": { "fg": "darkred", "bg": "darkred", "attrs": [] }
|
||||
}
|
||||
}
|
6
.config/powerline/colorschemes/shell/default.json
Normal file
6
.config/powerline/colorschemes/shell/default.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"name": "Default color scheme for shell prompts",
|
||||
"groups": {
|
||||
"hostname": { "fg": "gray2", "bg": "cornflowerblue", "attrs": [] }
|
||||
}
|
||||
}
|
151
.config/powerline/themes/powerline.json
Normal file
151
.config/powerline/themes/powerline.json
Normal file
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
"dividers": {
|
||||
"left": {
|
||||
"hard": " ",
|
||||
"soft": " "
|
||||
},
|
||||
"right": {
|
||||
"hard": " ",
|
||||
"soft": ""
|
||||
}
|
||||
},
|
||||
"spaces": 1,
|
||||
"segment_data": {
|
||||
"branch": {
|
||||
"before": " "
|
||||
},
|
||||
"stash": {
|
||||
"before": "⌆ "
|
||||
},
|
||||
"cwd": {
|
||||
"args": {
|
||||
"ellipsis": "⋯"
|
||||
}
|
||||
},
|
||||
|
||||
"line_current_symbol": {
|
||||
"contents": " "
|
||||
},
|
||||
"player": {
|
||||
"args": {
|
||||
"state_symbols": {
|
||||
"fallback": "♫ ",
|
||||
"play": "▶",
|
||||
"pause": "▮▮",
|
||||
"stop": "■"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"time": {
|
||||
"before": "⌚ "
|
||||
},
|
||||
|
||||
"powerline.segments.common.net.network_load": {
|
||||
"args": {
|
||||
"recv_format": "⬇ {value:>8}",
|
||||
"sent_format": "⬆ {value:>8}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.net.hostname": {
|
||||
"before": " "
|
||||
},
|
||||
"powerline.segments.common.bat.battery": {
|
||||
"args": {
|
||||
"full_heart": "♥",
|
||||
"empty_heart": "♥",
|
||||
"online": "⚡︎",
|
||||
"offline": " "
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.sys.uptime": {
|
||||
"before": "⇑ "
|
||||
},
|
||||
"powerline.segments.common.mail.email_imap_alert": {
|
||||
"before": "✉ "
|
||||
},
|
||||
"powerline.segments.common.env.virtualenv": {
|
||||
"before": "ⓔ "
|
||||
},
|
||||
"powerline.segments.common.wthr.weather": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"day": "〇",
|
||||
"blustery": "⚑",
|
||||
"rainy": "☔",
|
||||
"cloudy": "☁",
|
||||
"snowy": "❅",
|
||||
"stormy": "☈",
|
||||
"foggy": "≡",
|
||||
"sunny": "☼",
|
||||
"night": "☾",
|
||||
"windy": "☴",
|
||||
"not_available": "<22>",
|
||||
"unknown": "⚠"
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.time.fuzzy_time": {
|
||||
"args": {
|
||||
"unicode_text": true
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.vim.mode": {
|
||||
"args": {
|
||||
"override": {
|
||||
"n": "NORMAL",
|
||||
"no": "N·OPER",
|
||||
"v": "VISUAL",
|
||||
"V": "V·LINE",
|
||||
"^V": "V·BLCK",
|
||||
"s": "SELECT",
|
||||
"S": "S·LINE",
|
||||
"^S": "S·BLCK",
|
||||
"i": "INSERT",
|
||||
"ic": "I·COMP",
|
||||
"ix": "I·C-X ",
|
||||
"R": "RPLACE",
|
||||
"Rv": "V·RPLC",
|
||||
"Rc": "R·COMP",
|
||||
"Rx": "R·C-X ",
|
||||
"c": "COMMND",
|
||||
"cv": "VIM·EX",
|
||||
"ce": "NRM·EX",
|
||||
"r": "PROMPT",
|
||||
"rm": "-MORE-",
|
||||
"r?": "CNFIRM",
|
||||
"!": "!SHELL",
|
||||
"t": "TERM "
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.visual_range": {
|
||||
"args": {
|
||||
"CTRL_V_text": "↕{rows} ↔{vcols}",
|
||||
"v_text_oneline": "↔{vcols}",
|
||||
"v_text_multiline": "↕{rows}",
|
||||
"V_text": "⇕{rows}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.readonly_indicator": {
|
||||
"args": {
|
||||
"text": ""
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.modified_indicator": {
|
||||
"args": {
|
||||
"text": "+"
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.i3wm.scratchpad": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"fresh": "●",
|
||||
"changed": "○"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
155
.config/powerline/themes/powerline_terminus.json
Normal file
155
.config/powerline/themes/powerline_terminus.json
Normal file
|
@ -0,0 +1,155 @@
|
|||
{
|
||||
"dividers": {
|
||||
"left": {
|
||||
"hard": " ",
|
||||
"soft": " "
|
||||
},
|
||||
"right": {
|
||||
"hard": " ",
|
||||
"soft": " "
|
||||
}
|
||||
},
|
||||
"spaces": 1,
|
||||
"segment_data": {
|
||||
"branch": {
|
||||
"before": " "
|
||||
},
|
||||
"stash": {
|
||||
"before": "ST "
|
||||
},
|
||||
"cwd": {
|
||||
"args": {
|
||||
"ellipsis": "…",
|
||||
"use_path_separator": "True"
|
||||
}
|
||||
},
|
||||
|
||||
"line_current_symbol": {
|
||||
"contents": " "
|
||||
},
|
||||
"player": {
|
||||
"args": {
|
||||
"state_symbols": {
|
||||
"fallback": "♫",
|
||||
"play": "▶",
|
||||
"pause": "▮▮",
|
||||
"stop": "■"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"time": {
|
||||
"before": ""
|
||||
},
|
||||
|
||||
"powerline.segments.common.net.network_load": {
|
||||
"args": {
|
||||
"recv_format": "⇓ {value:>8}",
|
||||
"sent_format": "⇑ {value:>8}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.net.hostname": {
|
||||
"before": "ﲾ "
|
||||
},
|
||||
"powerline.segments.common.bat.battery": {
|
||||
"args": {
|
||||
"full_heart": "♥",
|
||||
"empty_heart": "♥",
|
||||
"online": "⚡︎",
|
||||
"offline": " "
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.sys.uptime": {
|
||||
"before": "↑ "
|
||||
},
|
||||
"powerline.segments.common.sys.system_load": {
|
||||
"before": " "
|
||||
},
|
||||
"powerline.segments.common.mail.email_imap_alert": {
|
||||
"before": " "
|
||||
},
|
||||
"powerline.segments.common.env.virtualenv": {
|
||||
"before": "(e) "
|
||||
},
|
||||
"powerline.segments.common.wthr.weather": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"day": "DAY",
|
||||
"blustery": "WIND",
|
||||
"rainy": "RAIN",
|
||||
"cloudy": "CLOUDS",
|
||||
"snowy": "SNOW",
|
||||
"stormy": "STORM",
|
||||
"foggy": "FOG",
|
||||
"sunny": "SUN",
|
||||
"night": "NIGHT",
|
||||
"windy": "WINDY",
|
||||
"not_available": "NA",
|
||||
"unknown": "UKN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.time.fuzzy_time": {
|
||||
"args": {
|
||||
"unicode_text": true
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.vim.mode": {
|
||||
"args": {
|
||||
"override": {
|
||||
"n": "NORMAL",
|
||||
"no": "N·OPER",
|
||||
"v": "VISUAL",
|
||||
"V": "V·LINE",
|
||||
"^V": "V·BLCK",
|
||||
"s": "SELECT",
|
||||
"S": "S·LINE",
|
||||
"^S": "S·BLCK",
|
||||
"i": "INSERT",
|
||||
"ic": "I·COMP",
|
||||
"ix": "I·C-X ",
|
||||
"R": "RPLACE",
|
||||
"Rv": "V·RPLC",
|
||||
"Rc": "R·COMP",
|
||||
"Rx": "R·C-X ",
|
||||
"c": "COMMND",
|
||||
"cv": "VIM·EX",
|
||||
"ce": "NRM·EX",
|
||||
"r": "PROMPT",
|
||||
"rm": "-MORE-",
|
||||
"r?": "CNFIRM",
|
||||
"!": "!SHELL",
|
||||
"t": "TERM "
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.visual_range": {
|
||||
"args": {
|
||||
"CTRL_V_text": "↕{rows} ↔{vcols}",
|
||||
"v_text_oneline": "↔{vcols}",
|
||||
"v_text_multiline": "↕{rows}",
|
||||
"V_text": "⇕{rows}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.readonly_indicator": {
|
||||
"args": {
|
||||
"text": ""
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.modified_indicator": {
|
||||
"args": {
|
||||
"text": "+"
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.i3wm.scratchpad": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"fresh": "●",
|
||||
"changed": "○"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
127
.config/powerline/themes/shell/default.json
Normal file
127
.config/powerline/themes/shell/default.json
Normal file
|
@ -0,0 +1,127 @@
|
|||
{ "segments": {
|
||||
"above": [{
|
||||
"left": [
|
||||
{
|
||||
"function": "powerline.segments.common.net.hostname"
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.env.environment",
|
||||
"name": "docker_enabled",
|
||||
"draw_soft_divider": true,
|
||||
"draw_hard_divider": true,
|
||||
"args": {
|
||||
"variable": "CURRENT_SHELL_LOCATION"
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.net.internal_ip",
|
||||
"priority": 30
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.env.cwd",
|
||||
"priority": 20,
|
||||
"before": " ",
|
||||
"args": {
|
||||
"use_shortened_path": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline_gitstatus.gitstatus",
|
||||
"priority": 40,
|
||||
"draw_soft_divider": false,
|
||||
"draw_hard_divider": true,
|
||||
"args": {
|
||||
"show_tag": "exact",
|
||||
"formats": {
|
||||
"branch": " {}",
|
||||
"tag": " {}",
|
||||
"untracked": " {}",
|
||||
"changed": " {}",
|
||||
"staged": " {}",
|
||||
"stashed": " {}",
|
||||
"ahead": " {}",
|
||||
"behind": " {}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.env.virtualenv",
|
||||
"before": " "
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"priority": 50,
|
||||
"highlight_groups": ["background"],
|
||||
"draw_hard_divider": true,
|
||||
"width": "auto"
|
||||
},
|
||||
{
|
||||
"function": "powerline_kubernetes.kubernetes",
|
||||
"priority": 60,
|
||||
"display": true,
|
||||
"args": {
|
||||
"show_kube_logo": true,
|
||||
"show_cluster": true,
|
||||
"show_namespace": true,
|
||||
"show_default_namespace": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.mail.email_imap_alert",
|
||||
"display": false,
|
||||
"priority": 80,
|
||||
"args": {
|
||||
"username_variable": "MAIL_USER",
|
||||
"password_variable": "MAIL_PASS",
|
||||
"server_variable": "MAIL_SERVER",
|
||||
"port_variable": "MAIL_PORT",
|
||||
"use_ssl": false,
|
||||
"interval": 60
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.bat.battery",
|
||||
"priority": 70,
|
||||
"draw_soft_divider": false,
|
||||
"draw_hard_divider": false,
|
||||
"args": {
|
||||
"gamify": true,
|
||||
"full_heart": " ",
|
||||
"empty_heart": " ",
|
||||
"online": " ",
|
||||
"offline": " "
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.time.date",
|
||||
"draw_soft_divider": false,
|
||||
"args": {
|
||||
"format": " %H:%M"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"left": [
|
||||
{
|
||||
"function": "powerline.segments.shell.last_pipe_status",
|
||||
"draw_soft_divider": false
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"name": "newline_prompt",
|
||||
"contents": " ",
|
||||
"highlight_groups": ["newline_prompt"],
|
||||
"draw_soft_divider": true,
|
||||
"draw_hard_divider": true
|
||||
}
|
||||
],
|
||||
"right": [
|
||||
{
|
||||
"function": "powerline.segments.common.vcs.branch",
|
||||
"display": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
47
.config/powerline/themes/tmux/default.json
Normal file
47
.config/powerline/themes/tmux/default.json
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"segments": {
|
||||
"left": [
|
||||
{
|
||||
"function": "powerline.segments.common.env.environment",
|
||||
"name": "docker_enabled",
|
||||
"draw_soft_divider": false,
|
||||
"draw_hard_divider": true,
|
||||
"args": {
|
||||
"variable": "DOCKER_CONTAINER"
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.net.hostname"
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.net.internal_ip",
|
||||
"priority": 30
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.env.cwd",
|
||||
"priority": 20,
|
||||
"before": " ",
|
||||
"args": {
|
||||
"use_shortened_path": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"right": [
|
||||
{
|
||||
"function": "powerline.segments.common.sys.uptime",
|
||||
"priority": 50
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.sys.system_load",
|
||||
"priority": 50
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.time.date",
|
||||
"name": "time",
|
||||
"args": {
|
||||
"format": " %Y-%m-%d %H:%M"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
154
.config/powerline/themes/unicode_terminus.json
Normal file
154
.config/powerline/themes/unicode_terminus.json
Normal file
|
@ -0,0 +1,154 @@
|
|||
{
|
||||
"dividers": {
|
||||
"left": {
|
||||
"hard": "▌ ",
|
||||
"soft": "│ "
|
||||
},
|
||||
"right": {
|
||||
"hard": " ▐",
|
||||
"soft": " │"
|
||||
}
|
||||
},
|
||||
"spaces": 1,
|
||||
"segment_data": {
|
||||
"branch": {
|
||||
"before": "BR "
|
||||
},
|
||||
"stash": {
|
||||
"before": "ST "
|
||||
},
|
||||
"cwd": {
|
||||
"args": {
|
||||
"ellipsis": "…"
|
||||
}
|
||||
},
|
||||
|
||||
"line_current_symbol": {
|
||||
"contents": " "
|
||||
},
|
||||
"player": {
|
||||
"args": {
|
||||
"state_symbols": {
|
||||
"fallback": "♫",
|
||||
"play": "▶",
|
||||
"pause": "▮▮",
|
||||
"stop": "■"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"time": {
|
||||
"before": ""
|
||||
},
|
||||
|
||||
"powerline.segments.common.net.network_load": {
|
||||
"args": {
|
||||
"recv_format": "⇓ {value:>8}",
|
||||
"sent_format": "⇑ {value:>8}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.net.hostname": {
|
||||
"before": "⌂ "
|
||||
},
|
||||
"powerline.segments.common.bat.battery": {
|
||||
"args": {
|
||||
"full_heart": "♥",
|
||||
"empty_heart": "♥",
|
||||
"online": "⚡︎",
|
||||
"offline": " "
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.sys.uptime": {
|
||||
"before": "↑ "
|
||||
},
|
||||
"powerline.segments.common.sys.system_load": {
|
||||
"before": " "
|
||||
},
|
||||
"powerline.segments.common.mail.email_imap_alert": {
|
||||
"before": "MAIL "
|
||||
},
|
||||
"powerline.segments.common.env.virtualenv": {
|
||||
"before": "(e) "
|
||||
},
|
||||
"powerline.segments.common.wthr.weather": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"day": "DAY",
|
||||
"blustery": "WIND",
|
||||
"rainy": "RAIN",
|
||||
"cloudy": "CLOUDS",
|
||||
"snowy": "SNOW",
|
||||
"stormy": "STORM",
|
||||
"foggy": "FOG",
|
||||
"sunny": "SUN",
|
||||
"night": "NIGHT",
|
||||
"windy": "WINDY",
|
||||
"not_available": "NA",
|
||||
"unknown": "UKN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.common.time.fuzzy_time": {
|
||||
"args": {
|
||||
"unicode_text": true
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.vim.mode": {
|
||||
"args": {
|
||||
"override": {
|
||||
"n": "NORMAL",
|
||||
"no": "N·OPER",
|
||||
"v": "VISUAL",
|
||||
"V": "V·LINE",
|
||||
"^V": "V·BLCK",
|
||||
"s": "SELECT",
|
||||
"S": "S·LINE",
|
||||
"^S": "S·BLCK",
|
||||
"i": "INSERT",
|
||||
"ic": "I·COMP",
|
||||
"ix": "I·C-X ",
|
||||
"R": "RPLACE",
|
||||
"Rv": "V·RPLC",
|
||||
"Rc": "R·COMP",
|
||||
"Rx": "R·C-X ",
|
||||
"c": "COMMND",
|
||||
"cv": "VIM·EX",
|
||||
"ce": "NRM·EX",
|
||||
"r": "PROMPT",
|
||||
"rm": "-MORE-",
|
||||
"r?": "CNFIRM",
|
||||
"!": "!SHELL",
|
||||
"t": "TERM "
|
||||
}
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.visual_range": {
|
||||
"args": {
|
||||
"CTRL_V_text": "{rows} × {vcols}",
|
||||
"v_text_oneline": "C:{vcols}",
|
||||
"v_text_multiline": "L:{rows}",
|
||||
"V_text": "L:{rows}"
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.readonly_indicator": {
|
||||
"args": {
|
||||
"text": "RO"
|
||||
}
|
||||
},
|
||||
"powerline.segments.vim.modified_indicator": {
|
||||
"args": {
|
||||
"text": "+"
|
||||
}
|
||||
},
|
||||
|
||||
"powerline.segments.i3wm.scratchpad": {
|
||||
"args": {
|
||||
"icons": {
|
||||
"fresh": "●",
|
||||
"changed": "○"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
40
.config/python/interactive_startup.py
Normal file
40
.config/python/interactive_startup.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env python3
|
||||
# quick script to make python use XDG spec
|
||||
import atexit
|
||||
import os
|
||||
from pathlib import Path
|
||||
import readline
|
||||
from xdg_base_dirs import xdg_state_home, xdg_cache_home, xdg_data_home
|
||||
|
||||
# create the XDG_STATE_HOME/python dir if it doesn't exist
|
||||
# most likely going to be $HOME/.local/state/python
|
||||
state_dir = Path.joinpath(xdg_state_home(), 'python')
|
||||
Path(state_dir).mkdir(exist_ok=True)
|
||||
|
||||
# create the XDG_CACHE_HOME/python dir if it doesn't exist
|
||||
# most likely going to be $HOME/.cache/python
|
||||
cache_dir = Path.joinpath(xdg_cache_home(), 'python')
|
||||
Path(cache_dir).mkdir(exist_ok=True)
|
||||
|
||||
# create the XDG_DATA_HOME/python dir if it doesn't exist
|
||||
# most likely going to be $HOME/.local/share/python
|
||||
data_dir = Path.joinpath(xdg_data_home(), 'python')
|
||||
Path(data_dir).mkdir(exist_ok=True)
|
||||
|
||||
# define history file name
|
||||
history = os.path.join(state_dir, 'history')
|
||||
|
||||
try:
|
||||
readline.read_history_file(history)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def write_history():
|
||||
try:
|
||||
readline.write_history_file(history)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
atexit.register(write_history)
|
759
.config/ranger/rc.conf
Normal file
759
.config/ranger/rc.conf
Normal file
|
@ -0,0 +1,759 @@
|
|||
# ===================================================================
|
||||
# This file contains the default startup commands for ranger.
|
||||
# To change them, it is recommended to create either /etc/ranger/rc.conf
|
||||
# (system-wide) or ~/.config/ranger/rc.conf (per user) and add your custom
|
||||
# commands there.
|
||||
#
|
||||
# If you copy this whole file there, you may want to set the environment
|
||||
# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice.
|
||||
#
|
||||
# The purpose of this file is mainly to define keybindings and settings.
|
||||
# For running more complex python code, please create a plugin in "plugins/" or
|
||||
# a command in "commands.py".
|
||||
#
|
||||
# Each line is a command that will be run before the user interface
|
||||
# is initialized. As a result, you can not use commands which rely
|
||||
# on the UI such as :delete or :mark.
|
||||
# ===================================================================
|
||||
|
||||
# ===================================================================
|
||||
# == Options
|
||||
# ===================================================================
|
||||
|
||||
# Which viewmode should be used? Possible values are:
|
||||
# miller: Use miller columns which show multiple levels of the hierarchy
|
||||
# multipane: Midnight-commander like multipane view showing all tabs next
|
||||
# to each other
|
||||
set viewmode miller
|
||||
#set viewmode multipane
|
||||
|
||||
# How many columns are there, and what are their relative widths?
|
||||
set column_ratios 1,3,4
|
||||
|
||||
# Which files should be hidden? (regular expression)
|
||||
set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
|
||||
|
||||
# Show hidden files? You can toggle this by typing 'zh'
|
||||
set show_hidden false
|
||||
|
||||
# Ask for a confirmation when running the "delete" command?
|
||||
# Valid values are "always", "never", "multiple" (default)
|
||||
# With "multiple", ranger will ask only if you delete multiple files at once.
|
||||
set confirm_on_delete multiple
|
||||
|
||||
# Use non-default path for file preview script?
|
||||
# ranger ships with scope.sh, a script that calls external programs (see
|
||||
# README.md for dependencies) to preview images, archives, etc.
|
||||
#set preview_script ~/.config/ranger/scope.sh
|
||||
|
||||
# Use the external preview script or display simple plain text or image previews?
|
||||
set use_preview_script true
|
||||
|
||||
# Automatically count files in the directory, even before entering them?
|
||||
set automatically_count_files true
|
||||
|
||||
# Open all images in this directory when running certain image viewers
|
||||
# like feh or sxiv? You can still open selected files by marking them.
|
||||
set open_all_images true
|
||||
|
||||
# Be aware of version control systems and display information.
|
||||
set vcs_aware true
|
||||
|
||||
# State of the four backends git, hg, bzr, svn. The possible states are
|
||||
# disabled, local (only show local info), enabled (show local and remote
|
||||
# information).
|
||||
set vcs_backend_git enabled
|
||||
set vcs_backend_hg disabled
|
||||
set vcs_backend_bzr disabled
|
||||
set vcs_backend_svn disabled
|
||||
|
||||
# Truncate the long commit messages to this length when shown in the statusbar.
|
||||
set vcs_msg_length 50
|
||||
|
||||
# Use one of the supported image preview protocols
|
||||
set preview_images true
|
||||
|
||||
# Set the preview image method. Supported methods:
|
||||
#
|
||||
# * w3m (default):
|
||||
# Preview images in full color with the external command "w3mimgpreview"?
|
||||
# This requires the console web browser "w3m" and a supported terminal.
|
||||
# It has been successfully tested with "xterm" and "urxvt" without tmux.
|
||||
#
|
||||
# * iterm2:
|
||||
# Preview images in full color using iTerm2 image previews
|
||||
# (http://iterm2.com/images.html). This requires using iTerm2 compiled
|
||||
# with image preview support.
|
||||
#
|
||||
# This feature relies on the dimensions of the terminal's font. By default, a
|
||||
# width of 8 and height of 11 are used. To use other values, set the options
|
||||
# iterm2_font_width and iterm2_font_height to the desired values.
|
||||
#
|
||||
# * terminology:
|
||||
# Previews images in full color in the terminology terminal emulator.
|
||||
# Supports a wide variety of formats, even vector graphics like svg.
|
||||
#
|
||||
# * urxvt:
|
||||
# Preview images in full color using urxvt image backgrounds. This
|
||||
# requires using urxvt compiled with pixbuf support.
|
||||
#
|
||||
# * urxvt-full:
|
||||
# The same as urxvt but utilizing not only the preview pane but the
|
||||
# whole terminal window.
|
||||
#
|
||||
# * kitty:
|
||||
# Preview images in full color using kitty image protocol.
|
||||
# Requires python PIL or pillow library.
|
||||
# If ranger does not share the local filesystem with kitty
|
||||
# the transfer method is changed to encode the whole image;
|
||||
# while slower, this allows remote previews,
|
||||
# for example during an ssh session.
|
||||
# Tmux is unsupported.
|
||||
#
|
||||
# * ueberzug:
|
||||
# Preview images in full color with the external command "ueberzug".
|
||||
# Images are shown by using a child window.
|
||||
# Only for users who run X11 in GNU/Linux.
|
||||
set preview_images_method iterm2
|
||||
|
||||
# Delay in seconds before displaying an image with the w3m method.
|
||||
# Increase it in case of experiencing display corruption.
|
||||
set w3m_delay 0.02
|
||||
|
||||
# Manually adjust the w3mimg offset when using a terminal which needs this
|
||||
set w3m_offset 0
|
||||
|
||||
# Default iTerm2 font size (see: preview_images_method: iterm2)
|
||||
set iterm2_font_width 20
|
||||
set iterm2_font_height 30
|
||||
|
||||
# Use a unicode "..." character to mark cut-off filenames?
|
||||
set unicode_ellipsis false
|
||||
|
||||
# BIDI support - try to properly display file names in RTL languages (Hebrew, Arabic).
|
||||
# Requires the python-bidi pip package
|
||||
set bidi_support false
|
||||
|
||||
# Show dotfiles in the bookmark preview box?
|
||||
set show_hidden_bookmarks true
|
||||
|
||||
# Which colorscheme to use? These colorschemes are available by default:
|
||||
# default, jungle, snow, solarized
|
||||
set colorscheme default
|
||||
|
||||
# Preview files on the rightmost column?
|
||||
# And collapse (shrink) the last column if there is nothing to preview?
|
||||
set preview_files true
|
||||
set preview_directories true
|
||||
set collapse_preview true
|
||||
|
||||
# Wrap long lines in plain text previews?
|
||||
set wrap_plaintext_previews false
|
||||
|
||||
# Save the console history on exit?
|
||||
set save_console_history true
|
||||
|
||||
# Draw the status bar on top of the browser window (default: bottom)
|
||||
set status_bar_on_top false
|
||||
|
||||
# Draw a progress bar in the status bar which displays the average state of all
|
||||
# currently running tasks which support progress bars?
|
||||
set draw_progress_bar_in_status_bar true
|
||||
|
||||
# Draw borders around columns? (separators, outline, both, or none)
|
||||
# Separators are vertical lines between columns.
|
||||
# Outline draws a box around all the columns.
|
||||
# Both combines the two.
|
||||
set draw_borders none
|
||||
|
||||
# Display the directory name in tabs?
|
||||
set dirname_in_tabs false
|
||||
|
||||
# Enable the mouse support?
|
||||
set mouse_enabled true
|
||||
|
||||
# Display the file size in the main column or status bar?
|
||||
set display_size_in_main_column true
|
||||
set display_size_in_status_bar true
|
||||
|
||||
# Display the free disk space in the status bar?
|
||||
set display_free_space_in_status_bar true
|
||||
|
||||
# Display files tags in all columns or only in main column?
|
||||
set display_tags_in_all_columns true
|
||||
|
||||
# Set a title for the window? Updates both `WM_NAME` and `WM_ICON_NAME`
|
||||
set update_title false
|
||||
|
||||
# Set the tmux/screen window-name to "ranger"?
|
||||
set update_tmux_title true
|
||||
|
||||
# Shorten the title if it gets long? The number defines how many
|
||||
# directories are displayed at once, 0 turns off this feature.
|
||||
set shorten_title 3
|
||||
|
||||
# Show hostname in titlebar?
|
||||
set hostname_in_titlebar true
|
||||
|
||||
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
|
||||
set tilde_in_titlebar false
|
||||
|
||||
# How many directory-changes or console-commands should be kept in history?
|
||||
set max_history_size 20
|
||||
set max_console_history_size 50
|
||||
|
||||
# Try to keep so much space between the top/bottom border when scrolling:
|
||||
set scroll_offset 8
|
||||
|
||||
# Flush the input after each key hit? (Noticeable when ranger lags)
|
||||
set flushinput true
|
||||
|
||||
# Padding on the right when there's no preview?
|
||||
# This allows you to click into the space to run the file.
|
||||
set padding_right true
|
||||
|
||||
# Save bookmarks (used with mX and `X) instantly?
|
||||
# This helps to synchronize bookmarks between multiple ranger
|
||||
# instances but leads to *slight* performance loss.
|
||||
# When false, bookmarks are saved when ranger is exited.
|
||||
set autosave_bookmarks true
|
||||
|
||||
# Save the "`" bookmark to disk. This can be used to switch to the last
|
||||
# directory by typing "``".
|
||||
set save_backtick_bookmark true
|
||||
|
||||
# You can display the "real" cumulative size of directories by using the
|
||||
# command :get_cumulative_size or typing "dc". The size is expensive to
|
||||
# calculate and will not be updated automatically. You can choose
|
||||
# to update it automatically though by turning on this option:
|
||||
set autoupdate_cumulative_size false
|
||||
|
||||
# Turning this on makes sense for screen readers:
|
||||
set show_cursor false
|
||||
|
||||
# One of: size, natural, basename, atime, ctime, mtime, type, random
|
||||
set sort natural
|
||||
|
||||
# Additional sorting options
|
||||
set sort_reverse false
|
||||
set sort_case_insensitive true
|
||||
set sort_directories_first true
|
||||
set sort_unicode false
|
||||
|
||||
# Enable this if key combinations with the Alt Key don't work for you.
|
||||
# (Especially on xterm)
|
||||
set xterm_alt_key false
|
||||
|
||||
# Whether to include bookmarks in cd command
|
||||
set cd_bookmarks true
|
||||
|
||||
# Changes case sensitivity for the cd command tab completion
|
||||
set cd_tab_case sensitive
|
||||
|
||||
# Use fuzzy tab completion with the "cd" command. For example,
|
||||
# ":cd /u/lo/b<tab>" expands to ":cd /usr/local/bin".
|
||||
set cd_tab_fuzzy false
|
||||
|
||||
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
|
||||
# disable this feature.
|
||||
set preview_max_size 0
|
||||
|
||||
# The key hint lists up to this size have their sublists expanded.
|
||||
# Otherwise the submaps are replaced with "...".
|
||||
set hint_collapse_threshold 10
|
||||
|
||||
# Add the highlighted file to the path in the titlebar
|
||||
set show_selection_in_titlebar true
|
||||
|
||||
# The delay that ranger idly waits for user input, in milliseconds, with a
|
||||
# resolution of 100ms. Lower delay reduces lag between directory updates but
|
||||
# increases CPU load.
|
||||
set idle_delay 2000
|
||||
|
||||
# When the metadata manager module looks for metadata, should it only look for
|
||||
# a ".metadata.json" file in the current directory, or do a deep search and
|
||||
# check all directories above the current one as well?
|
||||
set metadata_deep_search false
|
||||
|
||||
# Clear all existing filters when leaving a directory
|
||||
set clear_filters_on_dir_change false
|
||||
|
||||
# Disable displaying line numbers in main column.
|
||||
# Possible values: false, absolute, relative.
|
||||
set line_numbers false
|
||||
|
||||
# When line_numbers=relative show the absolute line number in the
|
||||
# current line.
|
||||
set relative_current_zero false
|
||||
|
||||
# Start line numbers from 1 instead of 0
|
||||
set one_indexed false
|
||||
|
||||
# Save tabs on exit
|
||||
set save_tabs_on_exit false
|
||||
|
||||
# Enable scroll wrapping - moving down while on the last item will wrap around to
|
||||
# the top and vice versa.
|
||||
set wrap_scroll false
|
||||
|
||||
# Set the global_inode_type_filter to nothing. Possible options: d, f and l for
|
||||
# directories, files and symlinks respectively.
|
||||
set global_inode_type_filter
|
||||
|
||||
# This setting allows to freeze the list of files to save I/O bandwidth. It
|
||||
# should be 'false' during start-up, but you can toggle it by pressing F.
|
||||
set freeze_files false
|
||||
|
||||
# Print file sizes in bytes instead of the default human-readable format.
|
||||
set size_in_bytes false
|
||||
|
||||
# Warn at startup if RANGER_LEVEL env var is greater than 0, in other words
|
||||
# give a warning when you nest ranger in a subshell started by ranger.
|
||||
# Special value "error" makes the warning more visible.
|
||||
set nested_ranger_warning true
|
||||
|
||||
# ===================================================================
|
||||
# == Local Options
|
||||
# ===================================================================
|
||||
# You can set local options that only affect a single directory.
|
||||
|
||||
# Examples:
|
||||
# setlocal path=~/downloads sort mtime
|
||||
|
||||
# ===================================================================
|
||||
# == Command Aliases in the Console
|
||||
# ===================================================================
|
||||
|
||||
alias e edit
|
||||
alias q quit
|
||||
alias q! quit!
|
||||
alias qa quitall
|
||||
alias qa! quitall!
|
||||
alias qall quitall
|
||||
alias qall! quitall!
|
||||
alias setl setlocal
|
||||
|
||||
alias filter scout -prts
|
||||
alias find scout -aets
|
||||
alias mark scout -mr
|
||||
alias unmark scout -Mr
|
||||
alias search scout -rs
|
||||
alias search_inc scout -rts
|
||||
alias travel scout -aefklst
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the browser
|
||||
# ===================================================================
|
||||
|
||||
# Basic
|
||||
map Q quitall
|
||||
map q quit
|
||||
copymap q ZZ ZQ
|
||||
|
||||
map R reload_cwd
|
||||
map F set freeze_files!
|
||||
map <C-r> reset
|
||||
map <C-l> redraw_window
|
||||
map <C-c> abort
|
||||
map <esc> change_mode normal
|
||||
map ~ set viewmode!
|
||||
|
||||
map i display_file
|
||||
map <A-j> scroll_preview 1
|
||||
map <A-k> scroll_preview -1
|
||||
map ? help
|
||||
map W display_log
|
||||
map w taskview_open
|
||||
map S shell $SHELL
|
||||
|
||||
map : console
|
||||
map ; console
|
||||
map ! console shell%space
|
||||
map @ console -p6 shell %%s
|
||||
map # console shell -p%space
|
||||
map s console shell%space
|
||||
map r chain draw_possible_programs; console open_with%space
|
||||
map f console find%space
|
||||
map cd console cd%space
|
||||
|
||||
map <C-p> chain console; eval fm.ui.console.history_move(-1)
|
||||
|
||||
# Change the line mode
|
||||
map Mf linemode filename
|
||||
map Mi linemode fileinfo
|
||||
map Mm linemode mtime
|
||||
map Mh linemode humanreadablemtime
|
||||
map Mp linemode permissions
|
||||
map Ms linemode sizemtime
|
||||
map MH linemode sizehumanreadablemtime
|
||||
map Mt linemode metatitle
|
||||
|
||||
# Tagging / Marking
|
||||
map t tag_toggle
|
||||
map ut tag_remove
|
||||
map "<any> tag_toggle tag=%any
|
||||
map <Space> mark_files toggle=True
|
||||
map v mark_files all=True toggle=True
|
||||
map uv mark_files all=True val=False
|
||||
map V toggle_visual_mode
|
||||
map uV toggle_visual_mode reverse=True
|
||||
|
||||
# For the nostalgics: Midnight Commander bindings
|
||||
map <F1> help
|
||||
map <F2> rename_append
|
||||
map <F3> display_file
|
||||
map <F4> edit
|
||||
map <F5> copy
|
||||
map <F6> cut
|
||||
map <F7> console mkdir%space
|
||||
map <F8> console delete
|
||||
#map <F8> console trash
|
||||
map <F10> exit
|
||||
|
||||
# In case you work on a keyboard with dvorak layout
|
||||
map <UP> move up=1
|
||||
map <DOWN> move down=1
|
||||
map <LEFT> move left=1
|
||||
map <RIGHT> move right=1
|
||||
map <HOME> move to=0
|
||||
map <END> move to=-1
|
||||
map <PAGEDOWN> move down=1 pages=True
|
||||
map <PAGEUP> move up=1 pages=True
|
||||
map <CR> move right=1
|
||||
#map <DELETE> console delete
|
||||
map <INSERT> console touch%space
|
||||
|
||||
# VIM-like
|
||||
copymap <UP> k
|
||||
copymap <DOWN> j
|
||||
copymap <LEFT> h
|
||||
copymap <RIGHT> l
|
||||
copymap <HOME> gg
|
||||
copymap <END> G
|
||||
copymap <PAGEDOWN> <C-F>
|
||||
copymap <PAGEUP> <C-B>
|
||||
|
||||
map J move down=0.5 pages=True
|
||||
map K move up=0.5 pages=True
|
||||
copymap J <C-D>
|
||||
copymap K <C-U>
|
||||
|
||||
# Jumping around
|
||||
map H history_go -1
|
||||
map L history_go 1
|
||||
map ] move_parent 1
|
||||
map [ move_parent -1
|
||||
map } traverse
|
||||
map { traverse_backwards
|
||||
map ) jump_non
|
||||
|
||||
map gh cd ~
|
||||
map ge cd /etc
|
||||
map gu cd /usr
|
||||
map gd cd /dev
|
||||
map gl cd -r .
|
||||
map gL cd -r %f
|
||||
map go cd /opt
|
||||
map gv cd /var
|
||||
map gm cd /media
|
||||
map gi eval fm.cd('/run/media/' + os.getenv('USER'))
|
||||
map gM cd /mnt
|
||||
map gs cd /srv
|
||||
map gp cd /tmp
|
||||
map gr cd /
|
||||
map gR eval fm.cd(ranger.RANGERDIR)
|
||||
map g/ cd /
|
||||
map g? cd /usr/share/doc/ranger
|
||||
|
||||
# External Programs
|
||||
map E edit
|
||||
map du shell -p du --max-depth=1 -h --apparent-size
|
||||
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
|
||||
map yp yank path
|
||||
map yd yank dir
|
||||
map yn yank name
|
||||
map y. yank name_without_extension
|
||||
|
||||
# Filesystem Operations
|
||||
map = chmod
|
||||
|
||||
map cw console rename%space
|
||||
map a rename_append
|
||||
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
|
||||
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
|
||||
|
||||
map pp paste
|
||||
map po paste overwrite=True
|
||||
map pP paste append=True
|
||||
map pO paste overwrite=True append=True
|
||||
map pl paste_symlink relative=False
|
||||
map pL paste_symlink relative=True
|
||||
map phl paste_hardlink
|
||||
map pht paste_hardlinked_subtree
|
||||
map pd console paste dest=
|
||||
map p`<any> paste dest=%any_path
|
||||
map p'<any> paste dest=%any_path
|
||||
|
||||
map dD console delete
|
||||
map dT console trash
|
||||
|
||||
map dd cut
|
||||
map ud uncut
|
||||
map da cut mode=add
|
||||
map dr cut mode=remove
|
||||
map dt cut mode=toggle
|
||||
|
||||
map yy copy
|
||||
map uy uncut
|
||||
map ya copy mode=add
|
||||
map yr copy mode=remove
|
||||
map yt copy mode=toggle
|
||||
|
||||
# Temporary workarounds
|
||||
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
|
||||
map dG eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
|
||||
map dj eval fm.cut(dirarg=dict(down=1), narg=quantifier)
|
||||
map dk eval fm.cut(dirarg=dict(up=1), narg=quantifier)
|
||||
map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
|
||||
map yG eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
|
||||
map yj eval fm.copy(dirarg=dict(down=1), narg=quantifier)
|
||||
map yk eval fm.copy(dirarg=dict(up=1), narg=quantifier)
|
||||
|
||||
# Searching
|
||||
map / console search%space
|
||||
map n search_next
|
||||
map N search_next forward=False
|
||||
map ct search_next order=tag
|
||||
map cs search_next order=size
|
||||
map ci search_next order=mimetype
|
||||
map cc search_next order=ctime
|
||||
map cm search_next order=mtime
|
||||
map ca search_next order=atime
|
||||
|
||||
# Tabs
|
||||
map <C-n> tab_new
|
||||
map <C-w> tab_close
|
||||
map <TAB> tab_move 1
|
||||
map <S-TAB> tab_move -1
|
||||
map <A-Right> tab_move 1
|
||||
map <A-Left> tab_move -1
|
||||
map gt tab_move 1
|
||||
map gT tab_move -1
|
||||
map gn tab_new
|
||||
map gc tab_close
|
||||
map uq tab_restore
|
||||
map <a-1> tab_open 1
|
||||
map <a-2> tab_open 2
|
||||
map <a-3> tab_open 3
|
||||
map <a-4> tab_open 4
|
||||
map <a-5> tab_open 5
|
||||
map <a-6> tab_open 6
|
||||
map <a-7> tab_open 7
|
||||
map <a-8> tab_open 8
|
||||
map <a-9> tab_open 9
|
||||
map <a-r> tab_shift 1
|
||||
map <a-l> tab_shift -1
|
||||
|
||||
# Sorting
|
||||
map or set sort_reverse!
|
||||
map oz set sort=random
|
||||
map os chain set sort=size; set sort_reverse=False
|
||||
map ob chain set sort=basename; set sort_reverse=False
|
||||
map on chain set sort=natural; set sort_reverse=False
|
||||
map om chain set sort=mtime; set sort_reverse=False
|
||||
map oc chain set sort=ctime; set sort_reverse=False
|
||||
map oa chain set sort=atime; set sort_reverse=False
|
||||
map ot chain set sort=type; set sort_reverse=False
|
||||
map oe chain set sort=extension; set sort_reverse=False
|
||||
|
||||
map oS chain set sort=size; set sort_reverse=True
|
||||
map oB chain set sort=basename; set sort_reverse=True
|
||||
map oN chain set sort=natural; set sort_reverse=True
|
||||
map oM chain set sort=mtime; set sort_reverse=True
|
||||
map oC chain set sort=ctime; set sort_reverse=True
|
||||
map oA chain set sort=atime; set sort_reverse=True
|
||||
map oT chain set sort=type; set sort_reverse=True
|
||||
map oE chain set sort=extension; set sort_reverse=True
|
||||
|
||||
map dc get_cumulative_size
|
||||
|
||||
# Settings
|
||||
map zc set collapse_preview!
|
||||
map zd set sort_directories_first!
|
||||
map zh set show_hidden!
|
||||
map <C-h> set show_hidden!
|
||||
copymap <C-h> <backspace>
|
||||
copymap <backspace> <backspace2>
|
||||
map zI set flushinput!
|
||||
map zi set preview_images!
|
||||
map zm set mouse_enabled!
|
||||
map zp set preview_files!
|
||||
map zP set preview_directories!
|
||||
map zs set sort_case_insensitive!
|
||||
map zu set autoupdate_cumulative_size!
|
||||
map zv set use_preview_script!
|
||||
map zf console filter%space
|
||||
copymap zf zz
|
||||
|
||||
# Filter stack
|
||||
map .d filter_stack add type d
|
||||
map .f filter_stack add type f
|
||||
map .l filter_stack add type l
|
||||
map .m console filter_stack add mime%space
|
||||
map .n console filter_stack add name%space
|
||||
map .# console filter_stack add hash%space
|
||||
map ." filter_stack add duplicate
|
||||
map .' filter_stack add unique
|
||||
map .| filter_stack add or
|
||||
map .& filter_stack add and
|
||||
map .! filter_stack add not
|
||||
map .r filter_stack rotate
|
||||
map .c filter_stack clear
|
||||
map .* filter_stack decompose
|
||||
map .p filter_stack pop
|
||||
map .. filter_stack show
|
||||
|
||||
# Bookmarks
|
||||
map `<any> enter_bookmark %any
|
||||
map '<any> enter_bookmark %any
|
||||
map m<any> set_bookmark %any
|
||||
map um<any> unset_bookmark %any
|
||||
|
||||
map m<bg> draw_bookmarks
|
||||
copymap m<bg> um<bg> `<bg> '<bg>
|
||||
|
||||
# Generate all the chmod bindings with some python help:
|
||||
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map +{0} shell -f chmod u+{0} %s".format(arg))
|
||||
|
||||
eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
|
||||
eval for arg in "rwxXst": cmd("map -{0} shell -f chmod u-{0} %s".format(arg))
|
||||
|
||||
# ===================================================================
|
||||
# == Define keys for the console
|
||||
# ===================================================================
|
||||
# Note: Unmapped keys are passed directly to the console.
|
||||
|
||||
# Basic
|
||||
cmap <tab> eval fm.ui.console.tab()
|
||||
cmap <s-tab> eval fm.ui.console.tab(-1)
|
||||
cmap <ESC> eval fm.ui.console.close()
|
||||
cmap <CR> eval fm.ui.console.execute()
|
||||
cmap <C-l> redraw_window
|
||||
|
||||
copycmap <ESC> <C-c>
|
||||
copycmap <CR> <C-j>
|
||||
|
||||
# Move around
|
||||
cmap <up> eval fm.ui.console.history_move(-1)
|
||||
cmap <down> eval fm.ui.console.history_move(1)
|
||||
cmap <left> eval fm.ui.console.move(left=1)
|
||||
cmap <right> eval fm.ui.console.move(right=1)
|
||||
cmap <home> eval fm.ui.console.move(right=0, absolute=True)
|
||||
cmap <end> eval fm.ui.console.move(right=-1, absolute=True)
|
||||
cmap <a-b> eval fm.ui.console.move_word(left=1)
|
||||
cmap <a-f> eval fm.ui.console.move_word(right=1)
|
||||
|
||||
copycmap <a-b> <a-left>
|
||||
copycmap <a-f> <a-right>
|
||||
|
||||
# Line Editing
|
||||
cmap <backspace> eval fm.ui.console.delete(-1)
|
||||
cmap <delete> eval fm.ui.console.delete(0)
|
||||
cmap <C-w> eval fm.ui.console.delete_word()
|
||||
cmap <A-d> eval fm.ui.console.delete_word(backward=False)
|
||||
cmap <C-k> eval fm.ui.console.delete_rest(1)
|
||||
cmap <C-u> eval fm.ui.console.delete_rest(-1)
|
||||
cmap <C-y> eval fm.ui.console.paste()
|
||||
|
||||
# And of course the emacs way
|
||||
copycmap <ESC> <C-g>
|
||||
copycmap <up> <C-p>
|
||||
copycmap <down> <C-n>
|
||||
copycmap <left> <C-b>
|
||||
copycmap <right> <C-f>
|
||||
copycmap <home> <C-a>
|
||||
copycmap <end> <C-e>
|
||||
copycmap <delete> <C-d>
|
||||
copycmap <backspace> <C-h>
|
||||
|
||||
# Note: There are multiple ways to express backspaces. <backspace> (code 263)
|
||||
# and <backspace2> (code 127). To be sure, use both.
|
||||
copycmap <backspace> <backspace2>
|
||||
|
||||
# This special expression allows typing in numerals:
|
||||
cmap <allow_quantifiers> false
|
||||
|
||||
# ===================================================================
|
||||
# == Pager Keybindings
|
||||
# ===================================================================
|
||||
|
||||
# Movement
|
||||
pmap <down> pager_move down=1
|
||||
pmap <up> pager_move up=1
|
||||
pmap <left> pager_move left=4
|
||||
pmap <right> pager_move right=4
|
||||
pmap <home> pager_move to=0
|
||||
pmap <end> pager_move to=-1
|
||||
pmap <pagedown> pager_move down=1.0 pages=True
|
||||
pmap <pageup> pager_move up=1.0 pages=True
|
||||
pmap <C-d> pager_move down=0.5 pages=True
|
||||
pmap <C-u> pager_move up=0.5 pages=True
|
||||
|
||||
copypmap <UP> k <C-p>
|
||||
copypmap <DOWN> j <C-n> <CR>
|
||||
copypmap <LEFT> h
|
||||
copypmap <RIGHT> l
|
||||
copypmap <HOME> g
|
||||
copypmap <END> G
|
||||
copypmap <C-d> d
|
||||
copypmap <C-u> u
|
||||
copypmap <PAGEDOWN> n f <C-F> <Space>
|
||||
copypmap <PAGEUP> p b <C-B>
|
||||
|
||||
# Basic
|
||||
pmap <C-l> redraw_window
|
||||
pmap <ESC> pager_close
|
||||
copypmap <ESC> q Q i <F3>
|
||||
pmap E edit_file
|
||||
|
||||
# ===================================================================
|
||||
# == Taskview Keybindings
|
||||
# ===================================================================
|
||||
|
||||
# Movement
|
||||
tmap <up> taskview_move up=1
|
||||
tmap <down> taskview_move down=1
|
||||
tmap <home> taskview_move to=0
|
||||
tmap <end> taskview_move to=-1
|
||||
tmap <pagedown> taskview_move down=1.0 pages=True
|
||||
tmap <pageup> taskview_move up=1.0 pages=True
|
||||
tmap <C-d> taskview_move down=0.5 pages=True
|
||||
tmap <C-u> taskview_move up=0.5 pages=True
|
||||
|
||||
copytmap <UP> k <C-p>
|
||||
copytmap <DOWN> j <C-n> <CR>
|
||||
copytmap <HOME> g
|
||||
copytmap <END> G
|
||||
copytmap <C-u> u
|
||||
copytmap <PAGEDOWN> n f <C-F> <Space>
|
||||
copytmap <PAGEUP> p b <C-B>
|
||||
|
||||
# Changing priority and deleting tasks
|
||||
tmap J eval -q fm.ui.taskview.task_move(-1)
|
||||
tmap K eval -q fm.ui.taskview.task_move(0)
|
||||
tmap dd eval -q fm.ui.taskview.task_remove()
|
||||
tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
|
||||
tmap <pageup> eval -q fm.ui.taskview.task_move(0)
|
||||
tmap <delete> eval -q fm.ui.taskview.task_remove()
|
||||
|
||||
# Basic
|
||||
tmap <C-l> redraw_window
|
||||
tmap <ESC> taskview_close
|
||||
copytmap <ESC> q Q w <C-c>
|
350
.config/ranger/scope.sh
Executable file
350
.config/ranger/scope.sh
Executable file
|
@ -0,0 +1,350 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o noclobber -o noglob -o nounset -o pipefail
|
||||
IFS=$'\n'
|
||||
|
||||
## If the option `use_preview_script` is set to `true`,
|
||||
## then this script will be called and its output will be displayed in ranger.
|
||||
## ANSI color codes are supported.
|
||||
## STDIN is disabled, so interactive scripts won't work properly
|
||||
|
||||
## This script is considered a configuration file and must be updated manually.
|
||||
## It will be left untouched if you upgrade ranger.
|
||||
|
||||
## Because of some automated testing we do on the script #'s for comments need
|
||||
## to be doubled up. Code that is commented out, because it's an alternative for
|
||||
## example, gets only one #.
|
||||
|
||||
## Meanings of exit codes:
|
||||
## code | meaning | action of ranger
|
||||
## -----+------------+-------------------------------------------
|
||||
## 0 | success | Display stdout as preview
|
||||
## 1 | no preview | Display no preview at all
|
||||
## 2 | plain text | Display the plain content of the file
|
||||
## 3 | fix width | Don't reload when width changes
|
||||
## 4 | fix height | Don't reload when height changes
|
||||
## 5 | fix both | Don't ever reload
|
||||
## 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
|
||||
## 7 | image | Display the file directly as an image
|
||||
|
||||
## Script arguments
|
||||
FILE_PATH="${1}" # Full path of the highlighted file
|
||||
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
|
||||
## shellcheck disable=SC2034 # PV_HEIGHT is provided for convenience and unused
|
||||
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
|
||||
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
|
||||
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
|
||||
|
||||
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||
FILE_EXTENSION_LOWER="$(printf "%s" "${FILE_EXTENSION}" | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
## Settings
|
||||
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
|
||||
HIGHLIGHT_TABWIDTH=${HIGHLIGHT_TABWIDTH:-8}
|
||||
HIGHLIGHT_STYLE=${HIGHLIGHT_STYLE:-pablo}
|
||||
HIGHLIGHT_OPTIONS="--replace-tabs=${HIGHLIGHT_TABWIDTH} --style=${HIGHLIGHT_STYLE} ${HIGHLIGHT_OPTIONS:-}"
|
||||
PYGMENTIZE_STYLE=${PYGMENTIZE_STYLE:-autumn}
|
||||
OPENSCAD_IMGSIZE=${RNGR_OPENSCAD_IMGSIZE:-1000,1000}
|
||||
OPENSCAD_COLORSCHEME=${RNGR_OPENSCAD_COLORSCHEME:-Tomorrow Night}
|
||||
|
||||
handle_extension() {
|
||||
case "${FILE_EXTENSION_LOWER}" in
|
||||
## Archive
|
||||
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
|
||||
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
|
||||
atool --list -- "${FILE_PATH}" && exit 5
|
||||
bsdtar --list --file "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
rar)
|
||||
## Avoid password prompt by providing empty password
|
||||
unrar lt -p- -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
7z)
|
||||
## Avoid password prompt by providing empty password
|
||||
7z l -p -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## PDF
|
||||
pdf)
|
||||
## Preview as text conversion
|
||||
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | \
|
||||
fmt -w "${PV_WIDTH}" && exit 5
|
||||
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | \
|
||||
fmt -w "${PV_WIDTH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## BitTorrent
|
||||
torrent)
|
||||
transmission-show -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## OpenDocument
|
||||
odt|ods|odp|sxw)
|
||||
## Preview as text conversion
|
||||
odt2txt "${FILE_PATH}" && exit 5
|
||||
## Preview as markdown conversion
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## XLSX
|
||||
xlsx)
|
||||
## Preview as csv conversion
|
||||
## Uses: https://github.com/dilshod/xlsx2csv
|
||||
xlsx2csv -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## HTML
|
||||
htm|html|xhtml)
|
||||
## Preview as text conversion
|
||||
w3m -dump "${FILE_PATH}" && exit 5
|
||||
lynx -dump -- "${FILE_PATH}" && exit 5
|
||||
elinks -dump "${FILE_PATH}" && exit 5
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
|
||||
;;
|
||||
|
||||
## JSON
|
||||
json)
|
||||
jq --color-output . "${FILE_PATH}" && exit 5
|
||||
python -m json.tool -- "${FILE_PATH}" && exit 5
|
||||
;;
|
||||
|
||||
## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
|
||||
## by file(1).
|
||||
dff|dsf|wv|wvc)
|
||||
mediainfo "${FILE_PATH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
;; # Continue with next handler on failure
|
||||
esac
|
||||
}
|
||||
|
||||
handle_image() {
|
||||
## Size of the preview if there are multiple options or it has to be
|
||||
## rendered from vector graphics. If the conversion program allows
|
||||
## specifying only one dimension while keeping the aspect ratio, the width
|
||||
## will be used.
|
||||
local DEFAULT_SIZE="1920x1080"
|
||||
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
## SVG
|
||||
image/svg+xml|image/svg)
|
||||
convert -- "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
|
||||
exit 1;;
|
||||
|
||||
## DjVu
|
||||
# image/vnd.djvu)
|
||||
# ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \
|
||||
# - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \
|
||||
# && exit 6 || exit 1;;
|
||||
|
||||
## Image
|
||||
image/*)
|
||||
local orientation
|
||||
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
|
||||
## If orientation data is present and the image actually
|
||||
## needs rotating ("1" means no rotation)...
|
||||
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
|
||||
## ...auto-rotate the image according to the EXIF data.
|
||||
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
|
||||
fi
|
||||
|
||||
## `w3mimgdisplay` will be called for all images (unless overriden
|
||||
## as above), but might fail for unsupported types.
|
||||
exit 7;;
|
||||
|
||||
## Video
|
||||
video/*)
|
||||
# Thumbnail
|
||||
ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||
exit 1;;
|
||||
|
||||
## PDF
|
||||
# application/pdf)
|
||||
# pdftoppm -f 1 -l 1 \
|
||||
# -scale-to-x "${DEFAULT_SIZE%x*}" \
|
||||
# -scale-to-y -1 \
|
||||
# -singlefile \
|
||||
# -jpeg -tiffcompression jpeg \
|
||||
# -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
||||
# && exit 6 || exit 1;;
|
||||
|
||||
|
||||
## ePub, MOBI, FB2 (using Calibre)
|
||||
# application/epub+zip|application/x-mobipocket-ebook|\
|
||||
# application/x-fictionbook+xml)
|
||||
# # ePub (using https://github.com/marianosimone/epub-thumbnailer)
|
||||
# epub-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" \
|
||||
# "${DEFAULT_SIZE%x*}" && exit 6
|
||||
# ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FILE_PATH}" \
|
||||
# >/dev/null && exit 6
|
||||
# exit 1;;
|
||||
|
||||
## Font
|
||||
application/font*|application/*opentype)
|
||||
preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
|
||||
if fontimage -o "${preview_png}" \
|
||||
--pixelsize "120" \
|
||||
--fontname \
|
||||
--pixelsize "80" \
|
||||
--text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
|
||||
--text " abcdefghijklmnopqrstuvwxyz " \
|
||||
--text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
|
||||
--text " The quick brown fox jumps over the lazy dog. " \
|
||||
"${FILE_PATH}";
|
||||
then
|
||||
convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
|
||||
&& rm "${preview_png}" \
|
||||
&& exit 6
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
## Preview archives using the first image inside.
|
||||
## (Very useful for comic book collections for example.)
|
||||
# application/zip|application/x-rar|application/x-7z-compressed|\
|
||||
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
|
||||
# local fn=""; local fe=""
|
||||
# local zip=""; local rar=""; local tar=""; local bsd=""
|
||||
# case "${mimetype}" in
|
||||
# application/zip) zip=1 ;;
|
||||
# application/x-rar) rar=1 ;;
|
||||
# application/x-7z-compressed) ;;
|
||||
# *) tar=1 ;;
|
||||
# esac
|
||||
# { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
|
||||
# { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
|
||||
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
|
||||
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
|
||||
#
|
||||
# fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
|
||||
# [ print(l, end='') for l in sys.stdin if \
|
||||
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
|
||||
# sort -V | head -n 1)
|
||||
# [ "$fn" = "" ] && return
|
||||
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
|
||||
#
|
||||
# [ "$tar" ] && tar --extract --to-stdout \
|
||||
# --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
|
||||
# [ "$bsd" ] && bsdtar --extract --to-stdout \
|
||||
# --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||
# [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
|
||||
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
|
||||
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||
# ;;
|
||||
esac
|
||||
|
||||
# openscad_image() {
|
||||
# TMPPNG="$(mktemp -t XXXXXX.png)"
|
||||
# openscad --colorscheme="${OPENSCAD_COLORSCHEME}" \
|
||||
# --imgsize="${OPENSCAD_IMGSIZE/x/,}" \
|
||||
# -o "${TMPPNG}" "${1}"
|
||||
# mv "${TMPPNG}" "${IMAGE_CACHE_PATH}"
|
||||
# }
|
||||
|
||||
# case "${FILE_EXTENSION_LOWER}" in
|
||||
# ## 3D models
|
||||
# ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH}
|
||||
# ## is hardcoded as jpeg. So we make a tempfile.png and just
|
||||
# ## move/rename it to jpg. This works because image libraries are
|
||||
# ## smart enough to handle it.
|
||||
# csg|scad)
|
||||
# openscad_image "${FILE_PATH}" && exit 6
|
||||
# ;;
|
||||
# 3mf|amf|dxf|off|stl)
|
||||
# openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6
|
||||
# ;;
|
||||
# esac
|
||||
}
|
||||
|
||||
handle_mime() {
|
||||
local mimetype="${1}"
|
||||
case "${mimetype}" in
|
||||
## RTF and DOC
|
||||
text/rtf|*msword)
|
||||
## Preview as text conversion
|
||||
## note: catdoc does not always work for .doc files
|
||||
## catdoc: http://www.wagner.pp.ru/~vitus/software/catdoc/
|
||||
catdoc -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## DOCX, ePub, FB2 (using markdown)
|
||||
## You might want to remove "|epub" and/or "|fb2" below if you have
|
||||
## uncommented other methods to preview those formats
|
||||
*wordprocessingml.document|*/epub+zip|*/x-fictionbook+xml)
|
||||
## Preview as markdown conversion
|
||||
pandoc -s -t markdown -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## XLS
|
||||
*ms-excel)
|
||||
## Preview as csv conversion
|
||||
## xls2csv comes with catdoc:
|
||||
## http://www.wagner.pp.ru/~vitus/software/catdoc/
|
||||
xls2csv -- "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## Text
|
||||
text/* | */xml)
|
||||
## Syntax highlight
|
||||
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
|
||||
exit 2
|
||||
fi
|
||||
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||
local pygmentize_format='terminal256'
|
||||
local highlight_format='xterm256'
|
||||
else
|
||||
local pygmentize_format='terminal'
|
||||
local highlight_format='ansi'
|
||||
fi
|
||||
env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
|
||||
--out-format="${highlight_format}" \
|
||||
--force -- "${FILE_PATH}" && exit 5
|
||||
env COLORTERM=8bit bat --color=always --style="plain" \
|
||||
-- "${FILE_PATH}" && exit 5
|
||||
pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
|
||||
-- "${FILE_PATH}" && exit 5
|
||||
exit 2;;
|
||||
|
||||
## DjVu
|
||||
image/vnd.djvu)
|
||||
## Preview as text conversion (requires djvulibre)
|
||||
djvutxt "${FILE_PATH}" | fmt -w "${PV_WIDTH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## Image
|
||||
image/*)
|
||||
## Preview as text conversion
|
||||
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
|
||||
## Video and audio
|
||||
video/* | audio/*)
|
||||
mediainfo "${FILE_PATH}" && exit 5
|
||||
exiftool "${FILE_PATH}" && exit 5
|
||||
exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle_fallback() {
|
||||
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
|
||||
handle_image "${MIMETYPE}"
|
||||
fi
|
||||
handle_extension
|
||||
handle_mime "${MIMETYPE}"
|
||||
handle_fallback
|
||||
|
||||
exit 1
|
87
.config/spotifyd/spotifyd.conf
Normal file
87
.config/spotifyd/spotifyd.conf
Normal file
|
@ -0,0 +1,87 @@
|
|||
[global]
|
||||
# A command that gets executed and can be used to
|
||||
# retrieve your username and password.
|
||||
# The command should return the password on stdout.
|
||||
#
|
||||
# This is an alternative to the `user` and `password` fields. Both
|
||||
# can't be used simultaneously.
|
||||
username_cmd = "bw get username spotify.com"
|
||||
password_cmd = "bw get password spotify.com"
|
||||
|
||||
# If set to true, `spotifyd` tries to look up your
|
||||
# password in the system's password storage.
|
||||
# This is an alternative to the `password` field. Both
|
||||
# can't be used simultaneously.
|
||||
use_keyring = false
|
||||
|
||||
# If set to true, `spotifyd` tries to bind to dbus (default is the session bus)
|
||||
# and expose MPRIS controls. When running headless, without the session bus,
|
||||
# you should set this to false, to avoid errors. If you still want to use MPRIS,
|
||||
# have a look at the `dbus_type` option.
|
||||
use_mpris = true
|
||||
|
||||
# The bus to bind to with the MPRIS interface.
|
||||
# Possible values: "session", "system"
|
||||
# The system bus can be used if no graphical session is available
|
||||
# (e.g. on headless systems) but you still want to be able to use MPRIS.
|
||||
# NOTE: You might need to add appropriate policies to allow spotifyd to
|
||||
# own the name.
|
||||
dbus_type = "session"
|
||||
|
||||
# The audio backend used to play music. To get
|
||||
# a list of possible backends, run `spotifyd --help`.
|
||||
backend = "alsa" # use portaudio for macOS [homebrew]
|
||||
|
||||
# The volume controller. Each one behaves different to
|
||||
# volume increases. For possible values, run `spotifyd --help`.
|
||||
volume_controller = "alsa" # use softvol for macOS
|
||||
|
||||
# A command that gets executed in your shell after each song changes.
|
||||
on_song_change_hook = "command_to_run_on_playback_events"
|
||||
|
||||
# The name that gets displayed under the connect tab on
|
||||
device_name = "TUI"
|
||||
|
||||
# The audio bitrate. 96, 160 or 320 kbit/s
|
||||
bitrate = 160
|
||||
|
||||
# The directory used to cache audio data. This setting can save
|
||||
# a lot of bandwidth when activated, as it will avoid re-downloading
|
||||
# audio files when replaying them.
|
||||
#
|
||||
# Note: The file path does not get expanded. Environment variables and
|
||||
# shell placeholders like $HOME or ~ don't work!
|
||||
# you will want to change this to your actual username home path
|
||||
cache_path = "/home/friend/.cache/spotifyd"
|
||||
|
||||
# The maximal size of the cache directory in bytes
|
||||
# The example value corresponds to ~ 1GB
|
||||
max_cache_size = 1000000000
|
||||
|
||||
# If set to true, audio data does NOT get cached.
|
||||
no_audio_cache = false
|
||||
|
||||
# Volume on startup between 0 and 100
|
||||
# NOTE: This variable's type will change in v0.4, to a number (instead of string)
|
||||
initial_volume = "90"
|
||||
|
||||
# If set to true, enables volume normalisation between songs.
|
||||
volume_normalisation = true
|
||||
|
||||
# The normalisation pregain that is applied for each song.
|
||||
normalisation_pregain = -10
|
||||
|
||||
# After the music playback has ended, start playing similar songs based on the previous tracks.
|
||||
autoplay = true
|
||||
|
||||
# The port `spotifyd` uses to announce its service over the network.
|
||||
# zeroconf_port = 1234
|
||||
|
||||
# The proxy `spotifyd` will use to connect to spotify.
|
||||
# you probably don't need this for default settings
|
||||
# proxy = "http://proxy.example.org:8080"
|
||||
|
||||
# The displayed device type in Spotify clients.
|
||||
# Can be unknown, computer, tablet, smartphone, speaker, t_v,
|
||||
# a_v_r (Audio/Video Receiver), s_t_b (Set-Top Box), and audio_dongle.
|
||||
device_type = "speaker"
|
3
.config/tmux/tmux.conf
Normal file
3
.config/tmux/tmux.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
source "/home/friend/.local/lib/python3.11/site-packages/powerline/bindings/tmux/powerline.conf"
|
||||
set-option -g default-terminal "xterm-256color"
|
||||
set-option -ga terminal-overrides ',xterm-256color:Tc'
|
9
.config/vale/.vale.ini
Normal file
9
.config/vale/.vale.ini
Normal file
|
@ -0,0 +1,9 @@
|
|||
StylesPath = ~/.config/vale/styles
|
||||
|
||||
MinAlertLevel = suggestion
|
||||
|
||||
Packages = RedHat, proselint, write-good, alex, Readability, Joblint
|
||||
|
||||
[*]
|
||||
BasedOnStyles = Vale, RedHat, proselint, write-good, alex, Readability, Joblint
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue