mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
Compare commits
284 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
84f04a89fb | ||
![]() |
a6de7b2c39 | ||
c494790557 | |||
c2b444b806 | |||
f10b11f6e6 | |||
4c12c73634 | |||
![]() |
2b0954001d | ||
dc347a4f64 | |||
fd149b4fcf | |||
c6231ab934 | |||
![]() |
e279caeb4f | ||
a74cbdebed | |||
![]() |
c604100bbe | ||
![]() |
118d924c47 | ||
c623fbac71 | |||
64c5e552c3 | |||
30dacb82b2 | |||
![]() |
74ba820f4f | ||
dde96e5bd4 | |||
f59a6c5610 | |||
b41a1032d2 | |||
fd46efc032 | |||
c2371a1d7f | |||
83d617307c | |||
9c54948744 | |||
2639abf4e3 | |||
4aedfbcdbf | |||
b384c2d6a9 | |||
7a1ef41cfc | |||
9576fca922 | |||
8523842837 | |||
![]() |
0b75198c3f | ||
28981ed8ad | |||
17021b258c | |||
56fba7459d | |||
328f407a00 | |||
d7b7f81716 | |||
4fcad26251 | |||
7c57103793 | |||
dc5a8e9a39 | |||
1f63664246 | |||
88f130c69e | |||
11875a3856 | |||
70026f7c6d | |||
477b695f83 | |||
5e2485a01e | |||
9ab65f2936 | |||
d3f8c94c0c | |||
9b38ea8a9a | |||
be41ba6623 | |||
403c712eb6 | |||
d81624fcfa | |||
054c9fde75 | |||
d1833a8003 | |||
c522d834c0 | |||
c7bf66dc90 | |||
ffdce37002 | |||
f63d4175b5 | |||
3517a09789 | |||
def3c5421b | |||
a41e8ac625 | |||
0d2b5509dd | |||
8f45306743 | |||
fff909c88e | |||
72a347df76 | |||
44e677de67 | |||
7094f065b6 | |||
e13649d8f6 | |||
1ef48b778c | |||
8521cfa950 | |||
08dc365064 | |||
447ced29b1 | |||
a3eb5a1047 | |||
375ba09a36 | |||
6a4b23ad6f | |||
3bb1b2bbd5 | |||
712adcfe4a | |||
04bd4b55e2 | |||
b22ad9985a | |||
913c2364a8 | |||
c9b6d7dbcc | |||
a1b0a4e0e1 | |||
8babd1fdf9 | |||
6e495966fd | |||
0b28ec9643 | |||
17a715e60f | |||
236230a977 | |||
a5c1db9110 | |||
48ccb0abb7 | |||
f22bf730c5 | |||
e87621f43f | |||
a76ad24fff | |||
2dcc0e4674 | |||
95d5276a25 | |||
296870a6ea | |||
994c396e4f | |||
017b058beb | |||
a281a8d6fc | |||
34f50222f6 | |||
e9a54b9bd1 | |||
09949b5305 | |||
6c3a0f9138 | |||
4b6fc876a1 | |||
2a245977bd | |||
cbc6cf4f54 | |||
8d6968eb4a | |||
b08ed54249 | |||
eef0cbdf69 | |||
2e3d5e2935 | |||
1391a813f7 | |||
d2deda439b | |||
672774eba2 | |||
e2de64e7f9 | |||
78a61cbbbf | |||
ab22a4e7ed | |||
698b079579 | |||
2bf45e8122 | |||
aca14cabde | |||
f6344059bc | |||
a667bc5baa | |||
560bb68388 | |||
f91fe5d0cb | |||
d392b6d0cd | |||
b59449dc9b | |||
27a3f5b72e | |||
96a6c940d2 | |||
d2805183a3 | |||
1474454bfe | |||
16d445d1e2 | |||
b5f7f8aeb0 | |||
f8ab80487a | |||
482418fae7 | |||
10bc6c4ad9 | |||
dba6112b95 | |||
57fbfe70fc | |||
24e26acf03 | |||
89ef8853f4 | |||
1bba6cfaf4 | |||
0496208d46 | |||
![]() |
61cd1607eb | ||
cbc14bea4e | |||
b025a3e00b | |||
ccc7183941 | |||
f07c11d303 | |||
ae00cc6c41 | |||
ea59b01167 | |||
69b7a7c464 | |||
438b7e1c91 | |||
0186c7626c | |||
6bff25fdf8 | |||
d4d57580ee | |||
6cd2123100 | |||
89f8ab434b | |||
f977ccea12 | |||
838c2fbf1e | |||
517bdb9c16 | |||
9ae067c7a6 | |||
468a36714e | |||
61c9908b67 | |||
629cf61184 | |||
b3cfd887b6 | |||
fe6c0d2aa8 | |||
b0c76967d7 | |||
629a87a562 | |||
4792ab80f3 | |||
84fe0c4241 | |||
a3c633e023 | |||
d5d0873464 | |||
73228ffabd | |||
6eaebb515f | |||
9eb6f7d712 | |||
7ba0780843 | |||
f6b1bbfcfd | |||
dcdb8a2f2f | |||
18f2376801 | |||
0b4b172d5f | |||
a2ff8bca42 | |||
cb01fc2d0c | |||
39902c4d91 | |||
0150a14a2f | |||
ff7e141ffd | |||
0affd54d76 | |||
2cb716cb5d | |||
54ba4401b6 | |||
6c96e1e3dc | |||
9179e98525 | |||
3eefbf5dda | |||
9b0178eb89 | |||
68b1058d5e | |||
29444ef2fe | |||
61d532fa16 | |||
eeaa80090a | |||
5febe52c4a | |||
802da468ef | |||
4a8f81e8d6 | |||
24176a2eec | |||
46676ae283 | |||
f420ca6918 | |||
8f01d5a3bc | |||
c51707ef8d | |||
700e90cc73 | |||
7fbdba4b8c | |||
d2541f3fff | |||
2480a0b2cd | |||
a9fb741060 | |||
590c6baa39 | |||
814080d085 | |||
bfab8cb105 | |||
96bcdc4c32 | |||
b1d2945a4f | |||
d36c893c2e | |||
6d74d8deb0 | |||
ea25e05737 | |||
dcb8f34dd7 | |||
a024f0e468 | |||
0e35f7d359 | |||
c021e20d3c | |||
18b38d64f2 | |||
b20af19750 | |||
66f537087d | |||
eeda696341 | |||
ac0f64f16f | |||
638b19f68d | |||
8820a5c964 | |||
cab5ced8f2 | |||
ce0ff170f3 | |||
43842882ec | |||
8564519d11 | |||
7eaedc14ca | |||
d492b34411 | |||
6096f3137e | |||
4be9a4d4f0 | |||
aef212aded | |||
3fc92244d9 | |||
540fa55ade | |||
6a37bf62c2 | |||
37ae2dce7e | |||
44dfab4778 | |||
e20fdf0e8a | |||
ad16ab93cd | |||
aad3847d2d | |||
d9445931df | |||
0de3cf35fe | |||
45443c9767 | |||
30953bdea3 | |||
be09e3eacd | |||
86e6187f78 | |||
bec9e316f2 | |||
0c16d55cae | |||
5b2a50ab6c | |||
a9e9fc27ce | |||
c812b7834c | |||
b7221ebcd5 | |||
26a92312c0 | |||
6451bbb929 | |||
9fb451768c | |||
4b5b8d5e6e | |||
b61a9ee363 | |||
8d51163e46 | |||
cbead5382b | |||
7329a15f88 | |||
91ad5fdcde | |||
![]() |
b689fc8a01 | ||
![]() |
068d7de898 | ||
![]() |
03c0622f5a | ||
![]() |
9e2db3b12e | ||
![]() |
711412aa8b | ||
![]() |
9248229444 | ||
![]() |
3c3c6281a4 | ||
![]() |
c18a8c2f5e | ||
bc6587b101 | |||
2db074e4f3 | |||
784bbf241e | |||
b08bfdca50 | |||
4e665c87bd | |||
a40a3f6e5c | |||
35342559c6 | |||
7f9ac4829c | |||
![]() |
7bb6fcfb4a | ||
![]() |
58a9d35e5e | ||
9abb4ef132 | |||
1ef2a0be3a | |||
2aa90909fe | |||
20b9477e3e |
82 changed files with 6149 additions and 3052 deletions
|
@ -1,2 +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
|
||||
|
|
20
.bashrc
20
.bashrc
|
@ -12,7 +12,7 @@ esac
|
|||
set bell-style none
|
||||
|
||||
# python version is subject to change, but really important for pathing
|
||||
export PYTHON_VERSION="3.11"
|
||||
export PYTHON_VERSION="3.12"
|
||||
|
||||
# this just makes howdoi use colors
|
||||
export HOWDOI_COLORIZE=1
|
||||
|
@ -20,9 +20,6 @@ export HOWDOI_COLORIZE=1
|
|||
# makes gpg prompt for passphrase in the terminal for git commit -S
|
||||
export GPG_TTY=$(tty)
|
||||
|
||||
# use linux/amd64 platform by default on macOS - may break KinD!
|
||||
export DOCKER_DEFAULT_PLATFORM=linux/amd64
|
||||
|
||||
# source all the pathing exports including XDG Base Dir Spec env vars
|
||||
. ~/.config/bash/path.sh
|
||||
|
||||
|
@ -51,11 +48,18 @@ 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 [ ! -z $SSH_CLIENT ]; then
|
||||
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
|
||||
|
||||
|
@ -76,14 +80,12 @@ fi
|
|||
# $XDG_DATA_HOME/fastfetch/presets/ #
|
||||
# -------------------------------------------------------------------------- #
|
||||
if [ ! -z $LOCALHOST_PRESET ] && [ -z $NVIM ]; then
|
||||
alias fastfetch="echo '' && fastfetch --load-config $LOCALHOST_PRESET && echo ''"
|
||||
else
|
||||
alias fastfetch="echo '' && fastfetch && echo ''"
|
||||
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
|
||||
alias fastfetch="echo '' && fastfetch --logo-type none && echo ''"
|
||||
echo "Entering a poetry shell, so not printing fastfetch."
|
||||
else
|
||||
fastfetch
|
||||
fi
|
||||
|
|
|
@ -7,18 +7,16 @@ if [[ $(uname) == *"Darwin"* ]]; then
|
|||
# Always use GNU sed
|
||||
alias sed='gsed'
|
||||
else
|
||||
# wezterm requires this if it's installed via flatpak
|
||||
# alias wezterm='flatpak run org.wezfurlong.wezterm'
|
||||
# freetube only seems to work through flatpak on debian
|
||||
alias freetube="flatpak run io.freetubeapp.FreeTube"
|
||||
# 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 top='btm'
|
||||
alias gotop='btm'
|
||||
# can never spell clear
|
||||
alias celar='clear'
|
||||
|
@ -32,8 +30,9 @@ alias tere='tree'
|
|||
# can't spell docker
|
||||
alias docekr='docker'
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python 🐍 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# can't spell python
|
||||
alias pip="pip3.11"
|
||||
alias pip="pip$PYTHON_VERSION"
|
||||
alias pthyon="python$PYTHON_VERSION"
|
||||
alias ptyhon="python$PYTHON_VERSION"
|
||||
alias pythong="python$PYTHON_VERSION"
|
||||
|
@ -42,6 +41,9 @@ 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"'
|
||||
|
@ -56,13 +58,13 @@ alias tracert='traceroute'
|
|||
alias whereami='hostname'
|
||||
alias whoareyou='echo "I am $HOSTNAME, your favorite computer 🥰"'
|
||||
|
||||
# scrncpy installs adb for you, but it's awkward to use, so we just alias it
|
||||
alias adb='scrcpy.adb'
|
||||
|
||||
# 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"
|
||||
|
||||
|
@ -70,11 +72,15 @@ alias todo="$EDITOR ~/todo.md"
|
|||
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
|
||||
# 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 devd="docker run -it --platform=linux/arm64 -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' jessebot/onboardme:latest-arm"
|
||||
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 devd="docker run -it -v ~/repos:/home/friend/repos -v ~/.ssh:/home/friend/.ssh --env 'TZ=Europe/Brussels' jessebot/onboardme:latest"
|
||||
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
|
||||
|
||||
|
||||
|
@ -110,14 +116,44 @@ 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
|
||||
}
|
||||
|
||||
# glab is gitlab's cli, but I always type gl by accident
|
||||
alias gl='glab'
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# -------------------------- CUSTOM FUNCTIONS ----------------------------- #
|
||||
|
|
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"
|
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
|
|
@ -4,64 +4,221 @@
|
|||
export KUBECONFIG=$XDG_CONFIG_HOME/kube/config
|
||||
|
||||
# this is for the kubernetes plugin manager, krew
|
||||
export KREW_ROOT=$XDG_CONFIG_HOME/krew
|
||||
export PATH="${PATH}:$XDG_CONFIG_HOME/krew/bin"
|
||||
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 k="kubectl"
|
||||
alias ka="kubectl apply -f"
|
||||
alias kc="kubectl config use-context"
|
||||
alias kd="kubectl describe"
|
||||
alias ke="kubectl exec -it"
|
||||
alias kg="kubectl get"
|
||||
alias kl="kubectl logs -f"
|
||||
alias kcc="$SEARCH_TOOL current $KUBECONFIG"
|
||||
alias kdm="kubectl describe nodes -l kubernetes.io/role=master"
|
||||
alias kdn="kubectl describe nodes -l kubernetes.io/role=node"
|
||||
alias kgm="kubectl get nodes -l kubernetes.io/role=master"
|
||||
alias kgn="kubectl get nodes -l kubernetes.io/role=node"
|
||||
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 | grep -v postgres | grep -v metrics | tail -n 1 | awk '{print $1}'"
|
||||
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'
|
||||
|
||||
# switch to different k8s envs
|
||||
function kcs() {
|
||||
kubectl config use-context k8s-$1.$domain
|
||||
if [ "$?" != "0" ]; then
|
||||
kubectl config use-context k8s-$1.$domain
|
||||
fi
|
||||
kubectl config set-context $(kubectl config current-context) --namespace=default
|
||||
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() {
|
||||
kubectl delete pod --grace-period=0 --force $1
|
||||
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 {
|
||||
echo "k = kubectl";
|
||||
echo "ka = kubectl apply -f (applies a k8s yaml file to current cluster)";
|
||||
echo "kc = kubectl config use-context (switch to EXACT cluster name)";
|
||||
echo "kd = kubectl describe";
|
||||
echo "ke = kubectl exec -it";
|
||||
echo "kg = kubectl get";
|
||||
echo "kl = kubectl logs -f (follow logs for a pod)";
|
||||
echo "k8p = switch to prod k8 instance";
|
||||
echo "k8dw = switch to data warehouse k8 instance";
|
||||
echo "kcc = echoes current k8s cluster you're connecting to";
|
||||
echo "kcs <dev/qa/prod> = switch current context to given namespace";
|
||||
echo "kdn = kubectl describe nodes";
|
||||
echo "kfd <pod-name> = force delete of pod";
|
||||
echo "kns <namespace> = switch current context to given namespace";
|
||||
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}";
|
||||
};
|
||||
|
||||
# set current namespace function
|
||||
function kns() {
|
||||
kubectl config set-context $(kubectl config current-context) --namespace=$1
|
||||
}
|
||||
# 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
|
|
@ -7,7 +7,7 @@ source ~/.config/bash/history.sh
|
|||
# Pathing #
|
||||
# -------------------------------------------------------------------------- #
|
||||
# python version is subject to change
|
||||
export PYTHON_VERSION="3.11"
|
||||
export PYTHON_VERSION="3.12"
|
||||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Linux PATH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
if [[ $(uname) == *"Linux"* ]]; then
|
||||
|
|
|
@ -7,6 +7,7 @@ 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
|
||||
|
@ -23,12 +24,6 @@ if [[ $(uname) == *"Linux"* ]]; then
|
|||
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 (if python is installed via brew)
|
||||
# pip_packages="/home/linuxbrew/.linuxbrew/lib/python$PYTHON_VERSION/site-packages"
|
||||
|
||||
# apt installed location of pip installed python3.x packages
|
||||
pip_packages="$HOME/.local/lib/python$PYTHON_VERSION/site-packages"
|
||||
|
||||
# pip packages with command line tools install here by default with apt installed python
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
|
||||
|
@ -36,14 +31,17 @@ if [[ $(uname) == *"Linux"* ]]; then
|
|||
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
|
||||
# iterm2 specific commands and functions, not really using this these days
|
||||
export PATH=$PATH:$HOME/.local/bin/iterm2
|
||||
|
||||
# don't warn me that BASH is deprecated, becasuse it is already upgraded
|
||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||
|
||||
|
@ -52,19 +50,28 @@ if [[ $(uname) == *"Darwin"* ]]; then
|
|||
# put python data into $HOME/.local/share/python
|
||||
export PYTHONUSERBASE=$XDG_DATA_HOME/python
|
||||
|
||||
pip_packages="$XDG_DATA_HOME/python/lib/python/site-packages"
|
||||
# this is for python XDG spec stuff
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
|
||||
if [ $(uname -a | grep arm > /dev/null ; echo $?) -eq 0 ]; then
|
||||
# this is for python XDG spec stuff
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
# 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
|
||||
# For older macs before the M1, pre-2020, WITHOUT apple silicon
|
||||
export PATH="$PYTHONUSERBASE/bin:$PATH"
|
||||
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -80,20 +87,33 @@ 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 GOROOT=$HOME/.local/bin
|
||||
export PATH=$PATH:/usr/local/go/bin:$GOROOT
|
||||
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
|
||||
|
||||
|
@ -108,5 +128,10 @@ 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
|
||||
# updates PATH for the Google Cloud SDK.
|
||||
if [ -f "$HOME/.local/bin/google-cloud-sdk/path.bash.inc" ]; then . "$HOME/.local/bin/google-cloud-sdk/path.bash.inc"; fi
|
||||
|
||||
# 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"
|
||||
|
||||
|
|
|
@ -17,9 +17,26 @@ alias vi=$EDITOR
|
|||
alias vim=$EDITOR
|
||||
# I and many others always try to type neovim :)
|
||||
alias neovim=$EDITOR
|
||||
alias nivm=$EDITOR
|
||||
alias ivm=$EDITOR
|
||||
alias vmi=$EDITOR
|
||||
|
||||
# make all colors work by default
|
||||
# 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,
|
||||
|
@ -44,27 +61,32 @@ export LESS_TERMCAP_us=$'\e[1;4;35m'
|
|||
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cat ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
|
||||
# TODO: Write those docs with links to both apps (rich, and bat)
|
||||
# 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 file has more lines than legnth of the terminal use app with pager
|
||||
too_long=false
|
||||
if [ $(wc -l $1 | awk '{print $1}') -gt $(tput lines) ]; then
|
||||
too_long=true
|
||||
fi
|
||||
|
||||
# if this is a markdown or csv file, ALWAYS use rich to print the data
|
||||
if [[ "$1" == *".md" ]] || [[ "$1" == *".csv" ]]; then
|
||||
if $too_long; then
|
||||
# pager allows moving with j for down, k for up, and :q for quit
|
||||
rich --pager $1
|
||||
else
|
||||
rich $1
|
||||
echo ""
|
||||
fi
|
||||
# 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 - sytnax highlighting + git support and pager
|
||||
bat $1 || batcat $1
|
||||
# use batcat - syntax highlighting + git support
|
||||
bat --plain --theme=spacechalk --pager=never "$1" || batcat --pager=never --theme=spacechalk --plain "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
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
|
@ -4,14 +4,14 @@
|
|||
|
||||
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
|
||||
# for a list of all available themes
|
||||
--theme="DarkNeon"
|
||||
--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
|
||||
--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
|
||||
|
|
|
@ -2,290 +2,516 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>spacechalk</string>
|
||||
<key>settings</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>background</key>
|
||||
<string>#3E3E3E</string>
|
||||
<key>caret</key>
|
||||
<string>#585858</string>
|
||||
<key>foreground</key>
|
||||
<string>#FFFFFF</string>
|
||||
<key>invisibles</key>
|
||||
<string>#585858</string>
|
||||
<key>lineHighlight</key>
|
||||
<string>#323232</string>
|
||||
<key>selection</key>
|
||||
<string>#5cc9fd</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Comment</string>
|
||||
<key>scope</key>
|
||||
<string>comment</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#585858</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>String</string>
|
||||
<key>scope</key>
|
||||
<string>string</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>foreground</key>
|
||||
<string>#f6f76a</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>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Keyword</string>
|
||||
<key>scope</key>
|
||||
<string>keyword</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>#5f87ff</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>#5f87ff</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>#a8fd57</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>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>D8D5E82E-3D5B-46B5-B38A-8C841C21347A</string>
|
||||
<key>colorSpaceName</key>
|
||||
<string>sRGB</string>
|
||||
<key>semanticClass</key>
|
||||
<string>theme.dark.monokai</string>
|
||||
<!--
|
||||
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.
|
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."
|
|
@ -1,366 +0,0 @@
|
|||
# Fastfetch configuration
|
||||
# Write every argument in different lines.
|
||||
# Direct arguments will overwrite the corresponding ones in this file.
|
||||
# Argument keys are not case sensitive.
|
||||
# Whitespaces are trimmed at the beginning and the end.
|
||||
# Empty lines or lines starting with # are ignored.
|
||||
|
||||
# This file was shipped with 1.8.1.
|
||||
# Use fastfetch --print-config-user > ~/.config/fastfetch/config.conf to overwrite this file with the current defaults
|
||||
|
||||
# Below some often usefull options are listed. Uncomment and modify them so they take affect.
|
||||
# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help".
|
||||
# Of course all of them can be made persistent here too.
|
||||
|
||||
# Config option:
|
||||
# Load additional config files.
|
||||
# Some are shipped with fastfetch, list them with "fastfetch --list-presets".
|
||||
# Must be a path to a config file or the name of a shipped preset.
|
||||
# The config file is completly loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones.
|
||||
# Can be used multiple times to load multiple config files / presets.
|
||||
#--load-config /path/to/config.txt
|
||||
|
||||
# Structure option:
|
||||
# Sets the modules to use and their order.
|
||||
# Must be a list of module names, separated by colons.
|
||||
# List available modules with "fastfetch --list-modules".
|
||||
# Get the default structure with "fastfetch --print-structure".
|
||||
--structure Title:Separator:OS:Uptime:GPU:CPU:Memory:Disk:Break:Colors:Break
|
||||
|
||||
# Multithreading option:
|
||||
# Sets if fastfetch should use multiple threads to detect the values.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
--multithreading true
|
||||
|
||||
# Print stat option:
|
||||
# Sets if fastfetch should print time usage (in ms) for individual modules
|
||||
# If true, it will also enable --show-errors
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--stat true
|
||||
|
||||
# Slow operations option:
|
||||
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--allow-slow-operations false
|
||||
|
||||
# Linewrap option:
|
||||
# Sets if fastfetch should disable linewrap during the run.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--disable-linewrap true
|
||||
|
||||
# Cursor option:
|
||||
# Sets if fastfetch should hide the console cursor during the run.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--hide-cursor true
|
||||
|
||||
# Logo option:
|
||||
# Sets the logo to use.
|
||||
# List available logos with "fastfetch --list-logos".
|
||||
# Print available logos with "fastfetch --print-logos".
|
||||
# Must be the name of an available logo or a path to a text file containing a custom logo.
|
||||
# Default is the current distribution.
|
||||
--logo dogontheinternet.png
|
||||
|
||||
# Logo type option:
|
||||
# Sets the logo type to use.
|
||||
# Must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty or chafa.
|
||||
# Default is auto.
|
||||
--logo-type sixel
|
||||
|
||||
# Logo width option:
|
||||
# Sets the width of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 65.
|
||||
--logo-width 20
|
||||
|
||||
# Logo height option:
|
||||
# Sets the height of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (keeps aspect ration).
|
||||
--logo-height 12
|
||||
|
||||
# Logo color options:
|
||||
# Overwrite a color in the logo. Also works for user provided logos.
|
||||
# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the one specified by the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
# Valid index range is [1-9].
|
||||
#--logo-color-1 red
|
||||
#--logo-color-2 32
|
||||
# [...]
|
||||
#--logo-color-9 yellow
|
||||
|
||||
# Logo padding option:
|
||||
# Adds a padding to the left and the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
#--logo-padding 0
|
||||
|
||||
# Logo padding left option:
|
||||
# Adds a padding to the left side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
--logo-padding-left 1
|
||||
|
||||
# Logo padding right option:
|
||||
# Adds a padding to the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
#--logo-padding-right 0
|
||||
|
||||
# Logo print remaining option:
|
||||
# Sets if the remaining logo should be printed, it is has more lines than modules to show.
|
||||
# Must be true or false. Default is true.
|
||||
# --logo-print-remaining true
|
||||
|
||||
# Color keys option:
|
||||
# Sets the color of the keys.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the key color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-keys magenta
|
||||
|
||||
# Color title option:
|
||||
# Sets the color of the title.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the title color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-title blue
|
||||
|
||||
# Binary prefix option:
|
||||
# Sets the binary prefix to use.
|
||||
# Must be a IEC, SI or JEDEC.
|
||||
# Default is IEC.
|
||||
#--binary-prefix IEC
|
||||
|
||||
# Title FQDN option:
|
||||
# Sets if the title should use the fully qualified domain name.
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--title-fqdn false
|
||||
|
||||
# Separator option:
|
||||
# Sets the string placed between a key and its value.
|
||||
# Can be any string.
|
||||
# Default is ": ".
|
||||
#--separator ": "
|
||||
|
||||
# Separator string option:
|
||||
# Sets the string printed by the "separator" module (usually between title and rest of output)
|
||||
# Must be any string. It is repated / cut to fit perfectly.
|
||||
# Default is "-"
|
||||
#--separator-string -
|
||||
|
||||
# Public IP URL option:
|
||||
# Sets the URL of public IP detection server to be used.
|
||||
# Only HTTP protocol is supported, and the value should not contain "http://" prefix.
|
||||
# Default is "ipinfo.io/ip".
|
||||
#--public-ip-url "ipinfo.io/ip"
|
||||
|
||||
# Public IP timeout option:
|
||||
# Sets the time to wait for the public ip server to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--public-ip-timeout 0
|
||||
|
||||
# Weather output format option:
|
||||
# Sets the weather format to be used. It must be URI encoded.
|
||||
# See: https://github.com/chubin/wttr.in#one-line-output
|
||||
# Default is "%t+-+%C+(%l)".
|
||||
#--weather-output-format "%t+-+%C+(%l)"
|
||||
|
||||
# Weather timeout option:
|
||||
# Sets the time to wait for the weather server (wttr.in) to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--weather-timeout 0
|
||||
|
||||
# OS file option
|
||||
# Sets the path to the file containing the operating system information.
|
||||
# Should be a valid path to an existing file.
|
||||
# Default is /etc/os-release.
|
||||
#--os-file /etc/os-release
|
||||
|
||||
# Player name option
|
||||
# Sets the name of the player. This is also used in song detection
|
||||
# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify)
|
||||
# Default is the first match starting with org.mpris.MediaPlayer2.
|
||||
#--player-name spotify
|
||||
|
||||
# Escape bedrock option
|
||||
# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--escape-bedrock true
|
||||
|
||||
# GL option
|
||||
# Sets with opengl context creation library to use
|
||||
# Must be either auto, egl, glx or osmesa
|
||||
# Default is auto.
|
||||
#--gl auto
|
||||
|
||||
# Percentage output type option
|
||||
# Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported.
|
||||
# Only works with default format ( without --module-format option ).
|
||||
# 0: prints none; 1: prints percent number only; 2: prints bar only; 3: prints both percent number and bar
|
||||
#--percent-type 1
|
||||
|
||||
# Key options:
|
||||
# Sets the displayed key of a module
|
||||
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.
|
||||
#--os-key OS
|
||||
#--host-key Host
|
||||
#--chassis-key Chassis
|
||||
#--kernel-key Kernel
|
||||
#--uptime-key Uptime
|
||||
#--processes-key Processes
|
||||
#--packages-key Packages
|
||||
#--shell-key Shell
|
||||
#--resolution-key Resolution {1}
|
||||
#--de-key DE
|
||||
#--wm-key WM
|
||||
#--wm-theme-key WM Theme
|
||||
#--theme-key Theme
|
||||
#--icons-key Icons
|
||||
#--font-key Font
|
||||
#--cursor-key Cursor
|
||||
#--terminal-key Terminal
|
||||
#--terminal-font-key Terminal Font
|
||||
#--cpu-key CPU
|
||||
#--cpu-usage-key CPU Usage
|
||||
#--gpu-key GPU {1}
|
||||
#--memory-key Memory
|
||||
#--swap-key Swap
|
||||
#--disk-key Disk ({1})
|
||||
#--battery-key Battery {1}
|
||||
#--poweradapter-key Power Adapter {1}
|
||||
#--locale-key Locale
|
||||
#--local-ip-key Local IP ({1})
|
||||
#--public-ip-key Public IP
|
||||
#--wifi-key Wifi
|
||||
#--weather-key Weather
|
||||
#--player-key Media Player
|
||||
#--media-key Media
|
||||
#--datetime-key Date Time
|
||||
#--vulkan-key Vulkan
|
||||
#--opengl-key OpenGL
|
||||
#--opencl-key OpenCL
|
||||
#--users-key Users
|
||||
|
||||
# Format options:
|
||||
# Sets the format string for module values.
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format".
|
||||
# An empty format string (As they are currently below) will behave as if it was not set.
|
||||
#--os-format
|
||||
#--host-format
|
||||
#--chassis-format
|
||||
#--kernel-format
|
||||
#--uptime-format
|
||||
#--processes-format
|
||||
#--packages-format
|
||||
#--shell-format
|
||||
#--resolution-format
|
||||
#--de-format
|
||||
#--wm-format
|
||||
#--wm-theme-format
|
||||
#--theme-format
|
||||
#--icons-format
|
||||
#--font-format
|
||||
#--cursor-format
|
||||
#--terminal-format
|
||||
#--terminal-font-format
|
||||
#--cpu-format
|
||||
#--cpu-usage-format
|
||||
#--gpu-format
|
||||
#--memory-format
|
||||
#--swap-format
|
||||
#--disk-format
|
||||
#--battery-format
|
||||
#--poweradapter-format
|
||||
#--locale-format
|
||||
#--local-ip-format
|
||||
#--public-ip-format
|
||||
#--weather-format
|
||||
#--player-format
|
||||
#--media-format
|
||||
#--datetime-format
|
||||
#--vulkan-format
|
||||
#--opengl-format
|
||||
#--opencl-format
|
||||
#--users-format
|
||||
|
||||
# Error options:
|
||||
# Sets the format string to use if an error occured
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# Each of them take the error as first and only argument.
|
||||
# If one of them is set, the module will appear, even if --show-errors is not given.
|
||||
#--os-error
|
||||
#--host-error
|
||||
#--chassis-error
|
||||
#--kernel-error
|
||||
#--uptime-error
|
||||
#--processes-error
|
||||
#--packages-error
|
||||
#--shell-error
|
||||
#--resolution-error
|
||||
#--de-error
|
||||
#--wm-error
|
||||
#--wm-theme-error
|
||||
#--theme-error
|
||||
#--icons-error
|
||||
#--font-error
|
||||
#--cursor-error
|
||||
#--terminal-error
|
||||
#--terminal-font-error
|
||||
#--cpu-error
|
||||
#--cpu-usage-error
|
||||
#--gpu-error
|
||||
#--memory-error
|
||||
#--swap-error
|
||||
#--disk-error
|
||||
#--battery-error
|
||||
#--poweradapter-error
|
||||
#--locale-error
|
||||
#--local-ip-error
|
||||
#--public-ip-error
|
||||
#--weather-error
|
||||
#--player-error
|
||||
#--media-error
|
||||
#--datetime-error
|
||||
#--vulkan-error
|
||||
#--opengl-error
|
||||
#--opencl-error
|
||||
#--users-error
|
||||
|
||||
# Library options:
|
||||
# Sets an user specific path to a library to load.
|
||||
# Must be a valid path to a library.
|
||||
#--lib-PCI /usr/lib/libpci.so
|
||||
#--lib-vulkan /usr/lib/libvulkan.so (libMoltenVK.dylib on macOS)
|
||||
#--lib-wayland /usr/lib/libwayland-client.so
|
||||
#--lib-xcb-randr /usr/lib/libxcb-randr.so
|
||||
#--lib-xcb /usr/lib/libxcb.so
|
||||
#--lib-Xrandr /usr/lib/libXrandr.so
|
||||
#--lib-X11 /usr/lib/libX11.so
|
||||
#--lib-gio /usr/lib/libgio-2.0.so
|
||||
#--lib-DConf /usr/lib/libdconf.so
|
||||
#--lib-DBus /usr/lib/libdbus-1.so
|
||||
#--lib-XFConf /usr/lib/libxfconf-0.so
|
||||
#--lib-sqlite3 /usr/lib/libsqlite3.so
|
||||
#--lib-rpm /usr/lib/librpm.so
|
||||
#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so
|
||||
#--lib-z /usr/lib/libz.so
|
||||
#--lib-chafa /usr/lib/libchafa.so
|
||||
#--lib-egl /usr/lib/libEGL.so
|
||||
#--lib-glx /usr/lib/libGLX.so
|
||||
#--lib-osmesa /usr/lib/libOSMesa.so
|
||||
#--lib-opencl /usr/lib/libOpenCL.so
|
||||
#--lib-cjson /usr/lib/libcjson.so
|
||||
#--lib-freetype /data/data/com.termux/files/usr/lib<69>
|
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"
|
||||
]
|
||||
}
|
|
@ -13,3 +13,4 @@ aliases:
|
|||
http_unix_socket:
|
||||
# What web browser gh should use when opening URLs. If blank, will refer to environment.
|
||||
browser: w3m
|
||||
version: "1"
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
# set better default colors
|
||||
[color]
|
||||
ui = auto
|
||||
ui = auto
|
||||
[color "branch"]
|
||||
current = green bold
|
||||
local = green dim
|
||||
remote = blue
|
||||
current = green bold
|
||||
local = green dim
|
||||
remote = blue
|
||||
[color "diff"]
|
||||
meta = yellow bold
|
||||
frag = magenta ul
|
||||
old = magenta bold
|
||||
new = green bold
|
||||
meta = yellow bold
|
||||
frag = magenta ul
|
||||
old = magenta bold
|
||||
new = green bold
|
||||
[color "status"]
|
||||
added = green
|
||||
changed = yellow
|
||||
untracked = magenta
|
||||
added = green
|
||||
changed = yellow
|
||||
untracked = magenta
|
||||
|
||||
# set the default branch to main
|
||||
[init]
|
||||
|
@ -26,10 +26,45 @@
|
|||
|
||||
# default rebase commits to avoid merge issues
|
||||
[pull]
|
||||
rebase = true
|
||||
rebase = true
|
||||
|
||||
# personal stuff like gpg config, username, etc
|
||||
[includeIf "gitdir:~/"]
|
||||
path = ~/.config/git/personal
|
||||
path = ~/.config/git/personal
|
||||
|
||||
# aliases, mostly fixing typos
|
||||
[alias]
|
||||
root = rev-parse --show-toplevel
|
||||
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
|
||||
|
|
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
|
|
@ -30,7 +30,7 @@ color:
|
|||
# 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: default
|
||||
theme: custom
|
||||
|
||||
# == Date ==
|
||||
# This specifies the date format for the date column. The freeform format
|
||||
|
|
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
|
|
@ -14,29 +14,25 @@ vim.opt.numberwidth = 4
|
|||
-- highlight current line
|
||||
vim.opt.cursorline = true
|
||||
|
||||
-- highlighted column 80, only on python files, to keep lines shorter
|
||||
vim.opt.colorcolumn = '80'
|
||||
|
||||
-- vim.opt.termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- make searching case insensitive
|
||||
vim.opt.ignorecase = true
|
||||
|
||||
-- moved directly to lazy
|
||||
-- require('user.keymap')
|
||||
-- make searching case sensitive if at least one character is cap
|
||||
vim.opt.smartcase = true
|
||||
|
||||
-- load plugins
|
||||
-- require("lazy").setup("plugins")
|
||||
require('user.lazy')
|
||||
|
||||
-- --------- Plugin configs that have to be called after lazy --------------
|
||||
-- starting page for neovim
|
||||
-- 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
|
||||
|
||||
-- status line at bottom of window for cool file facts
|
||||
require('user.lualine')
|
||||
|
||||
-- directory tree; can open with :Neotree
|
||||
|
@ -46,25 +42,16 @@ require('user.neo-tree')
|
|||
require("user.gitsigns")
|
||||
require("user.scrollbar")
|
||||
|
||||
-- floating windows
|
||||
require('user.fterm')
|
||||
|
||||
-- dim inactive windows - moved to lazy directly
|
||||
-- require("tint").setup()
|
||||
-- more configurable terminal for neovim
|
||||
require("user.toggleterm")
|
||||
|
||||
-- Language Server configs and other syntax checking and highlight tools
|
||||
require('user.lsp-configs')
|
||||
|
||||
-- autocommand to disable lsp semantic highlighting for parameter/variable in
|
||||
-- Dockerfile because it competes with treesitter and is worse
|
||||
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
|
||||
pattern = {"Dockerfile", "Dockerfile.*"},
|
||||
callback = function()
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.parameter.dockerfile', {})
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.variable.dockerfile', {})
|
||||
end,
|
||||
})
|
||||
-- Run startup autocommands
|
||||
require('user.autocommands')
|
||||
|
||||
-- treesitter is for sytax highlighting
|
||||
require('user.tree-sitter')
|
||||
|
||||
-- folding and indentation
|
||||
|
@ -77,4 +64,4 @@ require('user.completion')
|
|||
require('user.nvim-colorizer')
|
||||
|
||||
-- experiment to give you a remote git permalink URL for your your current line
|
||||
-- require('user.git_url')
|
||||
require('user.git_url')
|
||||
|
|
|
@ -1,158 +0,0 @@
|
|||
-- --------------- startup dashboard screen for neovim ----------------------
|
||||
return {
|
||||
'glepnir/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
config = function()
|
||||
-- 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 = "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
|
||||
end
|
||||
}
|
|
@ -1,434 +0,0 @@
|
|||
return {
|
||||
-- ------------------------------ tab line -------------------------------
|
||||
-- might go to bufferline:
|
||||
-- https://github.com/LazyVim/LazyVim/blob/7a8ca6222a554bdb78fb8de35404672fc4042302/lua/lazyvim/plugins/ui.lua#L52
|
||||
{'romgrk/barbar.nvim',
|
||||
dependencies = {'nvim-tree/nvim-web-devicons'},
|
||||
lazy = true,
|
||||
config = function()
|
||||
-- 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,
|
||||
|
||||
-- Enables / disables diagnostic symbols
|
||||
diagnostics = {
|
||||
-- you can use a list
|
||||
{enabled = true, icon = ''}, -- ERROR
|
||||
{enabled = false, icon = ''}, -- WARN
|
||||
{enabled = false, icon = ''}, -- INFO
|
||||
{enabled = true, icon = ''}, -- HINT
|
||||
},
|
||||
|
||||
-- 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 = true,
|
||||
|
||||
-- If set, the icon color will follow its corresponding buffer
|
||||
-- highlight group. By default, the Buffer*Icon group is linked to the
|
||||
-- Buffer* group (see Highlighting below). Otherwise, it will take its
|
||||
-- default value as defined by devicons.
|
||||
icon_custom_colors = false,
|
||||
|
||||
-- Configure icons on the bufferline.
|
||||
icon_separator_active = '▎',
|
||||
icon_separator_inactive = '▎',
|
||||
icon_close_tab = '',
|
||||
icon_close_tab_modified = '',
|
||||
icon_pinned = '',
|
||||
|
||||
-- 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,
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
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" },
|
||||
}
|
||||
})
|
||||
-- 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', 'branch', 'diff' },
|
||||
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 = {},
|
||||
}
|
||||
-- this file is for customizations for floating terminals in neovim
|
||||
|
||||
local fterm = require("FTerm")
|
||||
|
||||
-- create a vim command for FTermOpen
|
||||
vim.api.nvim_create_user_command('FTermOpen', require('FTerm').open, { bang = true })
|
||||
|
||||
-- -------------------------- open normal terminal ----------------------------
|
||||
-- cmatrix must be installed beforehand with brew install cmatrix
|
||||
local cmatrix = fterm:new({
|
||||
ft = 'fterm_cmatrix',
|
||||
cmd = "cmatrix",
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
})
|
||||
|
||||
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 = fterm:new({
|
||||
ft = 'fterm_gitui',
|
||||
cmd = "gitui",
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
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 = fterm:new({
|
||||
ft = 'fterm_k9s',
|
||||
cmd = "k9s",
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
'K9s',
|
||||
function()
|
||||
k9s:toggle()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
||||
|
||||
|
||||
-- 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 = " ",
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
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",
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
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,
|
||||
})
|
|
@ -88,6 +88,15 @@ db.setup({
|
|||
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,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
-- 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
|
||||
|
@ -5,29 +6,44 @@ local function get_git_url()
|
|||
|
||||
-- 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[@]", "")
|
||||
|
||||
-- this only works on github right now
|
||||
if string.find(base_domain, "github") then
|
||||
-- get the name of the current opened file
|
||||
local current_file = vim.fn.expand('%:p')
|
||||
-- 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-toplevel")
|
||||
remote_file_path = current_file:gsub(git_root_dir, "")
|
||||
print(remote_file_path)
|
||||
-- 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))
|
||||
|
||||
-- get the current line number
|
||||
local current_line = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
file_line = remote_file_path .. "#L" .. current_line
|
||||
-- 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+", "")
|
||||
|
||||
local branch = vim.fn.system("git branch --show")
|
||||
-- get name of branch
|
||||
local branch = vim.fn.system("git branch --show")
|
||||
|
||||
-- changes jessebot/onboardme.git to jessebot/onboardme/blob/main/
|
||||
repo_branch_url = owner_repo:gsub(".git", "/blob/" .. branch)
|
||||
-- changes jessebot/onboardme.git to jessebot/onboardme/blob/main/
|
||||
local repo_branch_url = owner_repo:gsub(".git", "/blob/" .. branch)
|
||||
|
||||
local gh_url = "https://github.com/" .. repo_branch_url .. "/" .. file_line
|
||||
print(gh_url)
|
||||
end
|
||||
-- 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
|
||||
|
||||
get_git_url()
|
||||
-- adds a command called :GitUrl
|
||||
vim.api.nvim_create_user_command(
|
||||
'GitUrl',
|
||||
function()
|
||||
get_git_url()
|
||||
end,
|
||||
{ bang = true }
|
||||
)
|
||||
|
|
|
@ -36,7 +36,4 @@ require('gitsigns').setup({
|
|||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
})
|
||||
|
|
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
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
-- --------------------------------------------------------------------------
|
||||
-- INDENT ZONE
|
||||
-- --------------------------------------------------------------------------
|
||||
vim.opt.tabstop = 4
|
||||
-- vim.opt.tabstop = 8
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.tabstop = 8
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
|
@ -13,22 +12,28 @@ vim.opt.autoindent = true
|
|||
-- Also load indent files, to automatically do language-dependent indenting.
|
||||
-- filetype plugin indent on
|
||||
|
||||
-- from https://github.com/lukas-reineke/indent-blankline.nvim#screenshots
|
||||
vim.cmd [[highlight IndentBlanklineIndent1 guifg=#47476c gui=nocombine]]
|
||||
vim.cmd [[highlight IndentBlanklineIndent2 guifg=#5b5b8b gui=nocombine]]
|
||||
-- ref: https://github.com/lukas-reineke/indent-blankline.nvim
|
||||
|
||||
vim.opt.list = true
|
||||
-- add a dot in blank spaces for indents
|
||||
-- vim.opt.listchars:append "space:⋅"
|
||||
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 },
|
||||
|
||||
require("indent_blankline").setup {
|
||||
space_char_blankline = " ",
|
||||
char_highlight_list = {
|
||||
"IndentBlanklineIndent1",
|
||||
"IndentBlanklineIndent2",
|
||||
},
|
||||
-- :echo &filetype
|
||||
filetype_exclude = {
|
||||
"dashboard"
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"dashboard",
|
||||
"markdown"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +1,121 @@
|
|||
-- map leader to <Space>
|
||||
-- ~~~~~~~~~~~~~~~~~~~~~~~ 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)
|
||||
-- Enter to fold code (collapses code block)
|
||||
vim.keymap.set('n', '<enter>', 'za')
|
||||
|
||||
-- ---------------------- fterm windows ----------------------------
|
||||
-- CTRL+t keybindings to toggle terminal
|
||||
vim.keymap.set('n', '<C-t>', '<CMD>lua require("FTerm").toggle()<CR>')
|
||||
vim.keymap.set('t', '<C-t>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>')
|
||||
-- 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" }
|
||||
)
|
||||
|
||||
-- cmatrix
|
||||
vim.keymap.set('n', '<leader>M', '<cmd>Matrix<cr>', { desc = " The Matrix™️" })
|
||||
-- gitui
|
||||
vim.keymap.set('n', '<leader>g', '<cmd>Gitui<cr>', { desc = " gitui - terminal UI for git" })
|
||||
-- k9s
|
||||
vim.keymap.set('n', '<leader>K', '<cmd>K9s<cr>', { desc = " k9s - kubernetes dashboard" })
|
||||
-- bpython
|
||||
vim.keymap.set('n', '<leader>p', '<cmd>Bpython<cr>', { desc = " bpython - color + docs in interactive python" })
|
||||
-- ---------------------- 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" })
|
||||
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>TroubleToggle<cr>",
|
||||
{silent = true, noremap = true}
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>d",
|
||||
"<cmd>Trouble diagnostics toggle<cr>",
|
||||
{
|
||||
silent = true,
|
||||
noremap = true,
|
||||
desc = "🐛 Diagnostics for the active buffer"
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
-- installs lazy, our plugin manager for neovim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system(
|
||||
{
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
}
|
||||
)
|
||||
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)
|
||||
|
||||
|
@ -29,11 +30,10 @@ local plugins = {
|
|||
},
|
||||
-- -------------------- startup screen for neovim ------------------------
|
||||
{
|
||||
'glepnir/dashboard-nvim',
|
||||
'nvimdev/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
}
|
||||
},
|
||||
-- -------------------------- status line --------------------------------
|
||||
|
@ -43,12 +43,18 @@ local plugins = {
|
|||
priority = 900, -- load this b4 all other plugins, except colorscheme
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
},
|
||||
-- -------------------- floating window plugins --------------------------
|
||||
-- configurable floating terminal window, replaces 'hsalem7/nvim-k8s'
|
||||
|
||||
-- --------------- fancy terminal, use CTRL+t to try it out --------------
|
||||
{
|
||||
"numToStr/FTerm.nvim",
|
||||
cmd = {'FtermOpen', 'Gitui', 'Matrix', 'K9s'}
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = "*",
|
||||
opts = {--[[ things you want to change go here]]}
|
||||
}
|
||||
},
|
||||
|
||||
-- -------------------- floating window plugins --------------------------
|
||||
-- -----------------------------------------------------------------------
|
||||
-- noicer ui - experimental
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
|
@ -124,7 +130,7 @@ local plugins = {
|
|||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
cmd = "Neotree",
|
||||
branch = "v2.x",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
|
@ -141,48 +147,52 @@ local plugins = {
|
|||
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
|
||||
{
|
||||
"utilyre/barbecue.nvim",
|
||||
name = "barbecue",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
opts = {
|
||||
show_dirname = false,
|
||||
show_basename = false,
|
||||
context_follow_icon_color = true,
|
||||
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 = "",
|
||||
},
|
||||
},
|
||||
'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 ---------------------------
|
||||
{
|
||||
|
@ -206,11 +216,12 @@ local plugins = {
|
|||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.foldlevelstart = 99
|
||||
end,
|
||||
build = "TSUpdateSync"
|
||||
build = ":TSUpdateSync"
|
||||
},
|
||||
-- add visual lines for indentation
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim"
|
||||
"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
|
||||
|
@ -225,10 +236,20 @@ local plugins = {
|
|||
'folke/twilight.nvim'
|
||||
},
|
||||
-- for markdown tables -- maybe not working?
|
||||
-- {'dhruvasagar/vim-table-mode'},
|
||||
--
|
||||
{
|
||||
'towolf/vim-helm'
|
||||
'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
|
||||
|
@ -301,9 +322,15 @@ local plugins = {
|
|||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
cmd = "TSUpdateSync",
|
||||
build = "MasonUpdate" -- :MasonUpdate updates registry contents
|
||||
-- :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",
|
||||
|
@ -318,12 +345,22 @@ local plugins = {
|
|||
}
|
||||
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
|
||||
-- tag = '0.1.1', -- latest we've seen
|
||||
cmd = "Telescope",
|
||||
dependencies = {'nvim-lua/plenary.nvim'},
|
||||
key = {
|
||||
|
@ -355,11 +392,23 @@ local plugins = {
|
|||
},
|
||||
|
||||
},
|
||||
-- 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 -------------------------
|
||||
-- for highlighting hex colors (in vim, CSS, JS, HTML)
|
||||
{
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
ft = {'css', 'lua'},
|
||||
-- for highlighting hex colors
|
||||
ft = {'css', 'lua', 'vim', 'html', 'js', 'scss'},
|
||||
},
|
||||
-- logging syntax and highlighting -- 'mtdl9/vim-log-highlighting'
|
||||
{
|
||||
|
@ -390,6 +439,28 @@ local plugins = {
|
|||
'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)
|
||||
|
|
|
@ -5,7 +5,7 @@ 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_lsp", "lua_ls" }
|
||||
ensure_installed = { "bashls", "jedi_language_server", "ruff", "lua_ls" }
|
||||
}
|
||||
|
||||
-- Set up lspconfig.
|
||||
|
@ -17,12 +17,12 @@ local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|||
-- Setup the language servers so that they're available for our LSP client.
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
-- ansible
|
||||
-- ansible
|
||||
lspconfig.ansiblels.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- bash
|
||||
-- bash
|
||||
lspconfig.bashls.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
@ -34,13 +34,42 @@ 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
|
||||
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
|
||||
-- lua
|
||||
lspconfig.lua_ls.setup{
|
||||
settings = {
|
||||
Lua = {
|
||||
|
@ -64,7 +93,7 @@ lspconfig.lua_ls.setup{
|
|||
},
|
||||
}
|
||||
|
||||
-- markdown
|
||||
-- markdown
|
||||
lspconfig.marksman.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
@ -75,10 +104,21 @@ lspconfig.jedi_language_server.setup{
|
|||
}
|
||||
|
||||
-- python - ruff linting
|
||||
lspconfig.ruff_lsp.setup{
|
||||
lspconfig.ruff.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- rust
|
||||
lspconfig.rust_analyzer.setup{
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
diagnostics = {
|
||||
enable = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-- terraform
|
||||
lspconfig.terraformls.setup{
|
||||
capabilities = capabilities
|
||||
|
@ -88,7 +128,7 @@ lspconfig.terraformls.setup{
|
|||
-- Installation ref: https://github.com/terraform-linters/tflint#installation
|
||||
lspconfig.tflint.setup{}
|
||||
|
||||
-- toml
|
||||
-- toml
|
||||
lspconfig.taplo.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
@ -98,31 +138,41 @@ lspconfig.vimls.setup{
|
|||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- yaml - not sure if this is worth it yet
|
||||
-- github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls
|
||||
-- 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.23.0-standalone-strict/all.json"] = "/*.k8s.yaml",
|
||||
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*"
|
||||
},
|
||||
}},
|
||||
capabilities = capabilities
|
||||
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
|
||||
}
|
||||
|
||||
-- change the diagnostic signs to be nerdfonts
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
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,
|
||||
})
|
||||
|
|
|
@ -84,7 +84,36 @@ require('lualine').setup {
|
|||
lualine_a = {
|
||||
{ 'mode', separator = { left = '' }, right_padding = 2 },
|
||||
},
|
||||
lualine_b = { 'filename', 'branch', 'diff' },
|
||||
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 = {
|
||||
|
|
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
|
||||
}
|
||||
})
|
|
@ -1,5 +1,7 @@
|
|||
require("colorizer").setup({
|
||||
'css';
|
||||
css = { rgb_fn = true; };
|
||||
'lua';
|
||||
'vim';
|
||||
'scss';
|
||||
'xml';
|
||||
})
|
||||
|
|
|
@ -1,20 +1,26 @@
|
|||
-- this file is for customizations for floating terminals in neovim
|
||||
-- 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 fterm = require("FTerm")
|
||||
|
||||
-- create a vim command for FTermOpen
|
||||
vim.api.nvim_create_user_command('FTermOpen', require('FTerm').open, { bang = true })
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
|
||||
-- -------------------------- open normal terminal ----------------------------
|
||||
-- cmatrix must be installed beforehand with brew install cmatrix
|
||||
local cmatrix = fterm:new({
|
||||
ft = 'fterm_cmatrix',
|
||||
cmd = "cmatrix",
|
||||
env = {FTERM_TUI = 'True'},
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
local cmatrix = Terminal:new({
|
||||
cmd = "cmatrix",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
|
@ -28,17 +34,15 @@ vim.api.nvim_create_user_command(
|
|||
|
||||
-- ---------------------------- open gitui -----------------------------------
|
||||
-- gitui must be installed beforehand with brew install gitui
|
||||
local gitui = fterm:new({
|
||||
ft = 'fterm_gitui',
|
||||
cmd = "gitui",
|
||||
env = {FTERM_TUI = 'True'},
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
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()
|
||||
|
@ -50,14 +54,13 @@ vim.api.nvim_create_user_command(
|
|||
|
||||
-- ------------------------------ open k9s -----------------------------------
|
||||
-- install k9s beforehand: https://k9scli.io/topics/install/
|
||||
local k9s = fterm:new({
|
||||
ft = 'fterm_k9s',
|
||||
cmd = "k9s",
|
||||
env = {FTERM_TUI = 'True'},
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
local k9s = Terminal:new({
|
||||
cmd = "k9s",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
|
@ -69,16 +72,16 @@ vim.api.nvim_create_user_command(
|
|||
)
|
||||
|
||||
|
||||
|
||||
-- ------------------------------ open bpython -------------------------------
|
||||
-- install bpython beforehand: brew install bpython
|
||||
local bpython = fterm:new({
|
||||
ft = 'fterm_bpython',
|
||||
cmd = "bpython",
|
||||
env = {FTERM_TUI = 'True'},
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
local bpython = Terminal:new({
|
||||
cmd = "bpython",
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
env = {
|
||||
NVIM_TOGGLE_TERM = 'True'
|
||||
},
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command(
|
|
@ -2,11 +2,14 @@ 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",
|
||||
|
@ -25,8 +28,8 @@ require'nvim-treesitter.configs'.setup {
|
|||
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
|
||||
-- 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"},
|
||||
|
@ -45,3 +48,5 @@ require'nvim-treesitter.configs'.setup {
|
|||
-- 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
|
|
@ -1,41 +1,33 @@
|
|||
---
|
||||
# ______________________________________________________________ #
|
||||
# Config file for the onboardme cli command. #
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
|
||||
# - This is the default config file that pip will install into: #
|
||||
# $PYTHON_PATH/lib/onboardme/config/onboardme_config.yaml #
|
||||
# #
|
||||
# - If this files exists as: ~/.config/onboardme/config.yaml #
|
||||
# then its loaded instead of the default config #
|
||||
# -------------------------------------------------------------- #
|
||||
|
||||
# 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"
|
||||
# don't output anything to the console, if set and log file passed in, still
|
||||
# creates a log file. unstable.
|
||||
# quiet: false
|
||||
|
||||
|
||||
# steps refer to a specific function in the list of functions we run
|
||||
steps:
|
||||
# these are mac specific steps
|
||||
# mac specific steps
|
||||
Darwin:
|
||||
- dot_files
|
||||
- packages
|
||||
- font_setup
|
||||
- neovim_setup
|
||||
- cron
|
||||
- sudo_setup
|
||||
# these are linux specific steps
|
||||
# linux specific steps
|
||||
Linux:
|
||||
- dot_files
|
||||
- packages
|
||||
- font_setup
|
||||
# - vim_setup # you can install vim instead of, or in addition to, neovim
|
||||
- neovim_setup
|
||||
- cron
|
||||
- group_setup
|
||||
|
||||
dot_files:
|
||||
|
@ -43,43 +35,105 @@ 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"
|
||||
# !CAREFUL: runs a `git reset --hard`, which will overwite/delete files in ~
|
||||
# that conflict with the above defined git repo url and branch.
|
||||
# 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:
|
||||
# these are macOS specific steps
|
||||
# macOS specific steps
|
||||
Darwin:
|
||||
- brew
|
||||
- pip3.11
|
||||
# these are linux specific steps
|
||||
- pip3.12
|
||||
- pipx
|
||||
# Debian/Ubuntu specific steps
|
||||
Linux:
|
||||
- brew
|
||||
- pip3.11
|
||||
- apt
|
||||
- snap
|
||||
- brew
|
||||
- pip3.12
|
||||
- pipx
|
||||
- flatpak
|
||||
- snap
|
||||
# list of extra existing packages groups to install
|
||||
groups:
|
||||
- default
|
||||
# uncomment these to add them as default installed package groups
|
||||
# - gaming
|
||||
# - work
|
||||
# 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
|
||||
|
||||
# Coming soon: to edit the specific packages: ~/.config/onboardme/packages.yaml
|
||||
# 🚧 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
|
||||
|
||||
### TODO: make this work, it's a nice dream though.
|
||||
# any URL we can curl to download a folder from
|
||||
# wallpapers_download_url: ""
|
||||
# 🚧 this section is under construction
|
||||
# set wallpapers directory. MacOS: https://apple.stackexchange.com/a/348454
|
||||
# wallpapers_dir: ""
|
||||
|
|
|
@ -7,19 +7,12 @@ brew:
|
|||
upgrade: "brew upgrade --quiet"
|
||||
install: "brew install "
|
||||
cleanup: "brew cleanup"
|
||||
# these are essentially just extra git repos to query for installs/updates
|
||||
taps:
|
||||
Linux:
|
||||
# this should solve font issues :D
|
||||
- "homebrew/linux-fonts"
|
||||
- "wez/wezterm-linuxbrew"
|
||||
macOS:
|
||||
- "wez/wezterm"
|
||||
- "zegervdv/zathura"
|
||||
- "homebrew/cask-fonts"
|
||||
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
|
||||
|
@ -32,7 +25,9 @@ brew:
|
|||
- zellij
|
||||
# recording a shell session to share with others
|
||||
- asciinema
|
||||
# TUI IDE is neovim
|
||||
# scientific calculator
|
||||
- numbat
|
||||
# TUI IDE is neovim
|
||||
- neovim
|
||||
# fuzzy search, helps with completion and searching
|
||||
- fzf
|
||||
|
@ -83,6 +78,8 @@ brew:
|
|||
- 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
|
||||
|
@ -95,16 +92,21 @@ brew:
|
|||
- bash
|
||||
# so that bash completion stuff works
|
||||
- "bash-completion@2"
|
||||
# FOSS video editoring software https://kdenlive.org/
|
||||
- kdenlive
|
||||
# fonts
|
||||
- "--cask font-mononoki"
|
||||
- "--cask font-symbols-only-nerd-font"
|
||||
- "--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
|
||||
- "--cask firefox"
|
||||
# File server cloud replacement, not ready yet
|
||||
# - "--cask nextcloud"
|
||||
# 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
|
||||
|
@ -123,29 +125,58 @@ brew:
|
|||
- "--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
|
||||
|
@ -163,10 +194,6 @@ brew:
|
|||
extras:
|
||||
# installs cargo and rust
|
||||
# - rustup
|
||||
# spotify daemon
|
||||
- spotifyd
|
||||
# spotify TUI
|
||||
- spotify-tui
|
||||
# preview videos in the terminal. commented by default because it is big
|
||||
# - ffmpegthumbnailer
|
||||
# a cow that says things
|
||||
|
@ -175,6 +202,8 @@ brew:
|
|||
- sl
|
||||
# rainbow text
|
||||
- lolcat
|
||||
# tool for mirroring android screen
|
||||
- scrcpy
|
||||
mail:
|
||||
# fetch your mail locally for neomutt
|
||||
- offlineimap
|
||||
|
@ -185,28 +214,35 @@ brew:
|
|||
# markdown rendering
|
||||
- pandoc
|
||||
# zathura is a document viewer, that is not working yet
|
||||
# - zathura
|
||||
# - zathura-pdf-mupdf
|
||||
# - 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
|
||||
# - "font-mononoki"
|
||||
# - "font-symbols-only-nerd-font"
|
||||
# - "homebrew/linux-fonts/font-mononoki"
|
||||
# - "homebrew/linux-fonts/font-symbols-only-nerd-font"
|
||||
gui:
|
||||
# wezterm: Rust based terminal the is cross-OS-compatible
|
||||
- wezterm
|
||||
- "wez/wezterm-linuxbrew/wezterm"
|
||||
|
||||
apt:
|
||||
emoji: "🙃"
|
||||
commands:
|
||||
list: "scripts/get_apt_list.sh"
|
||||
update: "sudo apt-get update -y"
|
||||
upgrade: "sudo apt-get upgrade -y"
|
||||
install: "sudo apt-get install -y --no-install-recommends "
|
||||
|
@ -218,9 +254,11 @@ apt:
|
|||
# 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
|
||||
|
@ -244,14 +282,18 @@ apt:
|
|||
- wireguard
|
||||
# like top but for GPUs
|
||||
- nvtop
|
||||
# was for euporie - notebooks in terminals, but gcc is already installed
|
||||
# was for euporie - notebooks in terminals, but gcc is already installed
|
||||
# by brew so might be able to remove this
|
||||
# - gcc-11
|
||||
gui:
|
||||
# package manager
|
||||
- snapd
|
||||
# package manager for gui apps
|
||||
- flatpak
|
||||
# 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
|
||||
|
@ -260,8 +302,8 @@ apt:
|
|||
- gufw
|
||||
# pdf viewer with themeing
|
||||
- zathura
|
||||
# commented out till nextcloud is working
|
||||
# - nextcloud-desktop
|
||||
# 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
|
||||
|
@ -272,6 +314,9 @@ apt:
|
|||
- "steam:i386"
|
||||
# to format disks to exFAT; FAT is too thin for modern windows 10 ISOs
|
||||
# - exfat-utils
|
||||
music:
|
||||
- vlc
|
||||
- pulseaudio
|
||||
|
||||
flatpak:
|
||||
emoji: "🫓 "
|
||||
|
@ -281,11 +326,11 @@ flatpak:
|
|||
install: "flatpak install --user --app -y "
|
||||
packages:
|
||||
gui:
|
||||
- "org.freedesktop.Platform/x86_64/21.08"
|
||||
# - "org.freedesktop.Platform/x86_64/21.08"
|
||||
# password manager
|
||||
- com.bitwarden.desktop
|
||||
# - com.bitwarden.desktop
|
||||
# youtube alternative
|
||||
- io.freetubeapp.FreeTube
|
||||
# - io.freetubeapp.FreeTube
|
||||
gaming:
|
||||
- lutris
|
||||
|
||||
|
@ -299,61 +344,73 @@ snap:
|
|||
gui:
|
||||
- core
|
||||
# screen debugger/sharing tool for android
|
||||
- scrcpy
|
||||
# media player
|
||||
- vlc
|
||||
# - scrcpy
|
||||
|
||||
# most of this is actually for powerline, my shell prompt
|
||||
pip3.11:
|
||||
pip3.12:
|
||||
emoji: "🐍"
|
||||
commands:
|
||||
list: "pip3.11 list"
|
||||
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.11 install --upgrade --user --break-system-packages "
|
||||
install: "pip3.12 install --upgrade --user --break-system-packages "
|
||||
# env_vars:
|
||||
# PYTHONUSERBASE: ""
|
||||
packages:
|
||||
default:
|
||||
# keep ourselves up to date
|
||||
- onboardme
|
||||
# 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
|
||||
# this is for git pre-commits
|
||||
- pre-commit
|
||||
# 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
|
||||
- poetry
|
||||
# - ruff
|
||||
# - flake8
|
||||
# - pyflakes
|
||||
# - autoflake
|
||||
# this is needed to make python respect XDG Base directory specific
|
||||
- xdg_base_dirs
|
||||
extra:
|
||||
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:
|
||||
# might be needed for development and building
|
||||
- build
|
||||
- twine
|
||||
# this is a k8s tool to spin up clusters on your local machine
|
||||
- smol-k8s-lab
|
||||
- poetry
|
||||
- ruff
|
||||
# aws stuff
|
||||
- aws-mfa
|
||||
- euporie
|
||||
# need this for python notebooks
|
||||
- ipykernel
|
||||
# latest jupyter notebooks
|
||||
- jupyterlab
|
||||
# classic python notebooks
|
||||
# - notebook
|
||||
# - ipykernel
|
||||
# notebook-driven development platform
|
||||
# - nbdev
|
||||
# this is for markdown notebook docs and such
|
||||
# - quarto
|
||||
# notebooks in the terminal 💚
|
||||
- euporie
|
||||
# - jupyterlab
|
||||
# classic python notebooks
|
||||
# - notebook
|
||||
music:
|
||||
# terminal based youtube player
|
||||
- yewtube
|
||||
# python spotify tui: https://github.com/ceuk/spotui
|
||||
- spotui
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
{ "segments": {
|
||||
"above": [{
|
||||
"left": [
|
||||
{
|
||||
"function": "powerline.segments.common.net.hostname"
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.env.environment",
|
||||
"name": "docker_enabled",
|
||||
"draw_soft_divider": false,
|
||||
"draw_soft_divider": true,
|
||||
"draw_hard_divider": true,
|
||||
"args": {
|
||||
"variable": "CURRENT_SHELL_LOCATION"
|
||||
}
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.net.hostname"
|
||||
},
|
||||
{
|
||||
"function": "powerline.segments.common.net.internal_ip",
|
||||
"priority": 30
|
||||
|
@ -37,9 +37,9 @@
|
|||
"tag": " {}",
|
||||
"untracked": " {}",
|
||||
"changed": " {}",
|
||||
"staged": " {}",
|
||||
"staged": " {}",
|
||||
"stashed": " {}",
|
||||
"ahead": " {}",
|
||||
"ahead": " {}",
|
||||
"behind": " {}"
|
||||
}
|
||||
}
|
||||
|
@ -87,8 +87,8 @@
|
|||
"args": {
|
||||
"gamify": true,
|
||||
"full_heart": " ",
|
||||
"empty_heart": " ",
|
||||
"online": " ",
|
||||
"empty_heart": " ",
|
||||
"online": " ",
|
||||
"offline": " "
|
||||
}
|
||||
|
||||
|
@ -111,9 +111,9 @@
|
|||
{
|
||||
"type": "string",
|
||||
"name": "newline_prompt",
|
||||
"contents": "",
|
||||
"contents": " ",
|
||||
"highlight_groups": ["newline_prompt"],
|
||||
"draw_soft_divider": false,
|
||||
"draw_soft_divider": true,
|
||||
"draw_hard_divider": true
|
||||
}
|
||||
],
|
||||
|
|
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
|
||||
|
1
.config/wezterm/.gitignore
vendored
Normal file
1
.config/wezterm/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
personal_wezterm_config.lua
|
|
@ -1,7 +1,7 @@
|
|||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
|
||||
return {
|
||||
local config = {
|
||||
-- never play a bell sound
|
||||
audible_bell = "Disabled",
|
||||
|
||||
|
@ -13,13 +13,43 @@ return {
|
|||
-- don't complain if an icon or character is missing
|
||||
warn_about_missing_glyphs = false,
|
||||
font = wezterm.font_with_fallback { 'mononoki', 'Symbols Nerd Font Mono' },
|
||||
font_size = 15,
|
||||
|
||||
font_rules = {
|
||||
{
|
||||
intensity = 'Bold',
|
||||
italic = true,
|
||||
font = wezterm.font {
|
||||
family = 'Victor Mono',
|
||||
weight = 'Bold',
|
||||
style = 'Italic',
|
||||
},
|
||||
},
|
||||
{
|
||||
italic = true,
|
||||
intensity = 'Half',
|
||||
font = wezterm.font {
|
||||
family = 'Victor Mono',
|
||||
weight = 'DemiBold',
|
||||
style = 'Italic',
|
||||
},
|
||||
},
|
||||
{
|
||||
italic = true,
|
||||
intensity = 'Normal',
|
||||
font = wezterm.font {
|
||||
family = 'Victor Mono',
|
||||
style = 'Italic',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
font_size = 13,
|
||||
|
||||
-- window look and feel
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
window_decorations = "RESIZE",
|
||||
-- transparency
|
||||
window_background_opacity = 0.95,
|
||||
window_background_opacity = 0.96,
|
||||
|
||||
-- key mappings
|
||||
keys = {
|
||||
|
@ -37,14 +67,14 @@ return {
|
|||
},
|
||||
|
||||
-- Make Option-Left equivalent to Alt-b which many line editors interpret as backward-word
|
||||
{
|
||||
{
|
||||
key = 'LeftArrow',
|
||||
mods = 'OPT',
|
||||
action = act.SendString '\x1bb'
|
||||
},
|
||||
|
||||
-- Make Option-Right equivalent to Alt-f; forward-word
|
||||
{
|
||||
{
|
||||
key = 'RightArrow',
|
||||
mods = 'OPT',
|
||||
action = act.SendString '\x1bf'
|
||||
|
@ -54,6 +84,7 @@ return {
|
|||
|
||||
-- default terminal colors
|
||||
colors = {
|
||||
-- change color for background to this if you need high contrast: #1b1b29
|
||||
background = '#232336',
|
||||
foreground = '#c0caf5',
|
||||
|
||||
|
@ -88,7 +119,7 @@ return {
|
|||
'#dadfe0',
|
||||
},
|
||||
brights = {
|
||||
'#282727',
|
||||
'#6e77a0',
|
||||
'#fe8ea2',
|
||||
'#97e178',
|
||||
'#f6f76a',
|
||||
|
@ -130,5 +161,24 @@ return {
|
|||
regex = [[\b\w+://(?:[\d]{1,3}\.){3}[\d]{1,3}\S*\b]],
|
||||
format = '$0',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
-- add ssh_domains only if they're present in a local file
|
||||
local function file_exists(name)
|
||||
local f=io.open(name,"r")
|
||||
if f~=nil then io.close(f) return true else return false end
|
||||
end
|
||||
|
||||
|
||||
local function add_personal_config()
|
||||
local home = os.getenv("HOME")
|
||||
if file_exists(home .. '/.config/wezterm/personal_wezterm_config.lua') then
|
||||
local personal_config = require 'personal_wezterm_config'
|
||||
config["ssh_domains"] = personal_config.ssh_domains
|
||||
end
|
||||
end
|
||||
|
||||
pcall(add_personal_config)
|
||||
|
||||
return config
|
||||
|
|
7
.config/yamllint/config.yml
Normal file
7
.config/yamllint/config.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
extends: default
|
||||
|
||||
rules:
|
||||
# 80 chars should be enough, but don't fail if a line is longer
|
||||
line-length:
|
||||
max: 80
|
||||
level: warning
|
|
@ -1,11 +0,0 @@
|
|||
# Some simple terminal alarms
|
||||
Just a simple set of cronjobs to remind you in your terminal to keep to a sane work schedule.
|
||||
|
||||
*On mac, it now speaks the alarm as well :)* Coming soon to Linux~!!
|
||||
|
||||
## QuickStart
|
||||
```
|
||||
mkdir ~/cron
|
||||
cp alarms.sh ~/cron && cp reminders_crontab ~/cron
|
||||
crontab ~/cron/reminders_crontab
|
||||
```
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash -
|
||||
#===============================================================================
|
||||
#
|
||||
# FILE: updates.sh
|
||||
#
|
||||
# USAGE: ./updates.sh
|
||||
#
|
||||
# DESCRIPTION: Run updates for packages managers and various programs.
|
||||
# Currently Supported programs: tldr, brew
|
||||
#
|
||||
# OPTIONS: ---
|
||||
# REQUIREMENTS: ---
|
||||
# NOTES: ---
|
||||
# AUTHOR: @jessebot
|
||||
# CREATED: 09/16/2022 12:31:37 PM
|
||||
# LAST_MODIFIED: 2022-09-27 07:24:04.0 +0000
|
||||
#===============================================================================
|
||||
|
||||
set -o nounset # Treat unset variables as an error
|
||||
|
||||
# update my tldr data (cli tool for cheatsheets)
|
||||
tldr --update
|
||||
|
||||
# update brew cache and installer
|
||||
brew update
|
||||
# upgrade all brew packages every evening
|
||||
brew upgrade
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -9,7 +9,8 @@
|
|||
.config/git/personal
|
||||
.config/neomutt/keys
|
||||
.config/bash/personal/bashrc
|
||||
.confg/jump
|
||||
.confg/jump/**
|
||||
.confg/pulse/**
|
||||
.config/helm/repositories.lock
|
||||
.confg/kube/**
|
||||
.config/krew/**
|
||||
|
@ -43,7 +44,6 @@ logs
|
|||
.tldr
|
||||
.tldrc
|
||||
go
|
||||
cron
|
||||
|
||||
# --------- I do not know what this is ------------------
|
||||
.CFUserTextEncoding
|
||||
|
|
BIN
.local/bin/helm_ls
Executable file
BIN
.local/bin/helm_ls
Executable file
Binary file not shown.
|
@ -1,624 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# imgls: ls(1) listing supplemented with image thumbnails and dimensions
|
||||
#
|
||||
# Usage: imgls [--width #] [--height #] [--[no]preserve_ratio]
|
||||
# [--[no]dimensions] [--[no]unknown] [ls options] [file ...]
|
||||
#
|
||||
# Writing an image to an iTerm window is simple. See the official documentation
|
||||
# at https://iterm2.com/documentation-images.html and the write_image() function below.
|
||||
#
|
||||
# Many of ls' options are supported, but not all. The program does not support ls'
|
||||
# default -C columnar output mode - output is always one entry per line. Writing
|
||||
# images across the page in columns appears to be problematic.
|
||||
#
|
||||
# In addition, options are available to specify setting image properties (width, height,
|
||||
# preserve aspect ratio), include inline image dimensions, and disable output of
|
||||
# generic icons for unsupported image types. Finally, a table-based image dimensions
|
||||
# lookup mechanism is employed to obtain image dimensions. It can call on Perl
|
||||
# modules such as Image::Size, or call on external programs such as sips, mdls or php.
|
||||
# It is easy to add additional entries to the table. You can use the --method option
|
||||
# to select any of the currently supported methods ('sips', 'mdls', 'php', and
|
||||
# 'image::size'). These are tried, in that order; the first that appears to work
|
||||
# is used for all.
|
||||
|
||||
use v5.14;
|
||||
use strict;
|
||||
use utf8;
|
||||
use warnings;
|
||||
|
||||
use File::stat;
|
||||
use IO::Select;
|
||||
use IPC::Open3;
|
||||
use File::Spec;
|
||||
use MIME::Base64;
|
||||
use File::Basename;
|
||||
use Symbol 'gensym';
|
||||
use Encode qw(decode);
|
||||
use List::Util qw(max);
|
||||
use POSIX qw(strftime floor modf);
|
||||
use Getopt::Long qw(:config no_permute pass_through require_order);
|
||||
|
||||
STDERR->autoflush(1);
|
||||
STDOUT->autoflush(1);
|
||||
binmode STDOUT, ':encoding(UTF-8)';
|
||||
binmode STDERR, ':encoding(UTF-8)';
|
||||
|
||||
my $prog = basename $0;
|
||||
sub usage {
|
||||
my $leader = "usage: $prog";
|
||||
say STDERR
|
||||
"usage: $prog",
|
||||
" [--width #] [--height #] [--[no]preserve_ratio] [--[no]dimensions]",
|
||||
"\n",
|
||||
' ' x length($leader),
|
||||
" [--[no]unknown] [ls options] [file ...]";
|
||||
|
||||
exit shift;
|
||||
}
|
||||
|
||||
# Some defaults
|
||||
my $def_image_width = 3; # height (in character cells)
|
||||
my $def_image_height = 1; # width (in character cells)
|
||||
my $def_preserve_ratio = 'true'; # preserve aspect ratio
|
||||
|
||||
my %imgparams = ( # default image option parameters
|
||||
inline => 1, # image appears inline with text
|
||||
height => $def_image_height, # character cells tall
|
||||
width => $def_image_width, # character cells wide
|
||||
preserveAspectRatio => $def_preserve_ratio, # no stretchmarks please
|
||||
);
|
||||
|
||||
my %failed_types; # cache of file extensions that have failed
|
||||
my %stat_cache; # cache of file/directory lstat() calls
|
||||
my $curtime = time();
|
||||
my $sixmonths = (365 / 2) * 86400;
|
||||
|
||||
my %opts = (
|
||||
height => \$imgparams{'height'},
|
||||
width => \$imgparams{'width'},
|
||||
);
|
||||
get_options(\%opts);
|
||||
|
||||
# find a method to obtain image dimensions
|
||||
my $dims_methods = init_dims_methods();
|
||||
my $dims_method = find_dims_methods($dims_methods);
|
||||
|
||||
# single pixel image for non-renderable files
|
||||
my ($one_pixel_black, $one_pixel_black_len) = get_black_pixel_image();
|
||||
|
||||
my $do_newline;
|
||||
my $dot_filter = $opts{'A'} ? qr/^\.{1,2}$/ : qr/^\./;
|
||||
$dot_filter = undef if $opts{'a'};
|
||||
|
||||
# special: empty @ARGV, or contains only '.'
|
||||
my $do_header = @ARGV > 1 ? 1 : 0;
|
||||
if (@ARGV <= 1) {
|
||||
push @ARGV, '.' if @ARGV == 0;
|
||||
}
|
||||
|
||||
my (@files, @dirs);
|
||||
for (@ARGV) {
|
||||
if (! -e _lstat($_)) {
|
||||
say STDERR "$prog: $_: No such file or directory";
|
||||
}
|
||||
elsif (-f _lstat($_)) {
|
||||
push @files, $_;
|
||||
}
|
||||
else {
|
||||
push @dirs, $_;
|
||||
}
|
||||
}
|
||||
@files = ls_sort(@files);
|
||||
@dirs = ls_sort(@dirs);
|
||||
|
||||
if ($opts{'d'}) {
|
||||
push @files, @dirs;
|
||||
@dirs = ();
|
||||
}
|
||||
do_ls(undef, @files) if @files;
|
||||
|
||||
while (@dirs) {
|
||||
my $path = shift @dirs;
|
||||
|
||||
if (! -e $path) {
|
||||
say STDERR "$prog: $path: No such file or directory";
|
||||
next;
|
||||
}
|
||||
my (@f, @d);
|
||||
get_dir_content($path, $dot_filter, \@f, \@d) or
|
||||
next;
|
||||
do_ls($path, @f, @d);
|
||||
if ($opts{'R'}) {
|
||||
push @dirs, grep { ! /\.\.?$/ } @d;
|
||||
}
|
||||
$do_newline++;
|
||||
}
|
||||
|
||||
# Encodes and outputs an image file to the window
|
||||
# arg 1: path to an image file
|
||||
# arg 2: size, in bytes, of the image
|
||||
sub write_image {
|
||||
my ($file, $size) = @_;
|
||||
my $encoded;
|
||||
|
||||
$imgparams{'name'} = encode_base64($file, ''); # file name is base64 encoded
|
||||
$imgparams{'size'} = $size; # file size in bytes
|
||||
|
||||
if (ref $file eq '') {
|
||||
my $bytes = get_image_bytes($file);
|
||||
$encoded = encode_base64($bytes) if defined $bytes;
|
||||
}
|
||||
if (! $encoded or ref $file eq 'SCALAR') {
|
||||
$encoded = $one_pixel_black;
|
||||
$imgparams{'name'} = encode_base64('one_pixel_black', '');
|
||||
$imgparams{'size'} = $one_pixel_black_len;
|
||||
}
|
||||
|
||||
printf "%s%s%s;File=%s:%s%s",
|
||||
"\033", "]", "1337", # image leadin sequence (OSC + 1337)
|
||||
join(';', map { $_ . '=' . $imgparams{$_} } keys %imgparams), # semicolon separated pairs of param=value pairs
|
||||
$encoded, # base64 encoded image bytes
|
||||
"\007"; # end-of-encoding char (BEL = ^G)
|
||||
}
|
||||
|
||||
sub get_options {
|
||||
local $SIG{__WARN__} = sub { say "$prog: ", $_[0]; usage(1) };
|
||||
Getopt::Long::Configure(qw/no_ignore_case bundling no_passthrough/);
|
||||
my $result = GetOptions(\%opts,
|
||||
'dimensions!' => sub { $opts{'unknown'}++; $opts{$_[0]} = $_[1] },
|
||||
'height=s',
|
||||
'method=s', # use to force dimensions method
|
||||
"preserve_ratio!" => sub { $imgparams{'preserveAspectRatio'} = $_[1] ? 'true' : 'false' },
|
||||
'unknown!' => sub { $opts{'dimensions'}++; $opts{$_[0]} = $_[1] },
|
||||
'width=s',
|
||||
# supported ls options
|
||||
'D=s',
|
||||
't' => sub { delete $opts{'S'}; $opts{'t'}++ },
|
||||
'S' => sub { delete $opts{'t'}; $opts{'S'}++ },
|
||||
qw/ A F R T a d h i k l n o p r s u y /, 'c|U',
|
||||
);
|
||||
|
||||
$opts{'d'} and delete $opts{'R'};
|
||||
$opts{'D'} and delete $opts{'T'};
|
||||
$opts{'n'} and $opts{'l'}++;
|
||||
$opts{'o'} and $opts{'l'}++;
|
||||
$opts{'s'} and $opts{'show_blocks'}++;
|
||||
}
|
||||
|
||||
sub get_dir_content {
|
||||
my ($path, $filter, $filesref, $dirsref) = @_;
|
||||
my $dh;
|
||||
|
||||
unless (opendir($dh, $path)) {
|
||||
say STDERR "Unable to open directory $path: $!";
|
||||
return undef;
|
||||
}
|
||||
|
||||
while (readdir($dh)) {
|
||||
next if defined $filter and $_ =~ /$filter/;
|
||||
my $p = "$path/$_";
|
||||
if (-d _lstat($p)) {
|
||||
push @$dirsref, $p;
|
||||
}
|
||||
else {
|
||||
push @$filesref, $p;
|
||||
}
|
||||
}
|
||||
closedir $dh;
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub do_ls {
|
||||
my $path = shift;
|
||||
|
||||
my $blocks_total = 0;
|
||||
my (@hfiles, %widths, $st);
|
||||
for my $file (ls_sort(@_)) {
|
||||
#say "FILE: $file";
|
||||
|
||||
my %h;
|
||||
$h{'file'} = $file;
|
||||
$h{'filename'} = defined $path ? (split /\//, $file)[-1] : $file;
|
||||
$h{'st'} = $st = _lstat($file);
|
||||
$h{'ino'} = $st->ino if $opts{'i'};
|
||||
$h{'bytes'} = $st->size;
|
||||
$h{'bytesh'} = format_human($h{'bytes'}) if $opts{'h'};
|
||||
$h{'dims'} = get_dimensions($file) if $opts{'dimensions'} and -f $st && -r $st && $h{'bytes'};
|
||||
$h{'nlink'} = $st->nlink if $opts{'s'} or $opts{'l'};
|
||||
|
||||
if ($opts{'show_blocks'} or $opts{'l'}) {
|
||||
$h{'blocks'} = $st->blocks;
|
||||
if ( ! -d $st and ($opts{'a'} or $h{'filename'} !~ /^\.[^.]+/)) {
|
||||
$blocks_total += $st->blocks;
|
||||
}
|
||||
}
|
||||
|
||||
if ($opts{'l'}) {
|
||||
$h{'lsmodes'} = Stat::lsMode::format_mode($st->mode);
|
||||
$h{'owner'} = ($opts{'n'} ? $st->uid : getpwuid $st->uid) // $st->uid;
|
||||
$h{'group'} = ($opts{'n'} ? $st->gid : getgrgid $st->gid) // $st->gid if not $opts{'o'};
|
||||
$h{'time'} = format_time($opts{'c'} ? $st->ctime : $st->mtime);
|
||||
}
|
||||
push @hfiles, \%h;
|
||||
|
||||
$widths{'dim_w'} = max(defined $h{'dims'} ? length($h{'dims'}{'width'}) : 0, $widths{'dim_w'} // 0);
|
||||
$widths{'dim_h'} = max(defined $h{'dims'} ? length($h{'dims'}{'height'}) : 0, $widths{'dim_h'} // 0);
|
||||
for my $key (qw/blocks ino bytes bytesh owner group nlink/) {
|
||||
$widths{$key} = max(length($h{$key}), $widths{$key} // 0) if exists $h{$key};
|
||||
}
|
||||
}
|
||||
|
||||
# Header output when @ARGV was > 1, or after second dir
|
||||
print "\n" if $path and $do_newline;
|
||||
print "$path:\n" if $path and $do_header++;
|
||||
|
||||
# total blocks inline when -d, as header when -l or -s
|
||||
say "total ", $blocks_total / ($opts{'k'} ? 2 : 1) if $path and ! $opts{'d'} and ($opts{'show_blocks'} or $opts{'l'});
|
||||
|
||||
for my $h (@hfiles) {
|
||||
if (! -f $h->{'st'} or ! $h->{'bytes'} or ($opts{'dimensions'} and ! $h->{'dims'} and ! $opts{'unknown'})) {
|
||||
# pass a ref to indicate the data is already base64 encoded
|
||||
write_image \$one_pixel_black, $one_pixel_black_len;
|
||||
}
|
||||
else {
|
||||
write_image $h->{'file'}, $h->{'bytes'};
|
||||
}
|
||||
|
||||
if ($opts{'dimensions'}) {
|
||||
if ($widths{'dim_w'} or $widths{'dim_h'}) {
|
||||
my $min_w = $widths{'dim_w'} // 1;
|
||||
my $min_h = $widths{'dim_h'} // 1;
|
||||
if ($h->{'dims'}{'width'} or $h->{'dims'}{'height'}) {
|
||||
printf " [%*d x %*d] ", $min_w, $h->{'dims'}{'width'} // 0, $min_h, $h->{'dims'}{'height'} // 0;
|
||||
}
|
||||
else {
|
||||
printf " %*s %*s ", $min_w, ' ', $min_h, ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf " %*d", $widths{'ino'}, $h->{'ino'} if $opts{'i'};
|
||||
printf " %*d", $widths{'blocks'}, $h->{'blocks'} if $opts{'s'};
|
||||
printf " %s", $h->{'lsmodes'} if exists $h->{'lsmodes'};
|
||||
printf " %*s", $widths{'nlink'}, $h->{'nlink'} if exists $h->{'nlink'};
|
||||
printf " %*s", $widths{'owner'}, $h->{'owner'} if exists $h->{'owner'};
|
||||
printf " %*s", $widths{'group'}, $h->{'group'} if exists $h->{'group'};
|
||||
if ($opts{'l'}) {
|
||||
printf " %*d", $widths{'bytes'}, $h->{'bytes'} if ! $opts{'h'};
|
||||
printf " %4s", $h->{'bytesh'} if $opts{'h'};
|
||||
}
|
||||
printf " %s", $h->{'time'} if exists $h->{'time'};
|
||||
print " ", Encode::decode('UTF-8', defined $path ? (split /\//, $h->{'file'})[-1] : $h->{'file'});
|
||||
printf "%s", get_F_type($h->{'st'}) if $opts{'F'} or $opts{'p'};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
# Get the image's dimensions to supplement the image and ls output.
|
||||
sub get_dimensions {
|
||||
my $file = shift;
|
||||
|
||||
my ($ret, $ext);
|
||||
$file =~ /\.([^.]+)$/ and $ext = $1;
|
||||
|
||||
if ($dims_method and (!$ext or ($ext and ! exists $failed_types{$ext}))) {
|
||||
if (ref $dims_method->{'prog'} eq 'CODE') {
|
||||
$ret = $dims_method->{'format'}->($file);
|
||||
}
|
||||
else {
|
||||
my ($stdout, $stderr, $exit) = runcmd($dims_method->{'prog'}, @{$dims_method->{'args'}}, $file);
|
||||
if ($stdout) {
|
||||
$ret = $dims_method->{'format'}->($stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$failed_types{$ext}++ if ! $ret and $ext;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub runcmd {
|
||||
my $prog = shift;
|
||||
|
||||
my $pid = open3(my $in, my $out, my $err = gensym, $prog, @_);
|
||||
|
||||
my ($out_buf, $err_buf) = ('', '');
|
||||
my $select = new IO::Select;
|
||||
$select->add($out, $err);
|
||||
while (my @ready = $select->can_read(5)) {
|
||||
foreach my $fh (@ready) {
|
||||
my $data;
|
||||
my $bytes = sysread($fh, $data, 1024);
|
||||
if (! defined( $bytes) && ! $!{ECONNRESET}) {
|
||||
die "error running cmd: $prog: $!";
|
||||
}
|
||||
elsif (! defined $bytes or $bytes == 0) {
|
||||
$select->remove($fh);
|
||||
next;
|
||||
}
|
||||
else {
|
||||
if ($fh == $out) { $out_buf .= $data; }
|
||||
elsif ($fh == $err) { $err_buf .= $data; }
|
||||
else {
|
||||
die 'unexpected filehandle in runcmd';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
waitpid($pid, 0);
|
||||
return ($out_buf, $err_buf, $? >> 8);
|
||||
}
|
||||
|
||||
# List of methods to obtain image dimensions, tried in prioritized order.
|
||||
# Can be external programs or perl module. Expected to return undef when no
|
||||
# dimensions can be found, or a hash ref with 'width' and 'height' elements.
|
||||
sub init_dims_methods {
|
||||
return [
|
||||
{
|
||||
prog => 'sips',
|
||||
args => [ '-g', 'pixelWidth', '-g', 'pixelHeight' ],
|
||||
format => sub {
|
||||
my $out = shift;
|
||||
return ($out =~ /pixelWidth: (\d+)\s+pixelHeight: (\d+)/s) ? { width => $1, height => $2 } : undef;
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
prog => 'mdls',
|
||||
args => [ '-name', 'kMDItemPixelWidth', '-name', 'kMDItemPixelHeight' ],
|
||||
format => sub {
|
||||
my $out = shift;
|
||||
my %dim;
|
||||
for my $d (qw /Width Height/) {
|
||||
$dim{$d} = $1 if $out =~ /kMDItemPixel$d\s*=\s*(\d+)$/m;
|
||||
}
|
||||
return ($dim{'Width'} and $dim{'Height'}) ? { width => $dim{'Width'}, height => $dim{'Height'} } : undef;
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
prog => 'php',
|
||||
args => [ '-r', q/$a = getimagesize("$argv[1]"); if ($a==FALSE) exit(1); else { echo $a[0] . "x" .$a[1]; exit(0); }/ ],
|
||||
format => sub {
|
||||
my $out = shift;
|
||||
return undef unless $out;
|
||||
my @d = split /x/, $out;
|
||||
return { width => $d[0], height => $d[1] };
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
prog => 'exiftool',
|
||||
args => [ '-s', '-ImageSize' ],
|
||||
format => sub {
|
||||
my $out = shift;
|
||||
return ($out =~ /ImageSize\s+:\s+(\d+)x(\d+)/) ? { width => $1, height => $2 } : undef;
|
||||
}
|
||||
},
|
||||
|
||||
# Use Image::Size last, due to limitations mentioned elsewhere
|
||||
{
|
||||
prog => \&have_Image_Size,
|
||||
format => \&call_Image_Size,
|
||||
name => 'Image::Size',
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
# Look for a dims_methods program to determine image dimensions
|
||||
sub find_dims_methods {
|
||||
my $methods = shift;
|
||||
|
||||
if ($opts{'method'}) {
|
||||
@$methods = grep {
|
||||
(exists $_->{'name'} and (lc($_->{'name'}) eq lc($opts{'method'}))) or
|
||||
($_->{'prog'} eq $opts{'method'}) } @$methods;
|
||||
}
|
||||
|
||||
for (@$methods) {
|
||||
if (ref $_->{'prog'} eq 'CODE' and $_->{'prog'}->()) {
|
||||
return $_;
|
||||
}
|
||||
elsif (my $choice = which($_->{'prog'})) {
|
||||
$_->{'prog'} = $choice;
|
||||
return $_;
|
||||
}
|
||||
}
|
||||
|
||||
say STDERR "$prog: no methods found to obtain image dimensions. Tried: ",
|
||||
map { "\n " . (exists $_->{'name'} ? $_->{'name'} : $_->{'prog'}) } @$methods;
|
||||
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Allow Image::Size to be used if available to calculate an image's size. It
|
||||
# does not support dimensions of PDF files, so it will be tried last.
|
||||
sub have_Image_Size {
|
||||
eval "require Image::Size";
|
||||
return Image::Size->can('imgsize');
|
||||
}
|
||||
|
||||
sub call_Image_Size {
|
||||
my $file = shift;
|
||||
|
||||
my ($w, $h, $type) = Image::Size::imgsize($file);
|
||||
if (defined $w and defined $h) {
|
||||
# Bug: Workaround negative BMP size values, discovered with export to BMP via
|
||||
# SnagIt and Pixelmator (classic).
|
||||
if ($type eq 'BMP') {
|
||||
$w = (2**32) - $w if $w > 2**31;
|
||||
$h = (2**32) - $h if $h > 2**31;
|
||||
}
|
||||
return { width => $w, height => $h };
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
# grab the specified image file's contents
|
||||
sub get_image_bytes {
|
||||
my $file = shift;
|
||||
|
||||
$/ = undef;
|
||||
open (my $fh, "<", $file)
|
||||
or return undef;
|
||||
my $filebytes = <$fh>;
|
||||
chomp $filebytes;
|
||||
close $fh;
|
||||
|
||||
return $filebytes;
|
||||
}
|
||||
|
||||
sub ls_sort {
|
||||
return if ! (@_ or scalar @_ > 1);
|
||||
|
||||
if ($opts{'t'}) {
|
||||
# descending
|
||||
@_ = ($opts{'y'} or $ENV{'LS_SAMESORT'}) ?
|
||||
sort { _lstat($b)->mtime <=> _lstat($a)->mtime || $b cmp $a } @_ :
|
||||
sort { _lstat($b)->mtime <=> _lstat($a)->mtime || $a cmp $b } @_;
|
||||
}
|
||||
# macOS seems to sort lexically with -c/-U, but shows ctime timestamps
|
||||
elsif ($opts{'c'}) {
|
||||
@_ = sort { $a cmp $b } @_;
|
||||
}
|
||||
elsif ($opts{'u'}) {
|
||||
@_ = sort { _lstat($a)->atime <=> _lstat($b)->atime } @_;
|
||||
}
|
||||
elsif ($opts{'S'}) {
|
||||
@_ = sort { _lstat($b)->size <=> _lstat($a)->size || $a cmp $b } @_;
|
||||
}
|
||||
else {
|
||||
@_ = sort @_;
|
||||
}
|
||||
|
||||
return $opts{'r'} ? reverse @_ : @_;
|
||||
}
|
||||
|
||||
sub get_F_type {
|
||||
my $st = shift;
|
||||
|
||||
return '/' if -d $st and ($opts{'p'} or $opts{'F'});
|
||||
return '' unless $opts{'F'};
|
||||
return '@' if -l $st;
|
||||
return '|' if -p $st;
|
||||
return '=' if -S $st;
|
||||
return '*' if -x $st; # must come after other tests
|
||||
return '';
|
||||
}
|
||||
|
||||
sub format_time {
|
||||
my $time = shift;
|
||||
|
||||
my $fmt;
|
||||
if ($opts{'D'}) {
|
||||
$fmt = $opts{'D'};
|
||||
}
|
||||
elsif ($opts{'T'}) {
|
||||
# mmm dd hh:mm:ss yyyy
|
||||
$fmt = '%b %e %T %Y';
|
||||
}
|
||||
else {
|
||||
if ($time + $sixmonths > $curtime and $time < $curtime + $sixmonths) {
|
||||
# mmm dd hh:mm
|
||||
$fmt = '%b %e %R';
|
||||
}
|
||||
else {
|
||||
# mmm dd yyyy
|
||||
$fmt = '%b %e %Y';
|
||||
}
|
||||
}
|
||||
return strftime $fmt, localtime($time);
|
||||
}
|
||||
|
||||
sub format_human {
|
||||
my $bytes = shift;
|
||||
|
||||
my @units = ('B', 'K', 'M', 'G', 'T', 'P');
|
||||
my $scale = floor((length($bytes) - 1) / 3);
|
||||
my $float = $bytes / (1024 ** $scale);
|
||||
|
||||
my ($frac, $int) = modf($float);
|
||||
if (length($bytes) < 3 or length($int) >= 2) {
|
||||
sprintf "%d%s", $frac <.5 ? $float : $float + 1, $units[$scale];
|
||||
}
|
||||
else {
|
||||
sprintf "%.1f%s", $float, $units[$scale];
|
||||
}
|
||||
}
|
||||
|
||||
sub _lstat {
|
||||
my $file = shift;
|
||||
return $stat_cache{$file} if exists $stat_cache{$file};
|
||||
|
||||
if (my $s = lstat($file)) {
|
||||
return $stat_cache{$file} = $s;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
sub which {
|
||||
my ($exec) = @_;
|
||||
|
||||
$exec or
|
||||
return undef;
|
||||
|
||||
if ($exec =~ m#/# && -f $exec && -x _) {
|
||||
return $exec
|
||||
}
|
||||
|
||||
foreach my $file ( map { File::Spec->catfile($_, $exec) } File::Spec->path) {
|
||||
-d $file and
|
||||
next;
|
||||
-x _ and
|
||||
return $file;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
# Generate 1 pixel black PNG as placeholding for non-image-able files.
|
||||
sub get_black_pixel_image {
|
||||
# base 64 encoded single black pixel png
|
||||
my $one_pixel_black = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NgYGD4DwABBAEAwS2OUAAAAABJRU5ErkJggg==';
|
||||
return ($one_pixel_black, length $one_pixel_black);
|
||||
}
|
||||
|
||||
# Based on Stat::lsMode, Copyright 1998 M-J. Dominus, (mjd-perl-lsmode@plover.com)
|
||||
# You may distribute this module under the same terms as Perl itself.
|
||||
|
||||
package Stat::lsMode;
|
||||
|
||||
sub format_mode {
|
||||
my $mode = shift;
|
||||
|
||||
return undef unless defined $mode;
|
||||
|
||||
my @permchars = qw(--- --x -w- -wx r-- r-x rw- rwx);
|
||||
my @ftypechars = qw(. p c ? d ? b ? - ? l ? s ? ? ?);
|
||||
$ftypechars[0] = '';
|
||||
|
||||
my $setids = ($mode & 07000) >> 9;
|
||||
my @permstrs = @permchars[($mode & 0700) >> 6, ($mode & 0070) >> 3, $mode & 0007];
|
||||
my $ftype = $ftypechars[($mode & 0170000) >> 12];
|
||||
|
||||
if ($setids) {
|
||||
if ($setids & 01) { # sticky
|
||||
$permstrs[2] =~ s/([-x])$/$1 eq 'x' ? 't' : 'T'/e;
|
||||
}
|
||||
if ($setids & 04) { # setuid
|
||||
$permstrs[0] =~ s/([-x])$/$1 eq 'x' ? 's' : 'S'/e;
|
||||
}
|
||||
if ($setids & 02) { # setgid
|
||||
$permstrs[1] =~ s/([-x])$/$1 eq 'x' ? 's' : 'S'/e;
|
||||
}
|
||||
}
|
||||
|
||||
join '', $ftype, @permstrs;
|
||||
}
|
||||
|
||||
# vim: expandtab
|
8
.local/share/desktop_icons/bitwarden.desktop
Normal file
8
.local/share/desktop_icons/bitwarden.desktop
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Version=2024.4.0
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Exec=/home/friend/.local/bin/Bitwarden-2024.4.0-x86_64.AppImage
|
||||
Name=bitwarden
|
||||
Comment=Password manager
|
||||
Icon=/home/friend/Pictures/icons/bitwarden.png
|
8
.local/share/desktop_icons/wezterm.desktop
Normal file
8
.local/share/desktop_icons/wezterm.desktop
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Version=20240203-110809-5046fc22
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Exec=/home/linuxbrew/.linuxbrew/bin/wezterm
|
||||
Name=wezterm
|
||||
Comment=wezterm terminal
|
||||
Icon=/home/friend/Pictures/icons/wezterm.svg
|
|
@ -1,366 +0,0 @@
|
|||
# Fastfetch configuration
|
||||
# Write every argument in different lines.
|
||||
# Direct arguments will overwrite the corresponding ones in this file.
|
||||
# Argument keys are not case sensitive.
|
||||
# Whitespaces are trimmed at the beginning and the end.
|
||||
# Empty lines or lines starting with # are ignored.
|
||||
|
||||
# This file was shipped with 1.8.1.
|
||||
# Use fastfetch --print-config-user > ~/.config/fastfetch/config.conf to overwrite this file with the current defaults
|
||||
|
||||
# Below some often usefull options are listed. Uncomment and modify them so they take affect.
|
||||
# Note that there are a lot more options than the ones listed here, take a look at "fastfetch --help".
|
||||
# Of course all of them can be made persistent here too.
|
||||
|
||||
# Config option:
|
||||
# Load additional config files.
|
||||
# Some are shipped with fastfetch, list them with "fastfetch --list-presets".
|
||||
# Must be a path to a config file or the name of a shipped preset.
|
||||
# The config file is completly loaded before continuing in the current file, so the placement of this option matters, as later options overwrite already set ones.
|
||||
# Can be used multiple times to load multiple config files / presets.
|
||||
#--load-config /path/to/config.txt
|
||||
|
||||
# Structure option:
|
||||
# Sets the modules to use and their order.
|
||||
# Must be a list of module names, separated by colons.
|
||||
# List available modules with "fastfetch --list-modules".
|
||||
# Get the default structure with "fastfetch --print-structure".
|
||||
--structure Break:Break:Title:Separator:OS:Uptime:GPU:CPU:Memory:Disk:Break:Colors:Break
|
||||
|
||||
# Multithreading option:
|
||||
# Sets if fastfetch should use multiple threads to detect the values.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
--multithreading true
|
||||
|
||||
# Print stat option:
|
||||
# Sets if fastfetch should print time usage (in ms) for individual modules
|
||||
# If true, it will also enable --show-errors
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--stat true
|
||||
|
||||
# Slow operations option:
|
||||
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--allow-slow-operations false
|
||||
|
||||
# Linewrap option:
|
||||
# Sets if fastfetch should disable linewrap during the run.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--disable-linewrap true
|
||||
|
||||
# Cursor option:
|
||||
# Sets if fastfetch should hide the console cursor during the run.
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--hide-cursor true
|
||||
|
||||
# Logo option:
|
||||
# Sets the logo to use.
|
||||
# List available logos with "fastfetch --list-logos".
|
||||
# Print available logos with "fastfetch --print-logos".
|
||||
# Must be the name of an available logo or a path to a text file containing a custom logo.
|
||||
# Default is the current distribution.
|
||||
--logo spacechalkwhale.jpg
|
||||
|
||||
# Logo type option:
|
||||
# Sets the logo type to use.
|
||||
# Must be auto, builtin, file, file-raw, data, data-raw, sixel, kitty or chafa.
|
||||
# Default is auto.
|
||||
--logo-type sixel
|
||||
|
||||
# Logo width option:
|
||||
# Sets the width of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 65.
|
||||
--logo-width 29
|
||||
|
||||
# Logo height option:
|
||||
# Sets the height of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (keeps aspect ration).
|
||||
--logo-height 13
|
||||
|
||||
# Logo color options:
|
||||
# Overwrite a color in the logo. Also works for user provided logos.
|
||||
# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the one specified by the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
# Valid index range is [1-9].
|
||||
#--logo-color-1 red
|
||||
#--logo-color-2 32
|
||||
# [...]
|
||||
#--logo-color-9 yellow
|
||||
|
||||
# Logo padding option:
|
||||
# Adds a padding to the left and the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
#--logo-padding 0
|
||||
|
||||
# Logo padding left option:
|
||||
# Adds a padding to the left side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
--logo-padding-left 1
|
||||
|
||||
# Logo padding right option:
|
||||
# Adds a padding to the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
#--logo-padding-right 0
|
||||
|
||||
# Logo print remaining option:
|
||||
# Sets if the remaining logo should be printed, it is has more lines than modules to show.
|
||||
# Must be true or false. Default is true.
|
||||
# --logo-print-remaining true
|
||||
|
||||
# Color keys option:
|
||||
# Sets the color of the keys.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the key color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-keys magenta
|
||||
|
||||
# Color title option:
|
||||
# Sets the color of the title.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the title color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-title blue
|
||||
|
||||
# Binary prefix option:
|
||||
# Sets the binary prefix to use.
|
||||
# Must be a IEC, SI or JEDEC.
|
||||
# Default is IEC.
|
||||
#--binary-prefix IEC
|
||||
|
||||
# Title FQDN option:
|
||||
# Sets if the title should use the fully qualified domain name.
|
||||
# Must be true or false.
|
||||
# Default is false.
|
||||
#--title-fqdn false
|
||||
|
||||
# Separator option:
|
||||
# Sets the string placed between a key and its value.
|
||||
# Can be any string.
|
||||
# Default is ": ".
|
||||
#--separator ": "
|
||||
|
||||
# Separator string option:
|
||||
# Sets the string printed by the "separator" module (usually between title and rest of output)
|
||||
# Must be any string. It is repated / cut to fit perfectly.
|
||||
# Default is "-"
|
||||
#--separator-string -
|
||||
|
||||
# Public IP URL option:
|
||||
# Sets the URL of public IP detection server to be used.
|
||||
# Only HTTP protocol is supported, and the value should not contain "http://" prefix.
|
||||
# Default is "ipinfo.io/ip".
|
||||
#--public-ip-url "ipinfo.io/ip"
|
||||
|
||||
# Public IP timeout option:
|
||||
# Sets the time to wait for the public ip server to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--public-ip-timeout 0
|
||||
|
||||
# Weather output format option:
|
||||
# Sets the weather format to be used. It must be URI encoded.
|
||||
# See: https://github.com/chubin/wttr.in#one-line-output
|
||||
# Default is "%t+-+%C+(%l)".
|
||||
#--weather-output-format "%t+-+%C+(%l)"
|
||||
|
||||
# Weather timeout option:
|
||||
# Sets the time to wait for the weather server (wttr.in) to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--weather-timeout 0
|
||||
|
||||
# OS file option
|
||||
# Sets the path to the file containing the operating system information.
|
||||
# Should be a valid path to an existing file.
|
||||
# Default is /etc/os-release.
|
||||
#--os-file /etc/os-release
|
||||
|
||||
# Player name option
|
||||
# Sets the name of the player. This is also used in song detection
|
||||
# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify)
|
||||
# Default is the first match starting with org.mpris.MediaPlayer2.
|
||||
#--player-name spotify
|
||||
|
||||
# Escape bedrock option
|
||||
# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--escape-bedrock true
|
||||
|
||||
# GL option
|
||||
# Sets with opengl context creation library to use
|
||||
# Must be either auto, egl, glx or osmesa
|
||||
# Default is auto.
|
||||
#--gl auto
|
||||
|
||||
# Percentage output type option
|
||||
# Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported.
|
||||
# Only works with default format ( without --module-format option ).
|
||||
# 0: prints none; 1: prints percent number only; 2: prints bar only; 3: prints both percent number and bar
|
||||
#--percent-type 1
|
||||
|
||||
# Key options:
|
||||
# Sets the displayed key of a module
|
||||
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.
|
||||
#--os-key OS
|
||||
#--host-key Host
|
||||
#--chassis-key Chassis
|
||||
#--kernel-key Kernel
|
||||
#--uptime-key Uptime
|
||||
#--processes-key Processes
|
||||
#--packages-key Packages
|
||||
#--shell-key Shell
|
||||
#--resolution-key Resolution {1}
|
||||
#--de-key DE
|
||||
#--wm-key WM
|
||||
#--wm-theme-key WM Theme
|
||||
#--theme-key Theme
|
||||
#--icons-key Icons
|
||||
#--font-key Font
|
||||
#--cursor-key Cursor
|
||||
#--terminal-key Terminal
|
||||
#--terminal-font-key Terminal Font
|
||||
#--cpu-key CPU
|
||||
#--cpu-usage-key CPU Usage
|
||||
#--gpu-key GPU {1}
|
||||
#--memory-key Memory
|
||||
#--swap-key Swap
|
||||
#--disk-key Disk ({1})
|
||||
#--battery-key Battery {1}
|
||||
#--poweradapter-key Power Adapter {1}
|
||||
#--locale-key Locale
|
||||
#--local-ip-key Local IP ({1})
|
||||
#--public-ip-key Public IP
|
||||
#--wifi-key Wifi
|
||||
#--weather-key Weather
|
||||
#--player-key Media Player
|
||||
#--media-key Media
|
||||
#--datetime-key Date Time
|
||||
#--vulkan-key Vulkan
|
||||
#--opengl-key OpenGL
|
||||
#--opencl-key OpenCL
|
||||
#--users-key Users
|
||||
|
||||
# Format options:
|
||||
# Sets the format string for module values.
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format".
|
||||
# An empty format string (As they are currently below) will behave as if it was not set.
|
||||
#--os-format
|
||||
#--host-format
|
||||
#--chassis-format
|
||||
#--kernel-format
|
||||
#--uptime-format
|
||||
#--processes-format
|
||||
#--packages-format
|
||||
#--shell-format
|
||||
#--resolution-format
|
||||
#--de-format
|
||||
#--wm-format
|
||||
#--wm-theme-format
|
||||
#--theme-format
|
||||
#--icons-format
|
||||
#--font-format
|
||||
#--cursor-format
|
||||
#--terminal-format
|
||||
#--terminal-font-format
|
||||
#--cpu-format
|
||||
#--cpu-usage-format
|
||||
#--gpu-format
|
||||
#--memory-format
|
||||
#--swap-format
|
||||
#--disk-format
|
||||
#--battery-format
|
||||
#--poweradapter-format
|
||||
#--locale-format
|
||||
#--local-ip-format
|
||||
#--public-ip-format
|
||||
#--weather-format
|
||||
#--player-format
|
||||
#--media-format
|
||||
#--datetime-format
|
||||
#--vulkan-format
|
||||
#--opengl-format
|
||||
#--opencl-format
|
||||
#--users-format
|
||||
|
||||
# Error options:
|
||||
# Sets the format string to use if an error occured
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# Each of them take the error as first and only argument.
|
||||
# If one of them is set, the module will appear, even if --show-errors is not given.
|
||||
#--os-error
|
||||
#--host-error
|
||||
#--chassis-error
|
||||
#--kernel-error
|
||||
#--uptime-error
|
||||
#--processes-error
|
||||
#--packages-error
|
||||
#--shell-error
|
||||
#--resolution-error
|
||||
#--de-error
|
||||
#--wm-error
|
||||
#--wm-theme-error
|
||||
#--theme-error
|
||||
#--icons-error
|
||||
#--font-error
|
||||
#--cursor-error
|
||||
#--terminal-error
|
||||
#--terminal-font-error
|
||||
#--cpu-error
|
||||
#--cpu-usage-error
|
||||
#--gpu-error
|
||||
#--memory-error
|
||||
#--swap-error
|
||||
#--disk-error
|
||||
#--battery-error
|
||||
#--poweradapter-error
|
||||
#--locale-error
|
||||
#--local-ip-error
|
||||
#--public-ip-error
|
||||
#--weather-error
|
||||
#--player-error
|
||||
#--media-error
|
||||
#--datetime-error
|
||||
#--vulkan-error
|
||||
#--opengl-error
|
||||
#--opencl-error
|
||||
#--users-error
|
||||
|
||||
# Library options:
|
||||
# Sets an user specific path to a library to load.
|
||||
# Must be a valid path to a library.
|
||||
#--lib-PCI /usr/lib/libpci.so
|
||||
#--lib-vulkan /usr/lib/libvulkan.so (libMoltenVK.dylib on macOS)
|
||||
#--lib-wayland /usr/lib/libwayland-client.so
|
||||
#--lib-xcb-randr /usr/lib/libxcb-randr.so
|
||||
#--lib-xcb /usr/lib/libxcb.so
|
||||
#--lib-Xrandr /usr/lib/libXrandr.so
|
||||
#--lib-X11 /usr/lib/libX11.so
|
||||
#--lib-gio /usr/lib/libgio-2.0.so
|
||||
#--lib-DConf /usr/lib/libdconf.so
|
||||
#--lib-DBus /usr/lib/libdbus-1.so
|
||||
#--lib-XFConf /usr/lib/libxfconf-0.so
|
||||
#--lib-sqlite3 /usr/lib/libsqlite3.so
|
||||
#--lib-rpm /usr/lib/librpm.so
|
||||
#--lib-imagemagick /usr/lib/libMagickCore-7.Q16HDRI.so
|
||||
#--lib-z /usr/lib/libz.so
|
||||
#--lib-chafa /usr/lib/libchafa.so
|
||||
#--lib-egl /usr/lib/libEGL.so
|
||||
#--lib-glx /usr/lib/libGLX.so
|
||||
#--lib-osmesa /usr/lib/libOSMesa.so
|
||||
#--lib-opencl /usr/lib/libOpenCL.so
|
||||
#--lib-cjson /usr/lib/libcjson.so
|
||||
#--lib-freetype /data/data/com.termux/files/usr/lib<69>
|
40
.local/share/fastfetch/presets/docker_space_chalk.jsonc
Normal file
40
.local/share/fastfetch/presets/docker_space_chalk.jsonc
Normal file
|
@ -0,0 +1,40 @@
|
|||
// ~/.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": 29,
|
||||
"height": 13,
|
||||
"type": "sixel",
|
||||
"source": "spacechalkwhale.jpg",
|
||||
"padding": {"top": 2,
|
||||
"left": 1}
|
||||
},
|
||||
"display": {
|
||||
"percentType": 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"
|
||||
]
|
||||
}
|
|
@ -1,303 +0,0 @@
|
|||
# Fastfetch configuration
|
||||
#
|
||||
# every argument must be on a seperate line.
|
||||
# Direct arguments will overwrite the corresponding ones in this file.
|
||||
# Whitespaces are trimmed at the beginning and the end.
|
||||
#
|
||||
# This file was shipped was tested with fastfetch 1.8.1.
|
||||
|
||||
# Structure option:
|
||||
# Sets the modules to use and their order.
|
||||
# Must be a list of module names, separated by colons.
|
||||
# List available modules with "fastfetch --list-modules".
|
||||
# Get the default structure with "fastfetch --print-structure".
|
||||
--structure Title:Separator:OS:Kernel:Uptime:GPU:CPU:Memory:Disk:Break:Colors:Break
|
||||
|
||||
# Multithreading option:
|
||||
# Sets if fastfetch should use multiple threads to detect the values.
|
||||
# Must be true or false. Default is true.
|
||||
#--multithreading true
|
||||
|
||||
# Print stat option:
|
||||
# Sets if fastfetch should print time usage (in ms) for individual modules
|
||||
# If true, it will also enable --show-errors
|
||||
# Must be true or false. Default is false.
|
||||
#--stat true
|
||||
|
||||
# Slow operations option:
|
||||
# Sets if fastfetch is allowed to use known slow operations to detect more / better values.
|
||||
# Must be true or false. Default is false.
|
||||
#--allow-slow-operations false
|
||||
|
||||
# Linewrap option:
|
||||
# Sets if fastfetch should disable linewrap during the run.
|
||||
# Must be true or false. Default is true.
|
||||
#--disable-linewrap true
|
||||
|
||||
# Logo option:
|
||||
# Sets the logo to use.
|
||||
# List available logos with "fastfetch --list-logos".
|
||||
# Print available logos with "fastfetch --print-logos".
|
||||
# Must be the name of an available logo or a path to a text file containing a custom logo.
|
||||
# Default is the current distribution.
|
||||
--logo logos/tux.gif
|
||||
|
||||
# Logo type option:
|
||||
# Sets the logo type to use. Must be auto:
|
||||
# builtin, file, file-raw, data, data-raw, sixel, kitty, chafa, iterm
|
||||
# Default is auto.
|
||||
# THIS IS SET TO SIXEL UNTIL ITERM IS FIXED
|
||||
--logo-type iterm
|
||||
|
||||
# Logo width option:
|
||||
# Sets the width of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 65.
|
||||
--logo-width 23
|
||||
|
||||
# Logo height option:
|
||||
# Sets the height of the logo (in characters) if the logo is an image.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (keeps aspect ration).
|
||||
--logo-height 11
|
||||
|
||||
# Logo color options:
|
||||
# Overwrite a color in the logo. Also works for user provided logos.
|
||||
# In the user logo, they replace $[1-9]. Use $$ to print a single $ sign.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the one specified by the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
# Valid index range is [1-9].
|
||||
#--logo-color-1 red
|
||||
#--logo-color-2 32
|
||||
# [...]
|
||||
#--logo-color-9 yellow
|
||||
|
||||
# Logo padding option:
|
||||
# Adds a padding to the left and the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
#--logo-padding 0
|
||||
|
||||
# Logo padding left option:
|
||||
# Adds a padding to the left side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
--logo-padding-left 2
|
||||
|
||||
# Logo padding right option:
|
||||
# Adds a padding to the right side of the logo.
|
||||
# Must be a positive integer.
|
||||
# Default is 0.
|
||||
--logo-padding-right 1
|
||||
|
||||
# Logo print remaining option:
|
||||
# Sets if the remaining logo should be printed, it is has more lines than modules to show.
|
||||
# Must be true or false. Default is true.
|
||||
#--logo-print-remaining true
|
||||
|
||||
# Color keys option:
|
||||
# Sets the color of the keys.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the key color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-keys yellow
|
||||
|
||||
# Color title option:
|
||||
# Sets the color of the title.
|
||||
# Must be linux console color codes or the name of a color.
|
||||
# Default is the title color of the logo.
|
||||
# Use "fastfetch --help color" to learn more and see examples.
|
||||
--color-title yellow
|
||||
|
||||
# Separator option:
|
||||
# Sets the string placed between a key and its value.
|
||||
# Can be any string. Default is ": ".
|
||||
#--separator ": "
|
||||
|
||||
# Separator string option:
|
||||
# Sets the string printed by the "separator" module (usually between title and rest of output)
|
||||
# Must be any string. It is repated / cut to fit perfectly. Default is "-"
|
||||
#--separator-string -
|
||||
|
||||
# Public IP URL option:
|
||||
# Sets the URL of public IP detection server to be used.
|
||||
# Only HTTP protocol is supported, and the value should not contain "http://" prefix.
|
||||
# Default is "ipinfo.io/ip".
|
||||
#--public-ip-url "ipinfo.io/ip"
|
||||
|
||||
# Public IP timeout option:
|
||||
# Sets the time to wait for the public ip server to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--public-ip-timeout 0
|
||||
|
||||
# Weather output format option:
|
||||
# Sets the weather format to be used. It must be URI encoded.
|
||||
# See: https://github.com/chubin/wttr.in#one-line-output
|
||||
# Default is "%t+-+%C+(%l)".
|
||||
#--weather-output-format "%t+-+%C+(%l)"
|
||||
|
||||
# Weather timeout option:
|
||||
# Sets the time to wait for the weather server (wttr.in) to respond.
|
||||
# Must be a positive integer.
|
||||
# Default is 0 (disabled).
|
||||
#--weather-timeout 0
|
||||
|
||||
# OS file option
|
||||
# Sets the path to the file containing the operating system information.
|
||||
# Should be a valid path to an existing file.
|
||||
# Default is /etc/os-release.
|
||||
#--os-file /etc/os-release
|
||||
|
||||
# Player name option
|
||||
# Sets the name of the player. This is also used in song detection
|
||||
# Must be the exact name of the player or a dbus address (e.g. org.mpris.MediaPlayer2.spotify)
|
||||
# Default is the first match starting with org.mpris.MediaPlayer2.
|
||||
#--player-name spotify
|
||||
|
||||
# Escape bedrock option
|
||||
# Sets if fastfetch should escape the bedrock jail, if it detectes that it is running in one
|
||||
# Must be true or false.
|
||||
# Default is true.
|
||||
#--escape-bedrock true
|
||||
|
||||
# GL option
|
||||
# Sets with opengl context creation library to use
|
||||
# Must be either auto, egl, glx or osmesa
|
||||
# Default is auto.
|
||||
#--gl auto
|
||||
|
||||
# Percentage output type option
|
||||
# Applies to all modules that prints percentage values. Currently memory, swap, disk, battery and CPU usage are supported.
|
||||
# Only works with default format ( without --module-format option ).
|
||||
# 0: prints none; 1: prints percent number only; 2: prints bar only; 3: prints both percent number and bar
|
||||
#--percent-type 1
|
||||
|
||||
# Key options:
|
||||
# Sets the displayed key of a module
|
||||
# Can be any string. Some of theme take an argument like a format string. See "fastfetch --help format" for help.
|
||||
#--os-key OS
|
||||
#--host-key Host
|
||||
#--chassis-key Chassis
|
||||
#--kernel-key Kernel
|
||||
#--uptime-key Uptime
|
||||
#--processes-key Processes
|
||||
#--packages-key Packages
|
||||
#--shell-key Shell
|
||||
#--resolution-key Resolution {1}
|
||||
#--de-key DE
|
||||
#--wm-key WM
|
||||
#--wm-theme-key WM Theme
|
||||
#--theme-key Theme
|
||||
#--icons-key Icons
|
||||
#--font-key Font
|
||||
#--cursor-key Cursor
|
||||
#--terminal-key Terminal
|
||||
#--terminal-font-key Terminal Font
|
||||
#--cpu-key CPU
|
||||
#--cpu-usage-key CPU Usage
|
||||
#--gpu-key GPU {1}
|
||||
#--memory-key Memory
|
||||
#--swap-key Swap
|
||||
#--disk-key Disk ({1})
|
||||
#--battery-key Battery {1}
|
||||
#--poweradapter-key Power Adapter {1}
|
||||
#--locale-key Locale
|
||||
#--local-ip-key Local IP ({1})
|
||||
#--public-ip-key Public IP
|
||||
#--wifi-key Wifi
|
||||
#--weather-key Weather
|
||||
#--player-key Media Player
|
||||
#--media-key Media
|
||||
#--datetime-key Date Time
|
||||
#--vulkan-key Vulkan
|
||||
#--opengl-key OpenGL
|
||||
#--opencl-key OpenCL
|
||||
#--users-key Users
|
||||
|
||||
# Format options:
|
||||
# Sets the format string for module values.
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# To see the parameter they take and their default value, see "fastfetch --help *-format", e.g. "fastfetch --help os-format".
|
||||
# An empty format string (As they are currently below) will behave as if it was not set.
|
||||
#--os-format
|
||||
#--host-format
|
||||
#--chassis-format
|
||||
#--kernel-format
|
||||
#--uptime-format
|
||||
#--processes-format
|
||||
#--packages-format
|
||||
#--shell-format
|
||||
#--resolution-format
|
||||
#--de-format
|
||||
#--wm-format
|
||||
#--wm-theme-format
|
||||
#--theme-format
|
||||
#--icons-format
|
||||
#--font-format
|
||||
#--cursor-format
|
||||
#--terminal-format
|
||||
#--terminal-font-format
|
||||
#--cpu-format
|
||||
#--cpu-usage-format
|
||||
#--gpu-format
|
||||
#--memory-format
|
||||
#--swap-format
|
||||
#--disk-format
|
||||
#--battery-format
|
||||
#--poweradapter-format
|
||||
#--locale-format
|
||||
#--local-ip-format
|
||||
#--public-ip-format
|
||||
#--weather-format
|
||||
#--player-format
|
||||
#--media-format
|
||||
#--datetime-format
|
||||
#--vulkan-format
|
||||
#--opengl-format
|
||||
#--opencl-format
|
||||
#--users-format
|
||||
|
||||
# Error options:
|
||||
# Sets the format string to use if an error occured
|
||||
# For information on format strings, see "fastfetch --help format".
|
||||
# Each of them take the error as first and only argument.
|
||||
# If one of them is set, the module will appear, even if --show-errors is not given.
|
||||
#--os-error
|
||||
#--host-error
|
||||
#--chassis-error
|
||||
#--kernel-error
|
||||
#--uptime-error
|
||||
#--processes-error
|
||||
#--packages-error
|
||||
#--shell-error
|
||||
#--resolution-error
|
||||
#--de-error
|
||||
#--wm-error
|
||||
#--wm-theme-error
|
||||
#--theme-error
|
||||
#--icons-error
|
||||
#--font-error
|
||||
#--cursor-error
|
||||
#--terminal-error
|
||||
#--terminal-font-error
|
||||
#--cpu-error
|
||||
#--cpu-usage-error
|
||||
#--gpu-error
|
||||
#--memory-error
|
||||
#--swap-error
|
||||
#--disk-error
|
||||
#--battery-error
|
||||
#--poweradapter-error
|
||||
#--locale-error
|
||||
#--local-ip-error
|
||||
#--public-ip-error
|
||||
#--weather-error
|
||||
#--player-error
|
||||
#--media-error
|
||||
#--datetime-error
|
||||
#--vulkan-error
|
||||
#--opengl-error
|
||||
#--opencl-error
|
||||
#--users-error
|
42
.local/share/fastfetch/presets/tux_all_day.jsonc
Normal file
42
.local/share/fastfetch/presets/tux_all_day.jsonc
Normal file
|
@ -0,0 +1,42 @@
|
|||
// ~/.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": 23,
|
||||
"height": 11,
|
||||
"type": "iterm",
|
||||
"source": "tux.gif",
|
||||
"padding": {
|
||||
"top": 2,
|
||||
"left": 1,
|
||||
"right": 0
|
||||
}
|
||||
},
|
||||
"display": {
|
||||
"percentType": 9, // colored percent number
|
||||
"color": {
|
||||
"keys": "magenta",
|
||||
"title": "bright_blue"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"break",
|
||||
"title",
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"uptime",
|
||||
"packages",
|
||||
"theme",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"memory",
|
||||
"disk",
|
||||
"battery",
|
||||
"break",
|
||||
"colors",
|
||||
"break"
|
||||
]
|
||||
}
|
1
.zshrc
1
.zshrc
|
@ -55,6 +55,7 @@ alias raw="env cat"
|
|||
alias cat="bat"
|
||||
alias gs="git status"
|
||||
|
||||
# not sure what this does...
|
||||
if which lesspipe 1>/dev/null 2>&1; then
|
||||
eval "`lesspipe`"
|
||||
fi
|
||||
|
|
58
README.md
58
README.md
|
@ -1,6 +1,6 @@
|
|||
# Dot Files for `onboardme`
|
||||
|
||||
These are the sensible defaults for [`onboardme`](https://github.com/jessebot/onboardme), but also the personal dot files of @cloudymax and @jessebot. The directories/files are installed to your home directory and follow the [XDG Base Directory Spec] as closely as possible.
|
||||
These are the chosen defaults for [`onboardme`](https://github.com/jessebot/onboardme), but also the personal dot files of [@cloudymax](https://github.com/cloudymax) and [@jessebot](https://github.com/jessebot). The directories/files are installed to your home directory and follow the [XDG Base Directory Spec] as closely as possible. We update these pretty regularly.
|
||||
|
||||
### Sections for each config directory/file
|
||||
|
||||
|
@ -74,7 +74,7 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
a config file to organize all our BASH aliases
|
||||
|
||||
#### [`~/.config/bash/completion.sh`](.config/bash/completion.sh)
|
||||
enable tab completion
|
||||
enable tab completion for all common commands that support it.
|
||||
|
||||
#### [`~/.config/bash/history.sh`](.config/bash/history.sh)
|
||||
- sets history to be in `~/.local/state/bash/history`
|
||||
|
@ -87,7 +87,11 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
#### [`~/.config/bash/k8s.sh`](.config/bash/k8s.sh)
|
||||
kubernetes defaults:
|
||||
- set pathing for [`krew`][krew], a plugin manager for [`kubectl`][kubectl].
|
||||
- helpful sensible aliases such as: `kg` for `kubectl get`
|
||||
- helpful aliases and functions such as:
|
||||
- `k` is aliased to `kubecolor` (`kubectl` with colors)
|
||||
- `kg` for `kubecolor get`
|
||||
- `kgsdump` and `kgs` to dump the contents of a given secret in plain text (supports tab completion)
|
||||
- `kgall` to get pods, PVCs, secrets, and configmaps in one go
|
||||
|
||||
#### [`~/.config/bash/path.sh`](.config/bash/path.sh)
|
||||
- set [XDG Base Directory Spec]
|
||||
|
@ -103,6 +107,15 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><code>cron</code></summary>
|
||||
|
||||
<blockquote>
|
||||
local cron jobs for alarms, package manager updates, and ide package updates
|
||||
</blockquote>
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><code>fastfetch</code></summary>
|
||||
|
||||
|
@ -305,9 +318,10 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
- uses the [spacechalk.nvim] colorscheme
|
||||
- sources all the files in [`~/.config/nvim/lua`](.config/nvim/lua),
|
||||
including all our [plugin configs](.config/nvim/lua/user/lazy.lua).
|
||||
- adds a nice little terminal called [toggleterm.nvim] in [`toggleterm.lua`](.config/nvim/lua/user/toggleterm.lua)
|
||||
|
||||
|
||||
### [`~/.config/nvim/lua/plugins.lua`](.config/nvim/lua/plugins.lua)
|
||||
### [`~/.config/nvim/lua/user/lazy.lua`](.config/nvim/lua/user/lazy.lua)
|
||||
This is the configuration for [`lazy.nvim`], our plugin manager for neovim. It
|
||||
installs lazy, and then all of our plugins.
|
||||
|
||||
|
@ -552,15 +566,6 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
</details>
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><code>.cron</code></summary>
|
||||
|
||||
<blockquote>
|
||||
local cron jobs for alarms, and package manager updates
|
||||
</blockquote>
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><code>.local</code></summary>
|
||||
|
||||
|
@ -645,7 +650,8 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
- turns off bells
|
||||
- enables 256 colors
|
||||
- sources all the files in `~/.config/bash` (see above under config > bash )
|
||||
- sources personal file in `~/.config/bash/personal/bashrc`
|
||||
- sources personal file in `~/.config/bash/personal/bashrc` (this files is never checked in and is where you put sensitive host specific bash configs)
|
||||
- starts powerline daemon, which is used for our fancy status line for BASH
|
||||
- runs [fastfetch] when you source it
|
||||
|
||||
</blockquote>
|
||||
|
@ -690,7 +696,9 @@ These are the sensible defaults for [`onboardme`](https://github.com/jessebot/on
|
|||
|
||||
|
||||
Please feel free to fork this repo and make it your own.
|
||||
You can still use `onboardme`, but you'll want to pass in _your_ git URL and branch. Example:
|
||||
You can still use `onboardme`, but you'll want to pass in _your_ git URL and branch.
|
||||
|
||||
Example via the CLI:
|
||||
|
||||
```bash
|
||||
# this uses your personal git URL and makes sure to always pull from main
|
||||
|
@ -698,6 +706,25 @@ You can still use `onboardme`, but you'll want to pass in _your_ git URL and bra
|
|||
onboardme --git_url https://github.com/your_username/dot_files --git_branch main
|
||||
```
|
||||
|
||||
Example via the config file, `~/.config/onboardme/config.yaml`:
|
||||
|
||||
```yaml
|
||||
# this uses your personal git URL and makes sure to always pull from main
|
||||
dot_files:
|
||||
# your personal git repo URL for your dot files
|
||||
# defaults to https://github.com/jessebot/dot_files.git if not set
|
||||
git_url: "https://github.com/your_username/dot_files.git"
|
||||
# the branch to use for the git repo above, defaults to main
|
||||
git_branch: "main"
|
||||
# !!CAREFUL: runs a `git reset --hard`, which will overwrite/delete dot files in
|
||||
# $HOME that conflict with the above defined git repo url and branch.
|
||||
# Unless you know for sure you want to overwrite everytime you run onboardme, you
|
||||
# should run the following to get the files that would be overwritten before setting this:
|
||||
# onboardme -s dot_files
|
||||
# if set to true, then using onboardme -O will toggle it back to false
|
||||
overwrite: false
|
||||
```
|
||||
|
||||
### FAQ
|
||||
|
||||
<details>
|
||||
|
@ -768,5 +795,6 @@ onboardme --git_url https://github.com/your_username/dot_files --git_branch main
|
|||
[neovim]: https://neovim.io/ "neovim, vim based text editor"
|
||||
[nvim-tree]: https://github.com/nvim-tree/ "nvim-tree"
|
||||
[telescope]: https://github.com/nvim-telescope/telescope.nvim "telescope.nvim"
|
||||
[toggleterm]: https://github.com/akinsho/toggleterm.nvim "toggleterm.nvim"
|
||||
[tree-sitter]: https://github.com/nvim-treesitter/nvim-treesitter "nvim-treesitter"
|
||||
[vim]: https://www.vim.org/ "vim, a text editor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue