Compare commits
199 Commits
9b153e7628
...
claude-nvi
| Author | SHA1 | Date | |
|---|---|---|---|
| 74973c1449 | |||
| 545a5927e5 | |||
| c6b2743cf6 | |||
| 430bec1708 | |||
| d9e25eec77 | |||
| a588604d91 | |||
| d9911dd2ce | |||
| b397fab3f2 | |||
| 1246f42638 | |||
| 06fb7dd4b8 | |||
| 4b2d24e1f4 | |||
| f57d227203 | |||
| 82f904c9dc | |||
| 26b5f00643 | |||
| 31f604f8f6 | |||
| 8632e7a1bc | |||
| 0a9405ffd6 | |||
| eceaab3caf | |||
| 1dbb9c1e5d | |||
| b3e1e4e939 | |||
| 14e1f01784 | |||
| e1e300bee2 | |||
| 1418407e63 | |||
| 1e3a5d291f | |||
| a8100cf3e2 | |||
| 6c738b78e7 | |||
| 0233c339aa | |||
| 57706b7292 | |||
| 7ce3609579 | |||
| 51d0399f21 | |||
| d232d8fad6 | |||
| 413c6a4a63 | |||
| af20454965 | |||
| ae17c411d4 | |||
| f8bac5414b | |||
| b8b7f6bce7 | |||
| eb0b192b5e | |||
| f60b26c676 | |||
| 67dcddb55c | |||
| ce732af957 | |||
| 098bbbb5d2 | |||
| 61a5ef7714 | |||
| 1020a0ea2a | |||
| 32e3ee40e1 | |||
| 8295557eb4 | |||
| 1c71b8c9fc | |||
| debd25f8f8 | |||
| 43f1023449 | |||
| 2b035eb415 | |||
| ec595c6f52 | |||
| 2326ac1e78 | |||
| 14abad0b98 | |||
| f5ffa8b9d1 | |||
| 7b9eac546b | |||
| 36cdaac5ad | |||
| 126671ffc7 | |||
| a1263d8bf1 | |||
| 50b2f38f21 | |||
|
|
c335534278 | ||
|
|
88d5657cf8 | ||
| d2a4e35417 | |||
| 7e58bb7bc2 | |||
| 4d6ba61f52 | |||
| 683e6e4d10 | |||
| dbad023043 | |||
| 355cad6574 | |||
| c9f69530d8 | |||
| 0197e99b8f | |||
| 0bad5c492c | |||
| 1cba6c968a | |||
| 8ae482d846 | |||
| 8c3e762a46 | |||
| 43832361ea | |||
| 166d904735 | |||
| 67d0733bbd | |||
| ae55782bf2 | |||
| e10923f74d | |||
| 6b5ac0c370 | |||
| 0652389078 | |||
| 2913e9578e | |||
| b72c1d5e86 | |||
| 1c844adf91 | |||
| fdbe4366e1 | |||
| a9ffcc12ee | |||
| 9765d93f9f | |||
| 42dbe5ade2 | |||
| bab2c35bff | |||
| ce26b1c206 | |||
| 2d26d6ebd8 | |||
| e0a1ec77ed | |||
| 68bf971992 | |||
| 80e74d3283 | |||
| f93eecfcb1 | |||
| 6d5e6add02 | |||
| cdf5127071 | |||
| 1a57e8a424 | |||
| cf27fdedde | |||
| 92226fff95 | |||
| 2e81d28cc8 | |||
| f5e31ff825 | |||
| fdd4c13d34 | |||
| 25dd5fc67b | |||
| c3bfb2e449 | |||
| 283e49281c | |||
| e8c9ea3af0 | |||
| 5f65c9ad92 | |||
| 2793aa4e59 | |||
| 6e93f8cb39 | |||
| c8dbef379e | |||
| bdd959f3df | |||
| 59575b2ff9 | |||
| 27c5ec21a4 | |||
| d81e168cd9 | |||
| 2352981b16 | |||
| a0472eccc6 | |||
| 9475aae43a | |||
| 7bfe1457f8 | |||
| 0578ba56f9 | |||
| 98faf1c356 | |||
| ff5b4e1665 | |||
| b9cab17495 | |||
| 3d00618b68 | |||
| 8ea508585b | |||
| bbaf22e871 | |||
| 829655f4ba | |||
| fcda5c511e | |||
| 8c91d2a47c | |||
| b3ef701db6 | |||
| d428c88a36 | |||
| d5c0e08eb1 | |||
| 11b01dd83f | |||
| a68a903b9e | |||
| d876d02313 | |||
| 29a8484d1e | |||
| 3c385724d0 | |||
| cf18dcdb67 | |||
| 408fb8ee0b | |||
| 63ceb40b45 | |||
| 261223fe5c | |||
| 17792f297b | |||
| 87008639ba | |||
| 512807cacf | |||
| b7c27b53fa | |||
| 61278b8fb3 | |||
| b039acd9c1 | |||
| 8c7d8f9bc5 | |||
| 1c4b3be339 | |||
| e92d5c0da9 | |||
| c267ac6fc7 | |||
| 85165468f5 | |||
| 3fb3b1e521 | |||
| 43f5cc701e | |||
| ffc34d78d7 | |||
| 61ac93b68f | |||
| 411986643a | |||
| 5d88ea6f11 | |||
| fa6c4d786b | |||
| a07473f125 | |||
| 7fd1b35186 | |||
| 38e27e7208 | |||
| f83d453320 | |||
| 4d1b84db3c | |||
| bb76c9fa3a | |||
| 242d0fe094 | |||
| 4567ea177b | |||
| 165c71a2a4 | |||
| f42a896d53 | |||
| c605f61445 | |||
| 783908c5eb | |||
| 966065dd30 | |||
| 01264a395d | |||
| 292a2883be | |||
| 5a50aa540f | |||
| 84e0c7f700 | |||
| a737b50284 | |||
| 608a3bc725 | |||
| a668bb47db | |||
| 15cf8bc566 | |||
| 325d0d1d72 | |||
| 2943f5a371 | |||
| 89c1417915 | |||
| f035c9318b | |||
| 24ce8f39af | |||
| e3d9612e57 | |||
| 05986a30bb | |||
| 05bc2ec59e | |||
| 128ae8ed1e | |||
| f3188f7b4b | |||
| 85d56f97d1 | |||
| afca2cae5d | |||
| d6875c97d9 | |||
| 568e45f59b | |||
| 78fa170e7a | |||
| 5216f7938b | |||
| 9382d57565 | |||
| 0f29dc3054 | |||
| 860b66c71f | |||
| c901a1cea4 | |||
| cac4b7641c |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,3 +4,5 @@ result
|
|||||||
result-*
|
result-*
|
||||||
|
|
||||||
nixos-efi-vars.fd
|
nixos-efi-vars.fd
|
||||||
|
|
||||||
|
home/hosts/work/packages.local.nix
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# nixos
|
# NixOS flake
|
||||||
|
|
||||||
## Set up virtual machine ([`disko`](https://github.com/nix-community/disko/blob/master/docs/interactive-vm.md))
|
## Set up virtual machine ([`disko`](https://github.com/nix-community/disko/blob/master/docs/interactive-vm.md))
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,13 @@ alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo p
|
|||||||
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
||||||
|
|
||||||
# Programs
|
# Programs
|
||||||
|
alias h="history"
|
||||||
alias o="xdg-open"
|
alias o="xdg-open"
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
|
alias vf="fzf --bind 'enter:become(nvim {})'"
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias t=' task'
|
alias k="kubectl"
|
||||||
|
alias t='task'
|
||||||
alias tsh='tasksh'
|
alias tsh='tasksh'
|
||||||
alias z='zathura --fork'
|
alias z='zathura --fork'
|
||||||
alias f='fzf'
|
alias f='fzf'
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
# shellcheck shell=bash
|
|
||||||
# vim: set ft=bash :
|
|
||||||
|
|
||||||
alias jira-me='jira issue list -a$(jira me)'
|
|
||||||
@@ -15,7 +15,6 @@
|
|||||||
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
|
||||||
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
|
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
|
||||||
[ -f "$HOME/.bash_aliases/lang-js" ] && . "$HOME/.bash_aliases/lang-js"
|
[ -f "$HOME/.bash_aliases/lang-js" ] && . "$HOME/.bash_aliases/lang-js"
|
||||||
command -v jira >/dev/null && [ -f "$HOME/.bash_aliases/jira" ] && . "$HOME/.bash_aliases/jira"
|
|
||||||
|
|
||||||
# Completions {{{
|
# Completions {{{
|
||||||
[ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do
|
[ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Scripts
|
# Scripts
|
||||||
|
|
||||||
Mostly tiny helper scripts & experiments, some more useful than others.
|
Mostly tiny helper scripts \& experiments, some more useful than others.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
options="Mouse\nHeadphones"
|
|
||||||
|
|
||||||
selected="$(echo -e "$options" | dmenu -i)"
|
|
||||||
|
|
||||||
case "$selected" in
|
|
||||||
"Mouse") toggle-bt-device E4:19:21:56:C8:70;;
|
|
||||||
"Headphones") toggle-bt-device 38:18:4C:D4:74:42;;
|
|
||||||
esac
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Open pdf by title
|
|
||||||
# Note: does not handle incorrect metadata
|
|
||||||
|
|
||||||
dir=/home/h/doc/books
|
|
||||||
|
|
||||||
ag -g ".pdf$" $dir \
|
|
||||||
| xargs -n1 -d '\n' pdfinfo 2> /dev/null \
|
|
||||||
| grep "Title: " \
|
|
||||||
| awk '{for (i=2; i<NF; i++) printf $i " "; printf $NF; printf "\n"}' \
|
|
||||||
| grep -v "Title:"\
|
|
||||||
| dmenu -i -p "Read:"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
options="Play\nPause\nNext\nPrevious"
|
|
||||||
|
|
||||||
selected=$(echo -e "$options" | dmenu -i)
|
|
||||||
|
|
||||||
case "$selected" in
|
|
||||||
"Play") playerctl --player=ncspot play;;
|
|
||||||
"Pause") playerctl --player=ncspot pause;;
|
|
||||||
"Next") playerctl --player=ncspot next;;
|
|
||||||
"Previous") playerctl --player=ncspot previous;;
|
|
||||||
esac
|
|
||||||
243
dots/.bin/git-cb
243
dots/.bin/git-cb
@@ -1,25 +1,110 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
types=(
|
readonly ALLOWED_MAIN_BRANCHES=("main" "master" "develop")
|
||||||
"feature For new features"
|
readonly BRANCH_TYPES=(
|
||||||
"bugfix For bug fixes"
|
"feat For new features"
|
||||||
"hotfix For urgent fixes"
|
"hotfix For urgent fixes"
|
||||||
|
"fix For fixes"
|
||||||
"release For preparing releases"
|
"release For preparing releases"
|
||||||
"chore For non-code tasks"
|
"chore For non-code tasks"
|
||||||
)
|
)
|
||||||
|
|
||||||
selected=$(printf '%s\n' "${types[@]}" | fzf --prompt="Select branch type: ") || exit 1
|
error() {
|
||||||
type=${selected%% *}
|
echo "Error: $1" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
echo "Fetching Jira tickets..."
|
warn() {
|
||||||
jira_data=$(jira issue list --assignee=hektor.misplon@rightcrowd.com --order-by=priority --plain --no-headers 2>/dev/null)
|
echo "Warning: $1" >&2
|
||||||
|
}
|
||||||
|
|
||||||
if [[ $? -ne 0 || -z "$jira_data" ]]; then
|
check_dependencies() {
|
||||||
echo "Warning: Could not fetch Jira tickets or no tickets found."
|
local missing=()
|
||||||
echo "Proceeding without ticket ID..."
|
for cmd in git fzf; do
|
||||||
ticket_id=""
|
if ! command -v "$cmd" &> /dev/null; then
|
||||||
else
|
missing+=("$cmd")
|
||||||
# Create formatted list for fzf: "TICKET-123 - Issue description"
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||||
|
error "Missing required commands: ${missing[*]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_git_repo() {
|
||||||
|
if ! git rev-parse --git-dir &> /dev/null; then
|
||||||
|
error "Not in a git repository"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_current_branch() {
|
||||||
|
local current_branch
|
||||||
|
current_branch=$(git branch --show-current)
|
||||||
|
|
||||||
|
local is_main_branch=false
|
||||||
|
for branch in "${ALLOWED_MAIN_BRANCHES[@]}"; do
|
||||||
|
if [[ "$current_branch" == "$branch" ]]; then
|
||||||
|
is_main_branch=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$is_main_branch" == false ]]; then
|
||||||
|
warn "Not branching from a main branch (current: $current_branch)"
|
||||||
|
read -rp "Continue anyway? [y/N] " response
|
||||||
|
if [[ ! "$response" =~ ^[Yy]$ ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_user_email() {
|
||||||
|
local email
|
||||||
|
email=$(git config --get user.email 2>/dev/null)
|
||||||
|
|
||||||
|
if [[ -z "$email" ]]; then
|
||||||
|
error "Git user email not configured. Run: git config user.email 'your@email.com'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$email"
|
||||||
|
}
|
||||||
|
|
||||||
|
select_branch_type() {
|
||||||
|
local selected
|
||||||
|
selected=$(printf '%s\n' "${BRANCH_TYPES[@]}" | \
|
||||||
|
fzf --prompt="Select branch type: " \
|
||||||
|
--height=40% \
|
||||||
|
--border \
|
||||||
|
--info=inline) || error "Branch type selection cancelled"
|
||||||
|
|
||||||
|
echo "${selected%% *}"
|
||||||
|
}
|
||||||
|
|
||||||
|
select_jira_ticket() {
|
||||||
|
local email=$1
|
||||||
|
|
||||||
|
if ! command -v jira &> /dev/null; then
|
||||||
|
warn "Jira CLI not found. Proceeding without ticket ID."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Fetching Jira tickets for $email..." >&2
|
||||||
|
local jira_data
|
||||||
|
jira_data=$(jira issue list --assignee="$email" --order-by=priority --plain --no-headers 2>/dev/null) || {
|
||||||
|
warn "Could not fetch Jira tickets. Proceeding without ticket ID."
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -z "$jira_data" ]]; then
|
||||||
|
warn "No Jira tickets found. Proceeding without ticket ID."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$jira_data" >&2
|
||||||
|
echo "" >&2
|
||||||
|
|
||||||
|
local formatted_tickets
|
||||||
formatted_tickets=$(echo "$jira_data" | awk '{
|
formatted_tickets=$(echo "$jira_data" | awk '{
|
||||||
ticket_id = $2
|
ticket_id = $2
|
||||||
$1 = $2 = ""
|
$1 = $2 = ""
|
||||||
@@ -32,59 +117,105 @@ else
|
|||||||
}')
|
}')
|
||||||
|
|
||||||
if [[ -z "$formatted_tickets" ]]; then
|
if [[ -z "$formatted_tickets" ]]; then
|
||||||
echo "No tickets found. Proceeding without ticket ID..."
|
warn "No tickets to display. Proceeding without ticket ID."
|
||||||
ticket_id=""
|
return 0
|
||||||
else
|
|
||||||
# Let user select a ticket or skip
|
|
||||||
echo ""
|
|
||||||
selected_ticket=$(echo -e "SKIP - Create branch without ticket ID\n$formatted_tickets" | \
|
|
||||||
fzf --prompt="Select Jira ticket (or skip): " --height=40%) || exit 1
|
|
||||||
|
|
||||||
if [[ "$selected_ticket" == "SKIP"* ]]; then
|
|
||||||
ticket_id=""
|
|
||||||
else
|
|
||||||
ticket_id=${selected_ticket%% -*}
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
editor="${EDITOR:-vi}"
|
local selected_ticket
|
||||||
tmpfile=$(mktemp)
|
selected_ticket=$(echo -e "SKIP - Create branch without ticket ID\n$formatted_tickets" | \
|
||||||
|
fzf --prompt="Select Jira ticket (or skip): " \
|
||||||
|
--height=40% \
|
||||||
|
--border \
|
||||||
|
--info=inline) || error "Ticket selection cancelled"
|
||||||
|
|
||||||
if [[ -n "$ticket_id" ]]; then
|
if [[ "$selected_ticket" != "SKIP"* ]]; then
|
||||||
cat > "$tmpfile" << EOF
|
echo "${selected_ticket%% -*}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_branch_description() {
|
||||||
|
local ticket_id=$1
|
||||||
|
local editor="${EDITOR:-vi}"
|
||||||
|
local tmpfile
|
||||||
|
tmpfile=$(mktemp)
|
||||||
|
|
||||||
|
trap "rm -f '$tmpfile'" EXIT
|
||||||
|
|
||||||
|
if [[ -n "$ticket_id" ]]; then
|
||||||
|
cat > "$tmpfile" << EOF
|
||||||
# Selected ticket: $ticket_id
|
# Selected ticket: $ticket_id
|
||||||
# Enter your branch description below in kebab case (e.g. \`my-description\`):
|
# Enter your branch description below in kebab-case (e.g., my-description):
|
||||||
# The ticket ID will be automatically included in the branch name.
|
# The ticket ID will be automatically included in the branch name.
|
||||||
|
# Lines starting with # will be ignored.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
cat > "$tmpfile" << 'EOF'
|
cat > "$tmpfile" << 'EOF'
|
||||||
# Enter your branch description below in kebab case (e.g. `my-description`):
|
# Enter your branch description below in kebab-case (e.g., my-description):
|
||||||
|
# Lines starting with # will be ignored.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
"$editor" "$tmpfile" < /dev/tty > /dev/tty
|
||||||
|
|
||||||
"$editor" "$tmpfile"
|
local desc
|
||||||
|
desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
|
||||||
desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
echo "$desc"
|
||||||
rm "$tmpfile"
|
}
|
||||||
|
|
||||||
if [[ -z "$desc" ]]; then
|
validate_description() {
|
||||||
echo "No description provided."
|
local desc=$1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
|
if [[ -z "$desc" ]]; then
|
||||||
echo "Invalid branch description format."
|
error "No description provided"
|
||||||
echo "Use lowercase letters, numbers, and hyphens only."
|
fi
|
||||||
echo "No trailing or consecutive hyphens allowed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "$ticket_id" ]]; then
|
if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
|
||||||
branch="$type/$ticket_id-$desc"
|
error "Invalid branch description format.\nUse lowercase letters, numbers, and hyphens only.\nNo trailing or consecutive hyphens allowed.\nExample: my-feature-description"
|
||||||
else
|
fi
|
||||||
branch="$type/$desc"
|
}
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Creating branch: $branch"
|
create_branch() {
|
||||||
git checkout -b "$branch"
|
local type=$1
|
||||||
|
local ticket_id=$2
|
||||||
|
local desc=$3
|
||||||
|
|
||||||
|
local branch
|
||||||
|
if [[ -n "$ticket_id" ]]; then
|
||||||
|
branch="$type/$ticket_id-$desc"
|
||||||
|
else
|
||||||
|
branch="$type/$desc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if git show-ref --verify --quiet "refs/heads/$branch"; then
|
||||||
|
error "Branch '$branch' already exists"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Creating branch: $branch"
|
||||||
|
git checkout -b "$branch"
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
check_dependencies
|
||||||
|
check_git_repo
|
||||||
|
check_current_branch
|
||||||
|
|
||||||
|
local email
|
||||||
|
email=$(get_user_email)
|
||||||
|
|
||||||
|
local type
|
||||||
|
type=$(select_branch_type)
|
||||||
|
|
||||||
|
echo "About to call select_jira_ticket" >&2
|
||||||
|
local ticket_id=""
|
||||||
|
ticket_id=$(select_jira_ticket "$email")
|
||||||
|
local desc
|
||||||
|
desc=$(get_branch_description "$ticket_id")
|
||||||
|
validate_description "$desc"
|
||||||
|
create_branch "$type" "$ticket_id" "$desc"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|||||||
@@ -8,17 +8,23 @@ Pomodoro timer
|
|||||||
- Notification on break finish
|
- Notification on break finish
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
import atexit
|
import atexit
|
||||||
|
import os
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from plyer import notification
|
from plyer import notification
|
||||||
|
|
||||||
|
POMO_PATH = os.path.join(
|
||||||
|
os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@atexit.register
|
@atexit.register
|
||||||
def clear():
|
def clear():
|
||||||
if os.path.exists('/home/h/.local/share/pomo'):
|
if os.path.exists(POMO_PATH):
|
||||||
os.remove('/home/h/.local/share/pomo')
|
os.remove(POMO_PATH)
|
||||||
|
|
||||||
|
|
||||||
def format_mins_secs(mins, secs):
|
def format_mins_secs(mins, secs):
|
||||||
return f"{mins:02d}:{secs:02d}"
|
return f"{mins:02d}:{secs:02d}"
|
||||||
@@ -30,24 +36,21 @@ def make_countdown():
|
|||||||
mins = duration // 60
|
mins = duration // 60
|
||||||
secs = duration % 60
|
secs = duration % 60
|
||||||
time_str = format_mins_secs(mins, secs)
|
time_str = format_mins_secs(mins, secs)
|
||||||
os.system(f'echo -n "{time_str}" > /home/h/.local/share/pomo')
|
os.system(f'echo -n "{time_str}" > {POMO_PATH}')
|
||||||
sleep(1)
|
sleep(1)
|
||||||
duration -= 1
|
duration -= 1
|
||||||
|
|
||||||
return countdown
|
return countdown
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
prep_duration = args.prep_duration * 60
|
|
||||||
work_duration = args.work_duration * 60
|
work_duration = args.work_duration * 60
|
||||||
break_duration = args.break_duration * 60
|
break_duration = args.break_duration * 60
|
||||||
repeats = args.repeats
|
repeats = args.repeats
|
||||||
|
|
||||||
prep_countdown = make_countdown()
|
|
||||||
work_countdown = make_countdown()
|
work_countdown = make_countdown()
|
||||||
break_countdown = make_countdown()
|
break_countdown = make_countdown()
|
||||||
|
|
||||||
prep_countdown(prep_duration)
|
|
||||||
|
|
||||||
while repeats != 0:
|
while repeats != 0:
|
||||||
notification.notify(title="Get started")
|
notification.notify(title="Get started")
|
||||||
work_countdown(work_duration)
|
work_countdown(work_duration)
|
||||||
@@ -61,21 +64,23 @@ def main(args):
|
|||||||
def handle_signal(signal, frame):
|
def handle_signal(signal, frame):
|
||||||
# Wait for clear to finish
|
# Wait for clear to finish
|
||||||
clear()
|
clear()
|
||||||
print('Exiting')
|
print("Exiting")
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
|
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument('-w', '--work-duration', type=int,
|
parser.add_argument(
|
||||||
help='Session duration', default=25)
|
"-w", "--work-duration", type=int, help="Session duration", default=25
|
||||||
parser.add_argument('-b', '--break-duration', type=int,
|
)
|
||||||
help='Break duration', default=5)
|
parser.add_argument(
|
||||||
parser.add_argument('-r', '--repeats', type=int,
|
"-b", "--break-duration", type=int, help="Break duration", default=5
|
||||||
help='Numer of sessions', default=1)
|
)
|
||||||
parser.add_argument('-c', '--clear', action='store_true',
|
parser.add_argument(
|
||||||
help='Clear timer')
|
"-r", "--repeats", type=int, help="Numer of sessions", default=1
|
||||||
|
)
|
||||||
|
parser.add_argument("-c", "--clear", action="store_true", help="Clear timer")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
session="r5rs"
|
session="r5rs"
|
||||||
|
|
||||||
tmux attach-session -t $session || tmux new-session -s $session \; \
|
tmux attach-session -t "$session" || tmux new-session -s "$session" \; \
|
||||||
split-window -h -t $session \; \
|
split-window -h -t $session \; \
|
||||||
send-keys -t 0 "vim" C-m \; \
|
send-keys -t 1 "nvim -c \"set ft=scheme\"" C-m \; \
|
||||||
send-keys -t 1 "plt-r5rs --no-prim" C-m \; \
|
send-keys -t 2 "plt-r5rs --no-prim" C-m \; \
|
||||||
select-pane -t 0
|
select-pane -t 1
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ restic -r "$RESTIC_REPOSITORY:$HOSTNAME" backup \
|
|||||||
--one-file-system \
|
--one-file-system \
|
||||||
--files-from="$HOME/.resticinclude" \
|
--files-from="$HOME/.resticinclude" \
|
||||||
--exclude-file="$HOME/.resticexclude" \
|
--exclude-file="$HOME/.resticexclude" \
|
||||||
|
--exclude-if-present=".nobackup" \
|
||||||
--verbose=3
|
--verbose=3
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
DEFAULT_TEMPERATURE = 3500
|
DEFAULT_TEMPERATURE = 3500
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open('/tmp/temperature', 'r') as temp_file:
|
with open("/tmp/temperature", "r") as temp_file:
|
||||||
current_temperature = int(temp_file.read())
|
current_temperature = int(temp_file.read())
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
current_temperature = DEFAULT_TEMPERATURE
|
current_temperature = DEFAULT_TEMPERATURE
|
||||||
@@ -16,7 +16,8 @@ if len(sys.argv) == 1:
|
|||||||
print(current_temperature)
|
print(current_temperature)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif len(sys.argv) != 2:
|
elif len(sys.argv) != 2:
|
||||||
print("""
|
print(
|
||||||
|
"""
|
||||||
Usage:
|
Usage:
|
||||||
|
|
||||||
screen-temperature
|
screen-temperature
|
||||||
@@ -27,7 +28,8 @@ Usage:
|
|||||||
|
|
||||||
screen-temperature <+|-><temperature>
|
screen-temperature <+|-><temperature>
|
||||||
increase or decrease screen temperature by <temperature>
|
increase or decrease screen temperature by <temperature>
|
||||||
""")
|
"""
|
||||||
|
)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
temperature_change = sys.argv[1]
|
temperature_change = sys.argv[1]
|
||||||
@@ -41,11 +43,10 @@ else:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
|
subprocess.run(["redshift", "-O", str(new_temperature), "-P"], check=True)
|
||||||
with open('/tmp/temperature', 'w') as temp_file:
|
with open("/tmp/temperature", "w") as temp_file:
|
||||||
temp_file.write(str(new_temperature) + '\n')
|
temp_file.write(str(new_temperature) + "\n")
|
||||||
# Send notification
|
# Send notification
|
||||||
subprocess.run(
|
subprocess.run(["notify-send", str(new_temperature) + "K"])
|
||||||
["notify-send", str(new_temperature) + "K"])
|
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
print("Error: could not set screen temperature.")
|
print("Error: could not set screen temperature.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import argparse
|
|
||||||
import json
|
|
||||||
import subprocess
|
|
||||||
from collections import defaultdict
|
|
||||||
|
|
||||||
|
|
||||||
def get_task_data():
|
|
||||||
command = (
|
|
||||||
"task +PENDING or +WAITING -COMPLETED -DELETED export | "
|
|
||||||
"jq '[.[] | {uuid: .uuid, id, depends: .depends, description: .description, status: .status }]'"
|
|
||||||
)
|
|
||||||
output = subprocess.check_output(command, shell=True)
|
|
||||||
return json.loads(output)
|
|
||||||
|
|
||||||
|
|
||||||
def parse_task_data(data):
|
|
||||||
dependency_graph = defaultdict(list)
|
|
||||||
task_details = {}
|
|
||||||
dependent_tasks = set()
|
|
||||||
|
|
||||||
for task in data:
|
|
||||||
task_id = task["uuid"]
|
|
||||||
task_details[task_id] = {
|
|
||||||
"id": task.get("id", "?"),
|
|
||||||
"description": task.get("description", "No description"),
|
|
||||||
"status": task.get("status", "Unknown status"),
|
|
||||||
}
|
|
||||||
if task["depends"]:
|
|
||||||
for dependency in task["depends"]:
|
|
||||||
dependency_graph[dependency].append(task_id)
|
|
||||||
dependent_tasks.add(task_id)
|
|
||||||
|
|
||||||
root_tasks = set(task_details.keys()) - dependent_tasks
|
|
||||||
return task_details, dependency_graph, root_tasks
|
|
||||||
|
|
||||||
|
|
||||||
def get_all_parents(task_id, dependency_graph):
|
|
||||||
return [
|
|
||||||
parent for parent, children in dependency_graph.items() if task_id in children
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
def build_ascii_dag(
|
|
||||||
task_id,
|
|
||||||
task_details,
|
|
||||||
dependency_graph,
|
|
||||||
prefix="",
|
|
||||||
is_last=True,
|
|
||||||
show_id=True,
|
|
||||||
visited=None,
|
|
||||||
):
|
|
||||||
if visited is None:
|
|
||||||
visited = set()
|
|
||||||
|
|
||||||
if task_id in visited:
|
|
||||||
return [f"{prefix}{'└── ' if is_last else '├── '}... (cycle detected)"]
|
|
||||||
|
|
||||||
visited.add(task_id)
|
|
||||||
|
|
||||||
task_info = task_details[task_id]
|
|
||||||
task_line = f"{prefix}{'└── ' if is_last else '├── '}{task_info['id'] + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
|
|
||||||
lines = [task_line]
|
|
||||||
|
|
||||||
children = dependency_graph.get(task_id, [])
|
|
||||||
for idx, child in enumerate(children):
|
|
||||||
child_is_last = idx == len(children) - 1
|
|
||||||
child_prefix = prefix + (" " if is_last else "│ ")
|
|
||||||
lines.extend(
|
|
||||||
build_ascii_dag(
|
|
||||||
child,
|
|
||||||
task_details,
|
|
||||||
dependency_graph,
|
|
||||||
child_prefix,
|
|
||||||
child_is_last,
|
|
||||||
show_id,
|
|
||||||
visited.copy(),
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return lines
|
|
||||||
|
|
||||||
|
|
||||||
def render_dependency_dag(task_details, dependency_graph, root_tasks, show_id):
|
|
||||||
dag_lines = []
|
|
||||||
global_visited = set()
|
|
||||||
|
|
||||||
def dfs(task_id, prefix="", is_last=True, visited=None):
|
|
||||||
if visited is None:
|
|
||||||
visited = set()
|
|
||||||
|
|
||||||
if task_id in visited:
|
|
||||||
return
|
|
||||||
|
|
||||||
visited.add(task_id)
|
|
||||||
global_visited.add(task_id)
|
|
||||||
|
|
||||||
task_info = task_details[task_id]
|
|
||||||
task_line = f"{prefix}{'└── ' if is_last else '├── '}{str(task_info['id']) + ': ' if show_id else ''}{task_info['description']} ({task_info['status']})"
|
|
||||||
dag_lines.append(task_line)
|
|
||||||
|
|
||||||
children = dependency_graph.get(task_id, [])
|
|
||||||
for idx, child in enumerate(children):
|
|
||||||
child_is_last = idx == len(children) - 1
|
|
||||||
child_prefix = prefix + (" " if is_last else "│ ")
|
|
||||||
dfs(child, child_prefix, child_is_last, visited.copy())
|
|
||||||
|
|
||||||
root_tasks_with_children = [
|
|
||||||
root for root in root_tasks if dependency_graph.get(root, [])
|
|
||||||
]
|
|
||||||
for root in sorted(
|
|
||||||
root_tasks_with_children,
|
|
||||||
key=lambda x: len(dependency_graph.get(x, [])),
|
|
||||||
reverse=True,
|
|
||||||
):
|
|
||||||
if root not in global_visited:
|
|
||||||
dfs(root)
|
|
||||||
dag_lines.append("")
|
|
||||||
|
|
||||||
return "\n".join(dag_lines).rstrip()
|
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
|
||||||
data = get_task_data()
|
|
||||||
task_details, dependency_graph, root_tasks = parse_task_data(data)
|
|
||||||
ascii_dag = render_dependency_dag(
|
|
||||||
task_details, dependency_graph, root_tasks, show_id=args.show_id
|
|
||||||
)
|
|
||||||
print(ascii_dag)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
parser = argparse.ArgumentParser(
|
|
||||||
description="Generates a task dependency DAG for Taskwarrior tasks."
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--show-id",
|
|
||||||
action="store_true",
|
|
||||||
default=False,
|
|
||||||
help="Include task IDs in the output.",
|
|
||||||
)
|
|
||||||
args = parser.parse_args()
|
|
||||||
main(args)
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
current_zettel_path="$ZK_PATH/$(cat "$ZK_PATH/current-zettel.txt")"
|
||||||
|
|
||||||
if [ "$TERM_PROGRAM" = tmux ]; then
|
if [ "$TERM_PROGRAM" = tmux ]; then
|
||||||
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
cd "$ZK_PATH" && $EDITOR "$current_zettel_path"
|
||||||
else
|
else
|
||||||
echo 'Not in tmux'
|
echo 'Not in tmux'
|
||||||
echo 'Choose an option:'
|
echo 'Choose an option:'
|
||||||
@@ -18,12 +20,12 @@ else
|
|||||||
else
|
else
|
||||||
# Create session with a window named 'zk' and start nvim
|
# Create session with a window named 'zk' and start nvim
|
||||||
tmux new-session -s zk -n zk -d
|
tmux new-session -s zk -n zk -d
|
||||||
tmux send-keys -t zk:zk "cd ~/.zk && $EDITOR \"\$(cat ~/.zk/current-zettel.txt)\"" Enter
|
tmux send-keys -t zk:zk "cd $ZK_PATH && $EDITOR $current_zettel_path" Enter
|
||||||
tmux attach -t zk
|
tmux attach -t zk
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
cd ~/.zk && $EDITOR "$(cat ~/.zk/current-zettel.txt)"
|
cd "$ZK_PATH" && $EDITOR "$current_zettel_path"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'Not opening Zettelkasten'
|
echo 'Not opening Zettelkasten'
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
for i in ~/.mozilla/firefox/*.*default*
|
|
||||||
do ln -s "$XDG_CONFIG_HOME"/firefox/user.js "$i/user.js"
|
|
||||||
done
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
/*
|
|
||||||
* Note: has to be symlinked to profile directories for your
|
|
||||||
* firefox release
|
|
||||||
*
|
|
||||||
* E.g.
|
|
||||||
*
|
|
||||||
* ```sh
|
|
||||||
* ln -s user.js ~/.mozilla/firefox/*.default-release/user.js
|
|
||||||
* ```
|
|
||||||
* Or check out the `setup` script
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Set default download directory
|
|
||||||
user_pref("browser.download.dir", "/home/h/dl");
|
|
||||||
48
dots/.config/home-manager/flake.lock
generated
48
dots/.config/home-manager/flake.lock
generated
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"home-manager": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1756991914,
|
|
||||||
"narHash": "sha256-4ve/3ah5H/SpL2m3qmZ9GU+VinQYp2MN1G7GamimTds=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "b08f8737776f10920c330657bee8b95834b7a70f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1756787288,
|
|
||||||
"narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"home-manager": "home-manager",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
nixgl.url = "github:nix-community/nixGL";
|
|
||||||
};
|
|
||||||
outputs = { nixpkgs, home-manager, nixgl, ... }:
|
|
||||||
let
|
|
||||||
lib = nixpkgs.lib;
|
|
||||||
system = "x86_64-linux";
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = [ nixgl.overlay ];
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
homeConfigurations = {
|
|
||||||
work = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit nixgl;
|
|
||||||
};
|
|
||||||
modules = [ ./hosts/work ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{ pkgs, config, nixgl, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nixGL = {
|
|
||||||
packages = nixgl.packages;
|
|
||||||
defaultWrapper = "mesa";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.username = "hektor";
|
|
||||||
home.homeDirectory = "/home/hektor";
|
|
||||||
home.stateVersion = "25.05";
|
|
||||||
|
|
||||||
home.packages = import ./packages.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit config;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{ pkgs, config, ... }:
|
|
||||||
|
|
||||||
with pkgs; [ ]
|
|
||||||
@@ -1,27 +1,167 @@
|
|||||||
# Fonts
|
#: Fonts {{{
|
||||||
|
|
||||||
font_family Iosevka Term SS08
|
font_family Iosevka Term SS08
|
||||||
font_size 24.0
|
bold_font auto
|
||||||
|
italic_font auto
|
||||||
|
bold_italic_font auto
|
||||||
|
font_size 12.0
|
||||||
|
disable_ligatures never
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
#: Cursor {{{
|
||||||
|
|
||||||
# Cursor
|
|
||||||
cursor_shape block
|
cursor_shape block
|
||||||
cursor_blink_interval 0
|
cursor_blink_interval 0
|
||||||
shell_integration no-cursor
|
|
||||||
|
|
||||||
# Performance tuning
|
#: }}}
|
||||||
|
|
||||||
|
#: Scrollback {{{
|
||||||
|
|
||||||
|
scrollback_lines 8192
|
||||||
|
scrollbar scrolled
|
||||||
|
scrollback_pager_history_size 1024
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: Mouse {{{
|
||||||
|
|
||||||
|
mouse_hide_wait 0.0
|
||||||
|
paste_actions quote-urls-at-prompt,confirm
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: Performance tuning {{{
|
||||||
|
|
||||||
repaint_delay 8
|
repaint_delay 8
|
||||||
|
input_delay 2
|
||||||
|
|
||||||
# Transparency
|
#: }}}
|
||||||
|
|
||||||
# dynamic_background_opacity yes
|
#: Terminal bell {{{
|
||||||
# background_opacity 0.0
|
|
||||||
|
|
||||||
enable_audio_bell no
|
enable_audio_bell yes
|
||||||
|
window_alert_on_bell yes
|
||||||
|
|
||||||
# Scrollback
|
#: }}}
|
||||||
|
|
||||||
scrollback_lines 16384
|
#: Window layout {{{
|
||||||
scrollback_pager nvimpager
|
|
||||||
|
|
||||||
include ./themes/zenwritten_light.conf
|
remember_window_size no
|
||||||
|
remember_window_position no
|
||||||
|
enabled_layouts *
|
||||||
|
hide_window_decorations yes
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: Tab bar {{{
|
||||||
|
|
||||||
|
tab_bar_edge top
|
||||||
|
tab_bar_style powerline
|
||||||
|
tab_bar_min_tabs 1
|
||||||
|
tab_powerline_style slanted
|
||||||
|
tab_activity_symbol !
|
||||||
|
tab_title_template "{index}{fmt.fg.red}{bell_symbol}{fmt.fg.tab}{activity_symbol}:{tab.last_focused_progress_percent}{title}"
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: Advanced {{{
|
||||||
|
|
||||||
|
notify_on_cmd_finish unfocused
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: OS specific tweaks {{{
|
||||||
|
|
||||||
|
linux_display_server auto
|
||||||
|
wayland_enable_ime no
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
#: Keyboard shortcuts {{{
|
||||||
|
|
||||||
|
kitty_mod ctrl+shift
|
||||||
|
map kitty_mod+c copy_to_clipboard
|
||||||
|
map kitty_mod+v paste_from_clipboard
|
||||||
|
map cmd+v
|
||||||
|
# map kitty_mod+o pass_selection_to_program
|
||||||
|
# map kitty_mod+o pass_selection_to_program firefox
|
||||||
|
# map kitty_mod+y new_window less @selection
|
||||||
|
map kitty_mod+z scroll_to_prompt -1
|
||||||
|
map kitty_mod+x scroll_to_prompt 1
|
||||||
|
map kitty_mod+h show_scrollback
|
||||||
|
# map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting --type=overlay less +G -R
|
||||||
|
#:: For more details on piping screen and buffer contents to external
|
||||||
|
#:: programs, see launch <https://sw.kovidgoyal.net/kitty/launch/>.
|
||||||
|
# map kitty_mod+g show_last_command_output
|
||||||
|
# map kitty_mod+enter launch --cwd=current
|
||||||
|
# map cmd+enter
|
||||||
|
# map ctrl+n launch --location=neighbor
|
||||||
|
# map ctrl+f launch --location=first
|
||||||
|
map kitty_mod+n
|
||||||
|
map cmd+n
|
||||||
|
map kitty_mod+w
|
||||||
|
map shift+cmd+d
|
||||||
|
map kitty_mod+]
|
||||||
|
map kitty_mod+[
|
||||||
|
map kitty_mod+f
|
||||||
|
map kitty_mod+b
|
||||||
|
map kitty_mod+`
|
||||||
|
map kitty_mod+r
|
||||||
|
map cmd+r
|
||||||
|
map kitty_mod+1
|
||||||
|
map cmd+1
|
||||||
|
map kitty_mod+2
|
||||||
|
map cmd+2
|
||||||
|
map kitty_mod+3
|
||||||
|
map cmd+3
|
||||||
|
map kitty_mod+4
|
||||||
|
map cmd+4
|
||||||
|
map kitty_mod+5
|
||||||
|
map cmd+5
|
||||||
|
map kitty_mod+6
|
||||||
|
map cmd+6
|
||||||
|
map kitty_mod+7
|
||||||
|
map cmd+7
|
||||||
|
map kitty_mod+8
|
||||||
|
map cmd+8
|
||||||
|
map kitty_mod+9
|
||||||
|
map cmd+9
|
||||||
|
map kitty_mod+0
|
||||||
|
map f1 goto_tab 1
|
||||||
|
map f2 goto_tab 2
|
||||||
|
map f3 goto_tab 3
|
||||||
|
map f4 goto_tab 4
|
||||||
|
map f5 goto_tab 5
|
||||||
|
map f6 goto_tab 6
|
||||||
|
map f7 goto_tab 7
|
||||||
|
map f8 goto_tab 8
|
||||||
|
# map kitty_mod+c new_tab # FIXME: conflict with 'copy'
|
||||||
|
map cmd+t
|
||||||
|
map kitty_mod+q
|
||||||
|
map cmd+w
|
||||||
|
map kitty_mod+.
|
||||||
|
map kitty_mod+,
|
||||||
|
map kitty_mod+alt+t
|
||||||
|
map shift+cmd+i
|
||||||
|
map kitty_mod+f1
|
||||||
|
map kitty_mod+f11
|
||||||
|
map ctrl+cmd+f
|
||||||
|
map kitty_mod+f10
|
||||||
|
map opt+cmd+s
|
||||||
|
map kitty_mod+u kitten unicode_input
|
||||||
|
map ctrl+cmd+space
|
||||||
|
map kitty_mod+/ kitty_shell window
|
||||||
|
map kitty_mod+f5
|
||||||
|
map kitty_mod+r load_config_file
|
||||||
|
|
||||||
|
map shift+cmd+/
|
||||||
|
map cmd+h
|
||||||
|
map opt+cmd+
|
||||||
|
map cmd+m
|
||||||
|
map cmd+q
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
include ./themes/zenwritten_dark.conf
|
||||||
|
include ./nvim.conf
|
||||||
|
|||||||
8
dots/.config/kitty/nvim.conf
Normal file
8
dots/.config/kitty/nvim.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
allow_remote_control socket-only
|
||||||
|
listen_on unix:/tmp/kitty
|
||||||
|
shell_integration enabled
|
||||||
|
|
||||||
|
action_alias kitty_scrollback_nvim kitten ~/.local/share/nvim/site/pack/paqs/start/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py
|
||||||
|
map kitty_mod+h kitty_scrollback_nvim
|
||||||
|
map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
|
||||||
|
mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
function GetClozeNumber()
|
function GetClozeNumber()
|
||||||
let REGEX_CLOZE_START = '{{c\d\+::'
|
let REGEX_CLOZE_START = '{{c\d\+::'
|
||||||
|
|
||||||
@@ -33,3 +34,4 @@ let g:sandwich#recipes += [
|
|||||||
\ 'nesting': 1
|
\ 'nesting': 1
|
||||||
\ }
|
\ }
|
||||||
\ ]
|
\ ]
|
||||||
|
]])
|
||||||
@@ -1 +1,3 @@
|
|||||||
require('auto-session').setup({})
|
require("auto-session").setup({
|
||||||
|
auto_session_enabled = vim.env.KITTY_SCROLLBACK_NVIM ~= "true", -- See kitty-scrollback.nvim
|
||||||
|
})
|
||||||
|
|||||||
1
dots/.config/nvim/after/plugin/claude-code.nvim.lua
Normal file
1
dots/.config/nvim/after/plugin/claude-code.nvim.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("claude-code").setup()
|
||||||
@@ -1,16 +1,16 @@
|
|||||||
require("codecompanion").setup({
|
-- require("codecompanion").setup({
|
||||||
extensions = {
|
-- extensions = {
|
||||||
mcphub = {
|
-- mcphub = {
|
||||||
callback = "mcphub.extensions.codecompanion",
|
-- callback = "mcphub.extensions.codecompanion",
|
||||||
opts = {
|
-- opts = {
|
||||||
make_vars = true,
|
-- make_vars = true,
|
||||||
make_slash_commands = true,
|
-- make_slash_commands = true,
|
||||||
show_result_in_chat = true
|
-- show_result_in_chat = true
|
||||||
}
|
-- }
|
||||||
}
|
-- }
|
||||||
},
|
-- },
|
||||||
strategies = {
|
-- strategies = {
|
||||||
chat = { adapter = "openai" },
|
-- chat = { adapter = "openai" },
|
||||||
inline = { adapter = "openai" },
|
-- inline = { adapter = "openai" },
|
||||||
},
|
-- },
|
||||||
})
|
-- })
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
require("conform").setup({
|
require("conform").setup({
|
||||||
format_on_save = {
|
format_after_save = {
|
||||||
lsp_fallback = true,
|
lsp_fallback = true,
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 500,
|
timeout_ms = 500,
|
||||||
@@ -15,14 +15,15 @@ require("conform").setup({
|
|||||||
html = { "prettierd", "prettier", stop_after_first = true },
|
html = { "prettierd", "prettier", stop_after_first = true },
|
||||||
lua = { "stylua" }, -- configured in stylua.toml
|
lua = { "stylua" }, -- configured in stylua.toml
|
||||||
markdown = { "prettierd", "prettier", stop_after_first = true },
|
markdown = { "prettierd", "prettier", stop_after_first = true },
|
||||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
nix = { "nixfmt" },
|
||||||
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
|
javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||||
json = { "prettierd", "prettier", stop_after_first = true },
|
javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||||
jsonc = { "prettierd", "prettier", stop_after_first = true },
|
-- json = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
-- jsonc = { "prettierd", "prettier", stop_after_first = true },
|
||||||
python = { "isort", "black" },
|
python = { "isort", "black" },
|
||||||
svelte = { "prettierd", "prettier", stop_after_first = true },
|
svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
|
||||||
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
|
typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
|
||||||
yaml = { "prettierd", "prettier", stop_after_first = true },
|
-- yaml = { "prettierd", "prettier", stop_after_first = true },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
1
dots/.config/nvim/after/plugin/fidget.nvim.lua
Normal file
1
dots/.config/nvim/after/plugin/fidget.nvim.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("fidget").setup()
|
||||||
78
dots/.config/nvim/after/plugin/formatter.nvim.lua
Normal file
78
dots/.config/nvim/after/plugin/formatter.nvim.lua
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
-- require("formatter").setup({
|
||||||
|
-- logging = true,
|
||||||
|
-- filetype = {
|
||||||
|
-- typescriptreact = {
|
||||||
|
-- -- prettier
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "prettier",
|
||||||
|
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- typescript = {
|
||||||
|
-- -- prettier
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "prettier",
|
||||||
|
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- -- linter
|
||||||
|
-- -- function()
|
||||||
|
-- -- return {
|
||||||
|
-- -- exe = "eslint",
|
||||||
|
-- -- args = {
|
||||||
|
-- -- "--stdin-filename",
|
||||||
|
-- -- vim.api.nvim_buf_get_name(0),
|
||||||
|
-- -- "--fix",
|
||||||
|
-- -- "--cache"
|
||||||
|
-- -- },
|
||||||
|
-- -- stdin = false
|
||||||
|
-- -- }
|
||||||
|
-- -- end
|
||||||
|
-- },
|
||||||
|
-- javascript = {
|
||||||
|
-- -- prettier
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "prettier",
|
||||||
|
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- javascriptreact = {
|
||||||
|
-- -- prettier
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "prettier",
|
||||||
|
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- json = {
|
||||||
|
-- -- prettier
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "prettier",
|
||||||
|
-- args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- lua = {
|
||||||
|
-- -- luafmt
|
||||||
|
-- function()
|
||||||
|
-- return {
|
||||||
|
-- exe = "luafmt",
|
||||||
|
-- args = { "--indent-count", 2, "--stdin" },
|
||||||
|
-- stdin = true,
|
||||||
|
-- }
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
@@ -5,7 +5,9 @@ fzf.setup({ "max-perf" })
|
|||||||
vim.keymap.set("n", "<leader>f<leader>", fzf.builtin) -- Help
|
vim.keymap.set("n", "<leader>f<leader>", fzf.builtin) -- Help
|
||||||
vim.keymap.set("n", "<leader>fc", fzf.commands)
|
vim.keymap.set("n", "<leader>fc", fzf.commands)
|
||||||
vim.keymap.set("n", "<leader>ff", fzf.files)
|
vim.keymap.set("n", "<leader>ff", fzf.files)
|
||||||
vim.keymap.set("n", "<leader>fg", fzf.live_grep_native)
|
vim.keymap.set("n", "<leader>fg", function()
|
||||||
|
fzf.live_grep_native({ resume = true })
|
||||||
|
end)
|
||||||
vim.keymap.set("n", "<leader>fb", fzf.buffers)
|
vim.keymap.set("n", "<leader>fb", fzf.buffers)
|
||||||
vim.keymap.set("n", "<leader>fd", fzf.diagnostics_workspace)
|
vim.keymap.set("n", "<leader>fd", fzf.diagnostics_workspace)
|
||||||
vim.keymap.set("n", "<leader>fhe", fzf.help_tags)
|
vim.keymap.set("n", "<leader>fhe", fzf.help_tags)
|
||||||
@@ -13,4 +15,4 @@ vim.keymap.set("n", "<leader>fhi", fzf.search_history)
|
|||||||
vim.keymap.set("n", "<leader>fma", fzf.marks)
|
vim.keymap.set("n", "<leader>fma", fzf.marks)
|
||||||
vim.keymap.set("n", "<leader>fma", fzf.man_pages)
|
vim.keymap.set("n", "<leader>fma", fzf.man_pages)
|
||||||
|
|
||||||
vim.keymap.set("i", "<c-f>", fzf.complete_path)
|
vim.keymap.set("i", "<c-f>", fzf.complete_file)
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
local gitsigns = require("gitsigns")
|
local gitsigns = require("gitsigns")
|
||||||
|
|
||||||
gitsigns.setup({
|
gitsigns.setup({
|
||||||
current_line_blame_opts = { delay = 0 },
|
|
||||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
current_line_blame_formatter = "<author>, <author_time:%R> - <summary>",
|
||||||
|
linehl = true,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
delay = 0,
|
||||||
|
virt_text_pos = "right_align",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Blame", gitsigns.toggle_current_line_blame, { nargs = "?" })
|
vim.api.nvim_create_user_command("Blame", gitsigns.toggle_current_line_blame, { nargs = "?" })
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
require("image").setup({
|
-- require("image").setup({
|
||||||
backend = "kitty",
|
-- backend = "kitty",
|
||||||
kitty_method = "normal",
|
-- kitty_method = "normal",
|
||||||
processor = "magick_cli",
|
-- processor = "magick_cli",
|
||||||
integrations = {
|
-- integrations = {
|
||||||
markdown = {
|
-- markdown = {
|
||||||
filetypes = { "markdown", "pandoc" },
|
-- filetypes = { "markdown", "pandoc" },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
})
|
-- })
|
||||||
|
|||||||
1
dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
1
dots/.config/nvim/after/plugin/kitty-scrollback.nvim.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("kitty-scrollback").setup()
|
||||||
1
dots/.config/nvim/after/plugin/kubectl.nvim.lua
Normal file
1
dots/.config/nvim/after/plugin/kubectl.nvim.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require("kubectl").setup()
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
require("neodev").setup() -- should setup before lspconfig
|
require("neodev").setup() -- should setup before lspconfig
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
-- vim.g.coq_settings = { auto_start = 'shut-up' }
|
-- vim.g.coq_settings = { auto_start = 'shut-up' }
|
||||||
-- local capabilities = coq.lsp_ensure_capabilities()
|
-- local capabilities = coq.lsp_ensure_capabilities()
|
||||||
|
|
||||||
@@ -19,11 +17,9 @@ local servers = {
|
|||||||
format = false,
|
format = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emmet_language_server = {},
|
-- emmet_language_server = {},
|
||||||
gdscript = {},
|
gdscript = {},
|
||||||
helm_ls = {
|
helm_ls = { filetypes = { "helm", "yaml.helm-values" } },
|
||||||
filetypes = { "yaml", "helm", "yaml.helm-values" },
|
|
||||||
},
|
|
||||||
hls = { filetypes = { "haskell", "lhaskell", "cabal" } },
|
hls = { filetypes = { "haskell", "lhaskell", "cabal" } },
|
||||||
html = {},
|
html = {},
|
||||||
jsonls = {
|
jsonls = {
|
||||||
@@ -34,9 +30,59 @@ local servers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lua_ls = {},
|
lua_ls = {
|
||||||
|
on_init = function(client)
|
||||||
|
if client.workspace_folders then
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
if
|
||||||
|
path ~= vim.fn.stdpath("config")
|
||||||
|
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc"))
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
path = {
|
||||||
|
"lua/?.lua",
|
||||||
|
"lua/?/init.lua",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
vim.env.VIMRUNTIME,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
Lua = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
-- marksman = {},
|
-- marksman = {},
|
||||||
|
-- TODO: This completion ain't working yet
|
||||||
|
nixd = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
command = { "nixfmt" },
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
home_manager = {
|
||||||
|
expr = '(builtins.getFlake "/home/hektor/.config/home-manager").homeConfigurations.work.options',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
pyright = {},
|
pyright = {},
|
||||||
|
rust_analyzer = {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
-- tsserver = {},
|
-- tsserver = {},
|
||||||
svelte = {
|
svelte = {
|
||||||
plugin = {
|
plugin = {
|
||||||
@@ -46,48 +92,43 @@ local servers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
tailwindcss = {},
|
tailwindcss = {},
|
||||||
-- vtsls = {},
|
terraformls = {},
|
||||||
ts_ls = {},
|
-- ts_ls = {},
|
||||||
-- vtsls = {
|
vtsls = {
|
||||||
-- maxTsServerMemory = 16384,
|
maxTsServerMemory = 16384,
|
||||||
-- filetypes = {
|
filetypes = {
|
||||||
-- "javascript",
|
"javascript",
|
||||||
-- "javascriptreact",
|
"javascriptreact",
|
||||||
-- "javascript.jsx",
|
"javascript.jsx",
|
||||||
-- "typescript",
|
"typescript",
|
||||||
-- "typescriptreact",
|
"typescriptreact",
|
||||||
-- "typescript.tsx",
|
"typescript.tsx",
|
||||||
-- },
|
},
|
||||||
-- settings = {
|
settings = {
|
||||||
-- complete_function_calls = true,
|
complete_function_calls = true,
|
||||||
-- vtsls = {
|
vtsls = {
|
||||||
-- enableMoveToFileCodeAction = true,
|
enableMoveToFileCodeAction = true,
|
||||||
-- autoUseWorkspaceTsdk = true,
|
autoUseWorkspaceTsdk = true,
|
||||||
-- experimental = {
|
experimental = { completion = { enableServerSideFuzzyMatch = true } },
|
||||||
-- completion = {
|
},
|
||||||
-- enableServerSideFuzzyMatch = true,
|
typescript = {
|
||||||
-- },
|
updateImportsOnFileMove = { enabled = "always" },
|
||||||
-- },
|
suggest = { completeFunctionCalls = true },
|
||||||
-- },
|
inlayHints = {
|
||||||
-- typescript = {
|
enumMemberValues = { enabled = true },
|
||||||
-- updateImportsOnFileMove = { enabled = "always" },
|
functionLikeReturnTypes = { enabled = true },
|
||||||
-- suggest = {
|
parameterNames = { enabled = "literals" },
|
||||||
-- completeFunctionCalls = true,
|
parameterTypes = { enabled = true },
|
||||||
-- },
|
propertyDeclarationTypes = { enabled = true },
|
||||||
-- inlayHints = {
|
variableTypes = { enabled = false },
|
||||||
-- enumMemberValues = { enabled = true },
|
},
|
||||||
-- functionLikeReturnTypes = { enabled = true },
|
},
|
||||||
-- parameterNames = { enabled = "literals" },
|
},
|
||||||
-- parameterTypes = { enabled = true },
|
},
|
||||||
-- propertyDeclarationTypes = { enabled = true },
|
|
||||||
-- variableTypes = { enabled = false },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
yamlls = {
|
yamlls = {
|
||||||
settings = {
|
settings = {
|
||||||
yaml = {
|
yaml = {
|
||||||
|
validate = true,
|
||||||
schemaStore = {
|
schemaStore = {
|
||||||
-- You must disable built-in schemaStore support if you want to use
|
-- You must disable built-in schemaStore support if you want to use
|
||||||
-- this plugin and its advanced options like `ignore`.
|
-- this plugin and its advanced options like `ignore`.
|
||||||
@@ -103,9 +144,11 @@ local servers = {
|
|||||||
|
|
||||||
for server, config in pairs(servers) do
|
for server, config in pairs(servers) do
|
||||||
config.capabilities = capabilities
|
config.capabilities = capabilities
|
||||||
lspconfig[server].setup(config)
|
vim.lsp.config(server, config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.lsp.enable(vim.tbl_keys(servers))
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
callback = function(e)
|
callback = function(e)
|
||||||
local opts = { buffer = e.bufnr }
|
local opts = { buffer = e.bufnr }
|
||||||
|
|||||||
9
dots/.config/nvim/after/plugin/m_taskwarrior_d.nvim.lua
Normal file
9
dots/.config/nvim/after/plugin/m_taskwarrior_d.nvim.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require("m_taskwarrior_d").setup()
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("TWTask", { clear = true }),
|
||||||
|
pattern = "*.md",
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("TWSyncTasks")
|
||||||
|
end,
|
||||||
|
})
|
||||||
@@ -1 +1 @@
|
|||||||
require("mcphub").setup({})
|
-- require("mcphub").setup({})
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Paste clipboard images
|
" Paste clipboard images
|
||||||
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
||||||
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
|
||||||
|
]])
|
||||||
@@ -62,11 +62,12 @@ cmp.setup({
|
|||||||
["<CR>"] = c_l,
|
["<CR>"] = c_l,
|
||||||
}),
|
}),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "copilot", group_index = 2 },
|
{ name = "zk" },
|
||||||
|
{ name = "copilot", group_index = 2 },
|
||||||
{ name = "nvim_lsp", keyword_length = 8 },
|
{ name = "nvim_lsp", keyword_length = 8 },
|
||||||
{ name = "luasnip", max_item_count = 16 },
|
{ name = "luasnip", max_item_count = 16 },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "buffer", max_item_count = 8 },
|
{ name = "buffer", max_item_count = 8 },
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered({ border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" } }),
|
completion = cmp.config.window.bordered({ border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" } }),
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
vim.env.ESLINT_D_PPID = vim.fn.getpid()
|
||||||
|
|
||||||
local eslint_linter = "eslint_d"
|
local eslint_linter = "eslint_d"
|
||||||
|
|
||||||
require("lint").linters_by_ft = {
|
require("lint").linters_by_ft = {
|
||||||
@@ -10,8 +12,8 @@ require("lint").linters_by_ft = {
|
|||||||
editorconfig = { "editorconfig-checker" },
|
editorconfig = { "editorconfig-checker" },
|
||||||
haskell = { "hlint" },
|
haskell = { "hlint" },
|
||||||
-- html = { "htmlhint" },
|
-- html = { "htmlhint" },
|
||||||
-- javascript = { eslint_linter },
|
javascript = { eslint_linter },
|
||||||
-- javascriptreact = { eslint_linter },
|
javascriptreact = { eslint_linter },
|
||||||
gdscript = { "gdlint" },
|
gdscript = { "gdlint" },
|
||||||
latex = { "chktex" },
|
latex = { "chktex" },
|
||||||
-- lua = { "luacheck", "selene" },
|
-- lua = { "luacheck", "selene" },
|
||||||
@@ -20,10 +22,9 @@ require("lint").linters_by_ft = {
|
|||||||
-- python = { "pylint" },
|
-- python = { "pylint" },
|
||||||
sh = { "shellcheck" },
|
sh = { "shellcheck" },
|
||||||
svelte = { eslint_linter },
|
svelte = { eslint_linter },
|
||||||
systemd = { "systemdlint" },
|
typescript = { eslint_linter },
|
||||||
-- typescript = { eslint_linter },
|
typescriptreact = { eslint_linter },
|
||||||
-- typescriptreact = { eslint_linter },
|
-- yaml = { "yamllint" },
|
||||||
yaml = { "yamllint" },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- TODO: Wouldn't it be possible / nice to only try to load the linters when they are
|
-- TODO: Wouldn't it be possible / nice to only try to load the linters when they are
|
||||||
|
|||||||
9
dots/.config/nvim/after/plugin/obsidian-nvim.lua
Normal file
9
dots/.config/nvim/after/plugin/obsidian-nvim.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require("obsidian").setup({
|
||||||
|
legacy_commands = false,
|
||||||
|
workspaces = {
|
||||||
|
{
|
||||||
|
name = "test",
|
||||||
|
path = "~/zk/work",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
vim.cmd([[
|
||||||
nmap s <Nop>
|
nmap s <Nop>
|
||||||
xmap s <Nop>
|
xmap s <Nop>
|
||||||
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
|
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
|
||||||
|
]])
|
||||||
@@ -4,10 +4,13 @@ local keymap = vim.keymap
|
|||||||
local opt = vim.opt
|
local opt = vim.opt
|
||||||
local treesitter_configs = require("nvim-treesitter.configs")
|
local treesitter_configs = require("nvim-treesitter.configs")
|
||||||
|
|
||||||
|
local nixCatsUtils = require("nixCatsUtils")
|
||||||
|
local is_nix = nixCatsUtils.isNixCats
|
||||||
|
|
||||||
treesitter_configs.setup({
|
treesitter_configs.setup({
|
||||||
-- Basically added what I might need from the docs
|
-- Basically added what I might need from the docs
|
||||||
-- <https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#supported-languages>
|
-- <https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#supported-languages>
|
||||||
ensure_installed = {
|
ensure_installed = is_nix and {} or {
|
||||||
"awk",
|
"awk",
|
||||||
"bash",
|
"bash",
|
||||||
"bibtex",
|
"bibtex",
|
||||||
@@ -86,7 +89,7 @@ treesitter_configs.setup({
|
|||||||
enable = true,
|
enable = true,
|
||||||
},
|
},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
auto_install = true,
|
auto_install = not is_nix,
|
||||||
ignore_install = {},
|
ignore_install = {},
|
||||||
modules = {},
|
modules = {},
|
||||||
textobjects = {
|
textobjects = {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
vim.cmd([[
|
||||||
let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
|
let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
|
||||||
let g:javascript_plugin_flow = 1 " flow syntax highlighting
|
let g:javascript_plugin_flow = 1 " flow syntax highlighting
|
||||||
let g:javascript_conceal_function = "ƒ"
|
let g:javascript_conceal_function = "ƒ"
|
||||||
let g:javascript_conceal_return = "⇖"
|
let g:javascript_conceal_return = "⇖"
|
||||||
let g:svelte_indent_script = 0
|
let g:svelte_indent_script = 0
|
||||||
let g:svelte_indent_style = 0
|
let g:svelte_indent_style = 0
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
let g:pandoc#syntax#conceal#urls=1
|
let g:pandoc#syntax#conceal#urls=1
|
||||||
let g:pandoc#syntax#codeblocks#embeds#langs=[
|
let g:pandoc#syntax#codeblocks#embeds#langs=[
|
||||||
\ 'python',
|
\ 'python',
|
||||||
@@ -13,3 +14,4 @@ let g:pandoc#syntax#codeblocks#embeds#langs=[
|
|||||||
let g:pandoc#syntax#style#emphases=0 " Bug workaround
|
let g:pandoc#syntax#style#emphases=0 " Bug workaround
|
||||||
let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" }
|
let g:pandoc#syntax#conceal#cchar_overrides = { "atx": " ", "li": "·" }
|
||||||
let g:pandoc#syntax#conceal#blacklist=[]
|
let g:pandoc#syntax#conceal#blacklist=[]
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
au FileType pandoc call pandoc#completion#Init()
|
au FileType pandoc call pandoc#completion#Init()
|
||||||
let g:pandoc#filetypes#pandoc_markdown=0
|
let g:pandoc#filetypes#pandoc_markdown=0
|
||||||
let g:pandoc#spell#enabled=0
|
let g:pandoc#spell#enabled=0
|
||||||
@@ -5,3 +6,4 @@ let g:pandoc#spell#default_langs=['en_us', 'nl_be']
|
|||||||
let g:pandoc#formatting#mode='a'
|
let g:pandoc#formatting#mode='a'
|
||||||
let g:pandoc#formatting#textwidth=90
|
let g:pandoc#formatting#textwidth=90
|
||||||
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
|
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Tidalcycles (sclang and vim-tidal)
|
" Tidalcycles (sclang and vim-tidal)
|
||||||
let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.1"}
|
let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.1"}
|
||||||
let g:tidal_no_mappings = 1
|
let g:tidal_no_mappings = 1
|
||||||
@@ -12,3 +13,4 @@ au FileType tidal com! -nargs=0 H :TidalHush
|
|||||||
" SuperCollider
|
" SuperCollider
|
||||||
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
|
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
|
||||||
au Filetype supercollider packadd scvim
|
au Filetype supercollider packadd scvim
|
||||||
|
]])
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
|
vim.cmd([[
|
||||||
let g:vimtex_view_method='zathura'
|
let g:vimtex_view_method='zathura'
|
||||||
let g:tex_flavor='latex'
|
let g:tex_flavor='latex'
|
||||||
let g:tex_conceal='abdmgs'
|
let g:tex_conceal='abdmgs'
|
||||||
let g:vimtex_quickfix_mode=0
|
let g:vimtex_quickfix_mode=0
|
||||||
|
]])
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
" Change local buffer to directory of current file after the plugin has loaded
|
vim.cmd([[
|
||||||
autocmd VimEnter * lcd %:p:h
|
" " Change local buffer to directory of current file after the plugin has loaded
|
||||||
|
" autocmd VimEnter * lcd %:p:h
|
||||||
|
|
||||||
" " Override wiki index mapping to also cd into the wiki
|
" " Override wiki index mapping to also cd into the wiki
|
||||||
nm <leader>ww <plug>(wiki-index)
|
nm <leader>ww <plug>(wiki-index)
|
||||||
@@ -106,3 +107,4 @@ let g:wiki_write_on_nav=1
|
|||||||
let g:wiki_zotero_root='~/.local/share/zotero'
|
let g:wiki_zotero_root='~/.local/share/zotero'
|
||||||
" ... mappings and commands
|
" ... mappings and commands
|
||||||
" ...
|
" ...
|
||||||
|
]])
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
vim.cmd([[
|
||||||
syn match Todo /TODO/
|
syn match Todo /TODO/
|
||||||
syn match Todo /FIXME/
|
syn match Todo /FIXME/
|
||||||
syn match Todo /FIX/
|
syn match Todo /FIX/
|
||||||
syn match Todo /QUESTION/
|
syn match Todo /QUESTION/
|
||||||
syn match Todo /NOTE/
|
syn match Todo /NOTE/
|
||||||
|
]])
|
||||||
19
dots/.config/nvim/after/syntax/pandoc.lua
Normal file
19
dots/.config/nvim/after/syntax/pandoc.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
" Override the pandoc-syntax highlighting colors for more subtle citations
|
||||||
|
hi! link pandocPCite Comment
|
||||||
|
hi! link pandocICite Comment
|
||||||
|
hi! link pandocCiteKey Comment
|
||||||
|
hi! link pandocCiteAnchor Comment
|
||||||
|
hi! link pandocCiteLocator Comment
|
||||||
|
|
||||||
|
" Match cloze delimiters e.g. `{{c1::` and `}}`
|
||||||
|
syn match ClozeDelimiter /{{c\d\+::/ conceal containedin=pandocUListItem,pandocListItem
|
||||||
|
syn match ClozeDelimiter /}}/ conceal containedin=pandocUListItem,pandocListItem
|
||||||
|
" Match text between cloze delimiters
|
||||||
|
syn match Cloze /\({{c\d\+::\)\@<=\(\_[A-Za-z0-9$\ \\\-\*,_`()]*\)\(}}\)\@=/ containedin=pandocUListItem,pandocListItem
|
||||||
|
|
||||||
|
hi! link ClozeDelimiter Special
|
||||||
|
hi! link Cloze Special
|
||||||
|
]])
|
||||||
|
|
||||||
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
vim.cmd([[
|
||||||
syn keyword Operator \+ conceal cchar=¬
|
syn keyword Operator \+ conceal cchar=¬
|
||||||
syn keyword Operator , conceal cchar=∧
|
syn keyword Operator , conceal cchar=∧
|
||||||
syn keyword Operator ; conceal cchar=∨
|
syn keyword Operator ; conceal cchar=∨
|
||||||
|
]])
|
||||||
|
|
||||||
:runtime! syntax/_comment_keywords.vim
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
syntax keyword Statement define conceal cchar=≔
|
syntax keyword Statement define conceal cchar=≔
|
||||||
|
|
||||||
syn keyword Operator not conceal cchar=¬
|
syn keyword Operator not conceal cchar=¬
|
||||||
@@ -35,5 +36,6 @@ syn keyword Operator phi conceal cchar=φ
|
|||||||
syn keyword Operator chi conceal cchar=χ
|
syn keyword Operator chi conceal cchar=χ
|
||||||
syn keyword Operator psi conceal cchar=ψ
|
syn keyword Operator psi conceal cchar=ψ
|
||||||
syn keyword Operator omega conceal cchar=ω
|
syn keyword Operator omega conceal cchar=ω
|
||||||
|
]])
|
||||||
|
|
||||||
:runtime! syntax/_comment_keywords.vim
|
vim.cmd.runtime("syntax/_comment_keywords.lua")
|
||||||
41
dots/.config/nvim/flake.lock
generated
41
dots/.config/nvim/flake.lock
generated
@@ -2,11 +2,11 @@
|
|||||||
"nodes": {
|
"nodes": {
|
||||||
"nixCats": {
|
"nixCats": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759730664,
|
"lastModified": 1765766809,
|
||||||
"narHash": "sha256-boRlBQ/c4CaHsK/z04QL6+t81mcar37Io94HBX2GflY=",
|
"narHash": "sha256-3Xp41+Sb1zIzASa1Uu1k1RMUoJ9CGyYb0GtvvpRPBqg=",
|
||||||
"owner": "BirdeeHub",
|
"owner": "BirdeeHub",
|
||||||
"repo": "nixCats-nvim",
|
"repo": "nixCats-nvim",
|
||||||
"rev": "77dffad8235eb77684fcb7599487c8e9f23d5b8f",
|
"rev": "fe157e3ed69ed14b55ca81f597eac282caed58a2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -17,11 +17,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1760256791,
|
"lastModified": 1765934234,
|
||||||
"narHash": "sha256-uTpzDHRASEDeFUuToWSQ46Re8beXyG9dx4W36FQa0/c=",
|
"narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "832e3b6db48508ae436c2c7bfc0cf914eac6938e",
|
"rev": "af84f9d270d404c17699522fab95bbf928a2d92f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
"plugins-helm-ls-nvim": {
|
"plugins-helm-ls-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1757598429,
|
"lastModified": 1761915179,
|
||||||
"narHash": "sha256-nzuJxAAaEmuVYg9k0B8OKslxsihhg6RKlhz6E7xJTQU=",
|
"narHash": "sha256-W9NRa84l5Cs62OsDeqb+LMxk8oYjhVBCB3o3UmE9a0I=",
|
||||||
"owner": "qvalentin",
|
"owner": "qvalentin",
|
||||||
"repo": "helm-ls.nvim",
|
"repo": "helm-ls.nvim",
|
||||||
"rev": "f36ecbd3e7b0b2ac8358a9d6a3213888e29943db",
|
"rev": "d6f3a8d4ad59b4f54cd734267dfb5411679ea608",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -79,14 +79,30 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugins-m-taskwarrior-d-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1764933759,
|
||||||
|
"narHash": "sha256-4lN/ZQTQ7uMcpjePbf2k913Bs9AYYS6da3iZbckA6oI=",
|
||||||
|
"owner": "huantrinh1802",
|
||||||
|
"repo": "m_taskwarrior_d.nvim",
|
||||||
|
"rev": "279d2c8bcd2779500c1bea71fb9249c97cdb503b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "huantrinh1802",
|
||||||
|
"repo": "m_taskwarrior_d.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugins-mcphub-nvim": {
|
"plugins-mcphub-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1759035242,
|
"lastModified": 1765628564,
|
||||||
"narHash": "sha256-I6EbgY/2sAdtrxtmH0qbAAQvMCHhOsfolJfblV0fXOk=",
|
"narHash": "sha256-nvWqCGRKhbUHsAM/zd+cwFdcoXXxf6EmcCkpN4mElf4=",
|
||||||
"owner": "ravitemer",
|
"owner": "ravitemer",
|
||||||
"repo": "mcphub.nvim",
|
"repo": "mcphub.nvim",
|
||||||
"rev": "8ff40b5edc649959bb7e89d25ae18e055554859a",
|
"rev": "5193329d510a68f1f5bf189960642c925c177a3a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -150,6 +166,7 @@
|
|||||||
"plugins-beancount-nvim": "plugins-beancount-nvim",
|
"plugins-beancount-nvim": "plugins-beancount-nvim",
|
||||||
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
|
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
|
||||||
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
|
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
|
||||||
|
"plugins-m-taskwarrior-d-nvim": "plugins-m-taskwarrior-d-nvim",
|
||||||
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
|
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
|
||||||
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
|
"plugins-nvimkit-nvim": "plugins-nvimkit-nvim",
|
||||||
"plugins-shipwright-nvim": "plugins-shipwright-nvim",
|
"plugins-shipwright-nvim": "plugins-shipwright-nvim",
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
url = "github:rktjmp/shipwright.nvim";
|
url = "github:rktjmp/shipwright.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
plugins-m-taskwarrior-d-nvim = {
|
||||||
|
url = "github:huantrinh1802/m_taskwarrior_d.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
plugins-crazy-node-movement = {
|
plugins-crazy-node-movement = {
|
||||||
url = "github:theHamsta/crazy-node-movement";
|
url = "github:theHamsta/crazy-node-movement";
|
||||||
flake = false;
|
flake = false;
|
||||||
@@ -59,12 +63,49 @@
|
|||||||
{
|
{
|
||||||
lspsAndRuntimeDeps = with pkgs; {
|
lspsAndRuntimeDeps = with pkgs; {
|
||||||
general = [
|
general = [
|
||||||
|
black
|
||||||
|
clang
|
||||||
|
clang-tools
|
||||||
|
gawk
|
||||||
|
gdtoolkit_4
|
||||||
|
isort
|
||||||
|
nixd
|
||||||
|
nixfmt
|
||||||
|
nodePackages.prettier
|
||||||
|
ormolu
|
||||||
|
prettierd
|
||||||
|
rustfmt
|
||||||
|
shellcheck-minimal
|
||||||
|
stylua
|
||||||
tree-sitter
|
tree-sitter
|
||||||
|
vscode-langservers-extracted
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
startupPlugins = {
|
startupPlugins = {
|
||||||
general = with pkgs.vimPlugins; [
|
general = with pkgs.vimPlugins; [
|
||||||
|
## plug
|
||||||
|
vim-plug
|
||||||
|
vim-sandwich
|
||||||
|
context_filetype-vim
|
||||||
|
editorconfig-vim
|
||||||
|
vim-snippets
|
||||||
|
unicode-vim
|
||||||
|
vim-css-color
|
||||||
|
quarto-nvim
|
||||||
|
vimtex
|
||||||
|
wiki-vim
|
||||||
|
vim-pandoc
|
||||||
|
vim-pandoc-syntax
|
||||||
|
# TODO: ferrine/md-img-paste.vim
|
||||||
|
# TODO: supercollider/scvim
|
||||||
|
# TODO: tidalcycles/vim-tidal
|
||||||
|
vim-glsl
|
||||||
|
# TODO: timtro/glslView-nvim
|
||||||
|
# TODO: sirtaj/vim-openscad
|
||||||
|
jupytext-nvim
|
||||||
|
vim-openscad
|
||||||
|
## paq
|
||||||
eyeliner-nvim
|
eyeliner-nvim
|
||||||
fzf-lua
|
fzf-lua
|
||||||
ltex_extra-nvim
|
ltex_extra-nvim
|
||||||
@@ -107,6 +148,11 @@
|
|||||||
copilot-lua
|
copilot-lua
|
||||||
copilot-cmp
|
copilot-cmp
|
||||||
pkgs.neovimPlugins.helm-ls-nvim
|
pkgs.neovimPlugins.helm-ls-nvim
|
||||||
|
kitty-scrollback-nvim
|
||||||
|
fidget-nvim
|
||||||
|
rustaceanvim
|
||||||
|
pkgs.neovimPlugins.m-taskwarrior-d-nvim
|
||||||
|
claude-code-nvim
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
1
dots/.config/nvim/ftplugin/dotenv.lua
Normal file
1
dots/.config/nvim/ftplugin/dotenv.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.opt_local.filetype = "sh"
|
||||||
1
dots/.config/nvim/ftplugin/javascript.lua
Normal file
1
dots/.config/nvim/ftplugin/javascript.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.opt.matchpairs:append("=:;")
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
-- NOTE: May want to move this, as it is more specific to wiki than to pandoc
|
|
||||||
vim.api.nvim_create_user_command("AnkiDeck", function()
|
|
||||||
local handle = io.popen("get-anki-decks")
|
|
||||||
local decks = {}
|
|
||||||
for line in handle:lines() do
|
|
||||||
table.insert(decks, line)
|
|
||||||
end
|
|
||||||
handle:close()
|
|
||||||
|
|
||||||
vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice)
|
|
||||||
if choice then
|
|
||||||
vim.api.nvim_put({ choice }, "", true, true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end, {})
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Anki helper functions
|
" Anki helper functions
|
||||||
|
|
||||||
" Convert cloze note to regular text
|
" Convert cloze note to regular text
|
||||||
@@ -20,3 +21,4 @@
|
|||||||
|
|
||||||
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
au FileType pandoc com! -range AnkiRemoveAllClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||||
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
au FileType pandoc com! -range AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
|
||||||
|
]])
|
||||||
@@ -1,3 +1,20 @@
|
|||||||
|
-- NOTE: May want to move this, as it is more specific to wiki than to pandoc
|
||||||
|
vim.api.nvim_create_user_command("AnkiDeck", function()
|
||||||
|
local handle = io.popen("get-anki-decks")
|
||||||
|
local decks = {}
|
||||||
|
for line in handle:lines() do
|
||||||
|
table.insert(decks, line)
|
||||||
|
end
|
||||||
|
handle:close()
|
||||||
|
|
||||||
|
vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice)
|
||||||
|
if choice then
|
||||||
|
vim.api.nvim_put({ choice }, "", true, true)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end, {})
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
set cc=81
|
set cc=81
|
||||||
set cocu=""
|
set cocu=""
|
||||||
func! GetContext()
|
func! GetContext()
|
||||||
@@ -17,3 +34,4 @@ func! GetContext()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
com! -nargs=0 GetContext :call GetContext()
|
com! -nargs=0 GetContext :call GetContext()
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
"
|
"
|
||||||
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy
|
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy
|
||||||
"
|
"
|
||||||
@@ -23,3 +24,4 @@ fun! Scheme_eval_defun()
|
|||||||
call Scheme_send_sexp(@")
|
call Scheme_send_sexp(@")
|
||||||
call setpos('.', pos)
|
call setpos('.', pos)
|
||||||
endfun
|
endfun
|
||||||
|
]])
|
||||||
@@ -1,12 +1,29 @@
|
|||||||
require("nixCatsUtils").setup({ non_nix_value = true }) -- https://github.com/BirdeeHub/nixCats-nvim/blob/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example/init.lua
|
require("nixCatsUtils").setup({ non_nix_value = true }) -- https://github.com/BirdeeHub/nixCats-nvim/blob/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example/init.lua
|
||||||
|
|
||||||
require("vim")
|
vim.cmd([[
|
||||||
|
set termguicolors
|
||||||
|
set bg=light
|
||||||
|
hi Normal ctermbg=none guibg=NONE
|
||||||
|
]])
|
||||||
|
|
||||||
|
require("base")
|
||||||
|
require("cursor")
|
||||||
|
require("fold")
|
||||||
|
require("netrw")
|
||||||
require("ftdetect")
|
require("ftdetect")
|
||||||
|
require("plug")
|
||||||
|
require("pandoc")
|
||||||
require("keymaps")
|
require("keymaps")
|
||||||
require("highlight")
|
require("highlight")
|
||||||
|
require("paq-setup")
|
||||||
|
require("statusline")
|
||||||
require("diagnostic")
|
require("diagnostic")
|
||||||
|
require("utils")
|
||||||
|
require("zk")
|
||||||
|
require("skeleton")
|
||||||
|
require("reload")
|
||||||
|
|
||||||
require("paq-setup") -- when not on nixCats
|
require("paq-setup") -- when not on nixCats
|
||||||
|
|
||||||
-- vim.opt.background = "dark"
|
vim.opt.background = "dark"
|
||||||
-- vim.opt.laststatus = 3
|
vim.opt.laststatus = 3
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
" General config {{{
|
vim.cmd([[
|
||||||
"
|
|
||||||
" Tip: acronyms for overview, use `:h` for a quick lookup.
|
" Tip: acronyms for overview, use `:h` for a quick lookup.
|
||||||
|
|
||||||
set nocp " Disable vi incompatibility
|
set nocp " Disable vi incompatibility
|
||||||
filetype plugin indent on " Filetype recognition
|
filetype plugin indent on " Filetype recognition
|
||||||
set enc=utf8 " Default to UTF-8 encoding
|
set enc=utf8 " Default to UTF-8 encoding
|
||||||
@@ -28,6 +26,5 @@ set lcs=trail:·,tab:→\ ,nbsp:␣ " Whitespace rendering
|
|||||||
set ar " Autoread
|
set ar " Autoread
|
||||||
set spellsuggest+=5 " Limit spell suggestions
|
set spellsuggest+=5 " Limit spell suggestions
|
||||||
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
|
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
|
||||||
set thesaurus+=~/.vim/thesaurus/mthesaur.txt
|
" set thesaurus+=./thesaurus/mthesaur.txt " FIXME
|
||||||
|
]])
|
||||||
" }}}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Taken from /usr/share/vim/vim90/defaults.vim
|
" Taken from /usr/share/vim/vim90/defaults.vim
|
||||||
augroup vimStartup
|
augroup vimStartup
|
||||||
au!
|
au!
|
||||||
@@ -12,3 +13,4 @@ augroup vimStartup
|
|||||||
\ | endif
|
\ | endif
|
||||||
|
|
||||||
augroup END
|
augroup END
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
" Folds {{{
|
" Folds {{{
|
||||||
set foldmethod=marker
|
set foldmethod=marker
|
||||||
|
|
||||||
@@ -22,3 +23,4 @@ augroup filetype_snippets
|
|||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
]])
|
||||||
@@ -7,5 +7,7 @@ vim.filetype.add({
|
|||||||
[".*/%.vscode/.*%.json"] = "jsonc",
|
[".*/%.vscode/.*%.json"] = "jsonc",
|
||||||
[".*/%.ssh/config%.d/.*"] = "sshconfig",
|
[".*/%.ssh/config%.d/.*"] = "sshconfig",
|
||||||
["%.env.*"] = "dotenv",
|
["%.env.*"] = "dotenv",
|
||||||
|
["%.pl$"] = "prolog",
|
||||||
|
[".*.containerfile.*"] = "dockerfile",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,3 +1,50 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
" Leader keys
|
||||||
|
let mapleader = " "
|
||||||
|
let maplocalleader = ";"
|
||||||
|
|
||||||
|
" Splits & navigation
|
||||||
|
nm s <c-w> " Split horizontal
|
||||||
|
nm ss :sp<CR><c-w>w| " Split horizontal
|
||||||
|
nm sv :vs<CR><c-w>w| " Split vertical
|
||||||
|
nm sw <c-w>w| " Navigate splits
|
||||||
|
nm sh <c-w>h| "
|
||||||
|
nm sj <c-w>j| "
|
||||||
|
nm sk <c-w>k| "
|
||||||
|
nm sl <c-w>l| "
|
||||||
|
nn sH <c-w>8<| " Resize splits
|
||||||
|
nn sJ <c-w>8-| "
|
||||||
|
nn sK <c-w>8+| "
|
||||||
|
nn sL <c-w>8>| "
|
||||||
|
nn s= <c-w>=| " Equalize splits
|
||||||
|
|
||||||
|
" Open
|
||||||
|
nn sb :Lex<cr>| " File tree
|
||||||
|
nn <leader><leader> :noh<cr> |"
|
||||||
|
nn <leader>t :term<cr>| " Open terminal
|
||||||
|
|
||||||
|
" Remaps
|
||||||
|
ino <nowait> jj <esc>| " Normal now
|
||||||
|
nn <left> <nop>| " Hard mode
|
||||||
|
nn <down> <nop>| " "
|
||||||
|
nn <up> <nop>| " "
|
||||||
|
nn <right> <nop>| " "
|
||||||
|
ino <left> <nop>| " "
|
||||||
|
ino <down> <nop>| " "
|
||||||
|
ino <up> <nop>| " "
|
||||||
|
ino <right> <nop>| " "
|
||||||
|
|
||||||
|
" Search
|
||||||
|
nn <c-_> :noh<cr>| " map 'ctrl + /'
|
||||||
|
|
||||||
|
" Line numbers
|
||||||
|
nn <leader>n :set nu! rnu!<cr>
|
||||||
|
|
||||||
|
" Vim configuration
|
||||||
|
nn <leader>ec :vs $MYVIMRC<cr>
|
||||||
|
nn <leader>so :so %<cr>
|
||||||
|
]])
|
||||||
|
|
||||||
local set = vim.keymap.set
|
local set = vim.keymap.set
|
||||||
|
|
||||||
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })
|
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
vim.cmd([[
|
||||||
let g:netrw_winsize = 30
|
let g:netrw_winsize = 30
|
||||||
let g:netrw_liststyle=3
|
let g:netrw_liststyle=3
|
||||||
let g:netrw_banner = 0
|
let g:netrw_banner = 0
|
||||||
|
]])
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
fu! Compile()
|
fu! Compile()
|
||||||
if expand('%:e') == "md"
|
if expand('%:e') == "md"
|
||||||
:silent exec "!pandoc % -s -o /tmp/op.pdf &"
|
:silent exec "!pandoc % -s -o /tmp/op.pdf &"
|
||||||
@@ -8,3 +9,4 @@ fu! Preview()
|
|||||||
:call Compile()
|
:call Compile()
|
||||||
:silent exec "!zathura /tmp/op.pdf &"
|
:silent exec "!zathura /tmp/op.pdf &"
|
||||||
endfu
|
endfu
|
||||||
|
]])
|
||||||
@@ -34,12 +34,17 @@ require("nixCatsUtils.catPacker").setup({
|
|||||||
{ "razak17/tailwind-fold.nvim" },
|
{ "razak17/tailwind-fold.nvim" },
|
||||||
{ "rmagatti/auto-session" },
|
{ "rmagatti/auto-session" },
|
||||||
{ "kndndrj/nvim-dbee" },
|
{ "kndndrj/nvim-dbee" },
|
||||||
{ "3rd/image.nvim", build = false },
|
-- { "3rd/image.nvim", build = false },
|
||||||
{ "polarmutex/beancount.nvim" },
|
{ "polarmutex/beancount.nvim" },
|
||||||
{ "jamesblckwell/nvimkit.nvim" },
|
-- { "jamesblckwell/nvimkit.nvim" },
|
||||||
{ 'olimorris/codecompanion.nvim' },
|
{ "olimorris/codecompanion.nvim" },
|
||||||
{ "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" },
|
{ "ravitemer/mcphub.nvim", build = "pnpm install -g mcp-hub@latest" },
|
||||||
{ "zbirenbaum/copilot.lua" },
|
{ "zbirenbaum/copilot.lua" },
|
||||||
{ "zbirenbaum/copilot-cmp" },
|
{ "zbirenbaum/copilot-cmp" },
|
||||||
{ "qvalentin/helm-ls.nvim", ft = "helm" },
|
{ "qvalentin/helm-ls.nvim", ft = "helm" },
|
||||||
|
{ "saghen/blink.download" },
|
||||||
|
{ "ramilito/kubectl.nvim" },
|
||||||
|
{ "mikesmithgh/kitty-scrollback.nvim" },
|
||||||
|
{ "chrisgrieser/nvim-early-retirement" },
|
||||||
|
{ "euclio/vim-markdown-composer" },
|
||||||
})
|
})
|
||||||
|
|||||||
35
dots/.config/nvim/lua/plug.lua
Normal file
35
dots/.config/nvim/lua/plug.lua
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
if not vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] then
|
||||||
|
local vim = vim
|
||||||
|
local Plug = vim.fn["plug#"]
|
||||||
|
|
||||||
|
vim.call("plug#begin")
|
||||||
|
|
||||||
|
Plug("machakann/vim-sandwich")
|
||||||
|
Plug("Shougo/context_filetype.vim")
|
||||||
|
Plug("editorconfig/editorconfig-vim")
|
||||||
|
Plug("honza/vim-snippets")
|
||||||
|
Plug("chrisbra/unicode.vim")
|
||||||
|
Plug("ap/vim-css-color")
|
||||||
|
-- Jupyter
|
||||||
|
Plug("quarto-dev/quarto-vim")
|
||||||
|
-- LaTeX
|
||||||
|
Plug("lervag/vimtex")
|
||||||
|
-- Wiki
|
||||||
|
Plug("lervag/wiki.vim")
|
||||||
|
-- Markdown
|
||||||
|
Plug("vim-pandoc/vim-pandoc")
|
||||||
|
Plug("vim-pandoc/vim-pandoc-syntax")
|
||||||
|
Plug("ferrine/md-img-paste.vim")
|
||||||
|
-- TidalCycles
|
||||||
|
Plug("supercollider/scvim")
|
||||||
|
Plug("tidalcycles/vim-tidal")
|
||||||
|
-- GLSL
|
||||||
|
Plug("tikhomirov/vim-glsl")
|
||||||
|
Plug("timtro/glslView-nvim")
|
||||||
|
-- Jupyter notebooks
|
||||||
|
Plug("goerz/jupytext.vim")
|
||||||
|
-- OpenSCAD
|
||||||
|
Plug("sirtaj/vim-openscad")
|
||||||
|
|
||||||
|
vim.call("plug#end")
|
||||||
|
end
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
|
vim.cmd([[
|
||||||
augroup Vim
|
augroup Vim
|
||||||
au!
|
au!
|
||||||
" Reload vim config when ~/.vimrc is changed
|
" Reload vim config when ~/.vimrc is changed
|
||||||
au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc"
|
au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc"
|
||||||
augroup END
|
augroup END
|
||||||
|
]])
|
||||||
11
dots/.config/nvim/lua/skeleton/init.lua
Normal file
11
dots/.config/nvim/lua/skeleton/init.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
autocmd("BufNewFile", {
|
||||||
|
pattern = "shell.nix",
|
||||||
|
command = "0r ~/.config/nvim/skeletons/shell.nix",
|
||||||
|
})
|
||||||
|
|
||||||
|
autocmd("BufNewFile", {
|
||||||
|
pattern = "flake.nix",
|
||||||
|
command = "0r ~/.config/nvim/skeletons/flake.nix",
|
||||||
|
})
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
vim.cmd([[
|
||||||
se ls=2
|
se ls=2
|
||||||
se stl=\ %0*%n
|
se stl=\ %0*%n
|
||||||
se stl+=\ %m
|
se stl+=\ %m
|
||||||
@@ -5,3 +6,4 @@ se stl+=\ %y%0*
|
|||||||
se stl+=\ %<%F
|
se stl+=\ %<%F
|
||||||
se stl+=\ %0*%=%5l%*
|
se stl+=\ %0*%=%5l%*
|
||||||
se stl+=%0*/%L%*
|
se stl+=%0*/%L%*
|
||||||
|
]])
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
vim.cmd([[
|
||||||
function! SynGroup()
|
function! SynGroup()
|
||||||
let l:s = synID(line('.'), col('.'), 1)
|
let l:s = synID(line('.'), col('.'), 1)
|
||||||
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
|
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
com! -nargs=0 Syn :call SynGroup()
|
com! -nargs=0 Syn :call SynGroup()
|
||||||
|
]])
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
vim.cmd([[
|
|
||||||
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
|
||||||
let &packpath = &runtimepath
|
|
||||||
source ~/.vimrc"
|
|
||||||
]])
|
|
||||||
49
dots/.config/nvim/lua/zk/cmp.lua
Normal file
49
dots/.config/nvim/lua/zk/cmp.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
local source = {}
|
||||||
|
|
||||||
|
local function get_markdown_files(base)
|
||||||
|
local items = {}
|
||||||
|
local pattern = base .. "/**/*.md"
|
||||||
|
local files = vim.fn.glob(pattern, false, true)
|
||||||
|
for _, file in ipairs(files) do
|
||||||
|
local label = file:gsub("^%./", ""):gsub("%.md$", "")
|
||||||
|
table.insert(items, { label = label })
|
||||||
|
end
|
||||||
|
return items
|
||||||
|
end
|
||||||
|
|
||||||
|
function source:complete(params, callback)
|
||||||
|
local cursor_before_line = params.context.cursor_before_line
|
||||||
|
local cursor_after_line = params.context.cursor_after_line or ""
|
||||||
|
|
||||||
|
local trigger = cursor_before_line:match("%[[^%]]*%]%(([^)]*)$")
|
||||||
|
|
||||||
|
if trigger ~= nil then
|
||||||
|
local items = get_markdown_files(".")
|
||||||
|
local next_char = cursor_after_line:sub(1, 1)
|
||||||
|
|
||||||
|
for _, item in ipairs(items) do
|
||||||
|
if next_char == ")" then
|
||||||
|
item.insertText = item.label
|
||||||
|
else
|
||||||
|
item.insertText = item.label .. ")"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
callback(items)
|
||||||
|
else
|
||||||
|
callback({})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function source:get_trigger_characters()
|
||||||
|
return { "(" }
|
||||||
|
end
|
||||||
|
|
||||||
|
function source:is_available()
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
return ft == "markdown" or ft == "pandoc"
|
||||||
|
end
|
||||||
|
|
||||||
|
cmp.register_source("zk", source)
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
require("zk.cmp")
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
let s:zk_preview_enabled = 0
|
let s:zk_preview_enabled = 0
|
||||||
let s:live_server_job = -1
|
let s:live_server_job = -1
|
||||||
au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt'
|
au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt'
|
||||||
@@ -18,3 +21,4 @@ endfunction
|
|||||||
command! ToggleZKPreview call ToggleZKPreview()
|
command! ToggleZKPreview call ToggleZKPreview()
|
||||||
|
|
||||||
nn <leader>o :ToggleZKPreview<cr> :!xdg-open http://localhost:8080/%:t:r.html & <cr>
|
nn <leader>o :ToggleZKPreview<cr> :!xdg-open http://localhost:8080/%:t:r.html & <cr>
|
||||||
|
]])
|
||||||
10
dots/.config/nvim/skeletons/flake.nix
Normal file
10
dots/.config/nvim/skeletons/flake.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ self, nixpkgs }:
|
||||||
|
{
|
||||||
|
};
|
||||||
|
}
|
||||||
4
dots/.config/nvim/skeletons/shell.nix
Normal file
4
dots/.config/nvim/skeletons/shell.nix
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
}:
|
||||||
|
pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ ]; }
|
||||||
@@ -27,7 +27,7 @@ return {
|
|||||||
t("flex-wrap: wrap;"),
|
t("flex-wrap: wrap;"),
|
||||||
i(0),
|
i(0),
|
||||||
}),
|
}),
|
||||||
s({ trig = "dfc", dscr = "Display flex column" }, {
|
s({ trig = "dfc", dscr = "Add 'flex-direction: column;'" }, {
|
||||||
t("display: flex;"),
|
t("display: flex;"),
|
||||||
t("flex-direction: column;"),
|
t("flex-direction: column;"),
|
||||||
i(0),
|
i(0),
|
||||||
|
|||||||
12
dots/.config/nvim/snips/lua.lua
Normal file
12
dots/.config/nvim/snips/lua.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
return {
|
||||||
|
s({ trig = "^M.", regTrig = true, snippetType = "autosnippet" }, {
|
||||||
|
t("local M = {"),
|
||||||
|
i(1),
|
||||||
|
t({ "}", "", "", "return M" }),
|
||||||
|
}),
|
||||||
|
}
|
||||||
@@ -5,6 +5,905 @@ local d = ls.dynamic_node
|
|||||||
local sn = ls.snippet_node
|
local sn = ls.snippet_node
|
||||||
local fmta = require("luasnip.extras.fmt").fmta
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
|
||||||
|
-- Original .snippets file - TODO: Migrate to lua snippets
|
||||||
|
-- ```viml
|
||||||
|
-- global !p
|
||||||
|
-- from datetime import datetime
|
||||||
|
-- from math import factorial
|
||||||
|
-- import subprocess
|
||||||
|
-- import re
|
||||||
|
-- import sys
|
||||||
|
--
|
||||||
|
-- ZOTERO_BASE = "http://127.0.0.1:23119/better-bibtex/cayw"
|
||||||
|
-- FENCES = {
|
||||||
|
-- "i": "idea",
|
||||||
|
-- "q": "question",
|
||||||
|
-- "n": "note",
|
||||||
|
-- "t": "thought",
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- def math_inline():
|
||||||
|
-- return vim.command_output('GetContext') == 'math_inline'
|
||||||
|
--
|
||||||
|
-- def math_block():
|
||||||
|
-- return vim.command_output('GetContext') == 'math_block'
|
||||||
|
--
|
||||||
|
-- def math():
|
||||||
|
-- return math_inline() or math_block()
|
||||||
|
--
|
||||||
|
-- def code_block():
|
||||||
|
-- return vim.command_output('GetContext') == 'pandocDelimitedCodeBlock'
|
||||||
|
--
|
||||||
|
-- def code_inline():
|
||||||
|
-- return vim.command_output('GetContext') == 'pandocNoFormatted'
|
||||||
|
--
|
||||||
|
-- def code():
|
||||||
|
-- return code_inline() or code_block()
|
||||||
|
--
|
||||||
|
-- def slugify(text):
|
||||||
|
-- return re.sub('\s+', '-', text.lower())
|
||||||
|
--
|
||||||
|
-- def linkify(text, link):
|
||||||
|
-- return f"[{text}]({link})"
|
||||||
|
--
|
||||||
|
-- def zot(action):
|
||||||
|
-- if action == "get_title":
|
||||||
|
-- cmd = f"curl -s '{ZOTERO_BASE}?format=json&selected=1' | jq '.[].title' -r"
|
||||||
|
-- elif action == "get_citekey":
|
||||||
|
-- cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1'"
|
||||||
|
-- elif action == "get_citekey_brackets":
|
||||||
|
-- cmd = f"curl -s '{ZOTERO_BASE}?format=pandoc&selected=1&brackets=1'"
|
||||||
|
-- elif action == "get_link":
|
||||||
|
-- link_path = re.sub("^@", "", zot("get_citekey"))
|
||||||
|
-- link_title = zot("get_title")
|
||||||
|
-- link = linkify(link_title, link_path)
|
||||||
|
-- return link
|
||||||
|
-- elif action == "get_file":
|
||||||
|
-- link_path = re.sub("^@", "", zot("get_citekey"))
|
||||||
|
-- link_title = zot("get_title")
|
||||||
|
-- link = linkify(link_title, f"file://{link_path}.pdf")
|
||||||
|
-- return link
|
||||||
|
-- else:
|
||||||
|
-- return "Zotero action not found"
|
||||||
|
-- return subprocess.check_output(cmd, shell=True).decode("utf-8").strip()
|
||||||
|
-- endglobal
|
||||||
|
--
|
||||||
|
-- snippet ctx "Context" i
|
||||||
|
-- `!p snip.rv = vim.command_output('GetContext')`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # General markdown
|
||||||
|
--
|
||||||
|
-- snippet ^h "Markdown header" r
|
||||||
|
-- # $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ^sec "Markdown section" r
|
||||||
|
-- ## $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ^ssec "Markdown subsection" r
|
||||||
|
-- ### $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ^sex "Markdown example section" r
|
||||||
|
-- ## Example: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ^ssex "Markdown example subsection" r
|
||||||
|
-- ### Example: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Zettelkasten templating
|
||||||
|
--
|
||||||
|
-- snippet nl
|
||||||
|
-- *nld*: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet eng
|
||||||
|
-- *eng*: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet fr
|
||||||
|
-- *fra*: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (de
|
||||||
|
-- *deu*: $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (nl
|
||||||
|
-- (*nld*: $1)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (eng
|
||||||
|
-- (*eng*: $1)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (fr
|
||||||
|
-- (*fra*: $1)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (de
|
||||||
|
-- (*deu*: $1)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet in
|
||||||
|
-- (In [$1]($2))$3
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet liwhat "What?" A
|
||||||
|
-- `!p snip.rv = "* [What?](" + snip.basename + "_what)"`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet liwhy "Why?" A
|
||||||
|
-- `!p snip.rv = "* [Why?](" + snip.basename + "_why)"`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet < "Comment (html)"
|
||||||
|
-- <!-- $1 -->$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet <. "Comment (html) ..." i
|
||||||
|
-- <!-- ... -->$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet <t "Thought (html)" i
|
||||||
|
-- <!--:::thought
|
||||||
|
-- $1
|
||||||
|
-- :::-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet <q "Question (html)" i
|
||||||
|
-- <!--:::question
|
||||||
|
-- $1
|
||||||
|
-- :::-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet <i "Idea (html)" i
|
||||||
|
-- <!--:::idea
|
||||||
|
-- $1
|
||||||
|
-- :::-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet <n "Note (html)" i
|
||||||
|
-- <!--:::note
|
||||||
|
-- $1
|
||||||
|
-- :::-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet td "Todo"
|
||||||
|
-- TODO${1:: $2}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ref "References"
|
||||||
|
-- <!--references-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet sort "Sort"
|
||||||
|
-- <!--sort-->
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet foot "Footnotes"
|
||||||
|
-- <!--footnotes-->
|
||||||
|
-- [^0]:
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet def "Definition"
|
||||||
|
-- **Definition${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]}
|
||||||
|
--
|
||||||
|
-- $7
|
||||||
|
--
|
||||||
|
-- ___
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet theo "Theorem"
|
||||||
|
-- **Theorem${1:: $2}**${3: [${4:citation}${5:, ${6:pointer}}]}
|
||||||
|
--
|
||||||
|
-- $7
|
||||||
|
--
|
||||||
|
-- ${8/(\w+).*/**Theorem** \n\n.../}
|
||||||
|
--
|
||||||
|
-- ___
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet prop "Property"
|
||||||
|
-- **Property $1** [@]
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
--
|
||||||
|
-- ___
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet lemm "Lemma"
|
||||||
|
-- **Lemma $1** [@]
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
--
|
||||||
|
-- ___
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet coro "Corollary"
|
||||||
|
-- **Corollary $1** [@]
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
--
|
||||||
|
-- ___
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Greek symbols
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet alpha "Alpha"
|
||||||
|
-- \\alpha
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet beta "Beta"
|
||||||
|
-- \\beta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet gamma "Gamma"
|
||||||
|
-- \\gamma
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet delta "Delta"
|
||||||
|
-- \\delta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet epsilon "Epsilon"
|
||||||
|
-- \\epsilonilon
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet zeta "Zeta"
|
||||||
|
-- \\zeta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet eta "Eta"
|
||||||
|
-- \\eta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet theta "Theta"
|
||||||
|
-- \\theta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet iota "Iota"
|
||||||
|
-- \\iota
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet kappa "Kappa"
|
||||||
|
-- \\kappa
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet lambda "Lambda" i
|
||||||
|
-- \\lambda
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet mu "Mu"
|
||||||
|
-- \\mu
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet nu "Nu"
|
||||||
|
-- \\nu
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet xi "Xi"
|
||||||
|
-- \\xi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet omicron "Omicron"
|
||||||
|
-- \\omicron
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet pi "Pi"
|
||||||
|
-- \\pi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet rho "Rho"
|
||||||
|
-- \\rho
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet sigma "Sigma"
|
||||||
|
-- \\sigma
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet tau "Tau"
|
||||||
|
-- \\tau
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet upsilon "Upsilon"
|
||||||
|
-- \\upsilon
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet phi "Phi"
|
||||||
|
-- \\phi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet chi "Chi"
|
||||||
|
-- \\chi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet psi "Psi"
|
||||||
|
-- \\psi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet omega "Omega"
|
||||||
|
-- \\omega
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Gamma "Gamma"
|
||||||
|
-- \\Gamma
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Delta "Delta"
|
||||||
|
-- \\Delta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Theta "Theta"
|
||||||
|
-- \\Theta
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Lambda "Lambda"
|
||||||
|
-- \\Lambda
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Xi "Xi"
|
||||||
|
-- \\Xi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Pi "Pi"
|
||||||
|
-- \\Pi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Sigma "Sigma"
|
||||||
|
-- \\Sigma
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Upsilon "Upsilon"
|
||||||
|
-- \\Upsilon
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Phi "Phi"
|
||||||
|
-- \\Phi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Psi "Psi"
|
||||||
|
-- \\Psi
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet Omega "Omega"
|
||||||
|
-- \\Omega
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet asaw "Als en slechts als (woorden)" i
|
||||||
|
-- als en slechts als
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet iffw "If and only if (words)" i
|
||||||
|
-- if and only if
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet asas "Als en slechts als (shorthand)" i
|
||||||
|
-- **asa**
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet iffs "If and only if (shorthand)" i
|
||||||
|
-- **iff**
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet beg "Begin"
|
||||||
|
-- \begin{$1}
|
||||||
|
-- $2
|
||||||
|
-- \end{$1}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet align "" i
|
||||||
|
-- \begin{align}
|
||||||
|
-- $1
|
||||||
|
-- \end{align}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet cases "" i
|
||||||
|
-- \begin{cases}
|
||||||
|
-- $1 \\\\
|
||||||
|
-- $2
|
||||||
|
-- \end{cases}
|
||||||
|
-- $3
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet tik "Tikzpicture" i
|
||||||
|
-- \begin{tikzpicture}
|
||||||
|
-- $1
|
||||||
|
-- \end{tikzpicture}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet matrix "Matrix" i
|
||||||
|
-- \begin{bmatrix}
|
||||||
|
-- $1
|
||||||
|
-- \end{bmatrix}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Insert anything after m/M in math mode
|
||||||
|
--
|
||||||
|
-- snippet "(\b)m(.*)" "MathJax" r
|
||||||
|
-- `!p snip.rv = match.group(1) + "$" + match.group(2) + "$"`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (\b)M(.*) "MathJax block" irw
|
||||||
|
-- $$
|
||||||
|
-- `!p snip.rv = match.group(2)`
|
||||||
|
-- $$
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Calligraphic letters
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet c([A-z]) "Calligraphic A" r
|
||||||
|
-- `!p snip.rv = "\\mathcal{" + match.group(1) + "}"`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Subscripts
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet '([A-z])(\w+)' "Subscripts" irw
|
||||||
|
-- `!p snip.rv = match.group(1) + '_' + match.group(2) if len(match.group(2)) == 1 else match.group(1) + '_{' + match.group(2) + '}'`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # MathJax
|
||||||
|
--
|
||||||
|
-- snippet fa "For all" i
|
||||||
|
-- \forall
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet frac "" i
|
||||||
|
-- \frac{$1}{$2}$3
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet set "" i
|
||||||
|
-- \\{$1\\}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet N "" i
|
||||||
|
-- \mathbb{N}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet N0 "" i
|
||||||
|
-- \mathbb{N}_0
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet N+ "" i
|
||||||
|
-- \mathbb{N}^+
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Z "" i
|
||||||
|
-- \mathbb{Z}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Z0 "" i
|
||||||
|
-- \mathbb{Z}_0
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Z+ "" i
|
||||||
|
-- \mathbb{Z}^+
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet R "" i
|
||||||
|
-- \mathbb{R}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet R0 "" i
|
||||||
|
-- \mathbb{R}_0
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet R+ "" i
|
||||||
|
-- \mathbb{R}^+
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet C "" i
|
||||||
|
-- \mathbb{C}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet lim "" i
|
||||||
|
-- \lim_{$1}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet limn "" i
|
||||||
|
-- \lim_{n \to \infty}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet binom "" i
|
||||||
|
-- \binom{$1}{$2}$3
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet andmath "description" i
|
||||||
|
-- \text{ and }
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet enmath "description" i
|
||||||
|
-- \text{ en }
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet lra "MathJax: long right arrow" i
|
||||||
|
-- \longrightarrow
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Ra "MathJax: right arrow" i
|
||||||
|
-- \Rightarrow
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Im "MathJax: image operator" i
|
||||||
|
-- \operatorname{Im}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ggd "Grootste gemene deler" i
|
||||||
|
-- \operatorname{ggd}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet fl "Floating point" i
|
||||||
|
-- \operatorname{fl}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Var "Variance" i
|
||||||
|
-- \operatorname{Var}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet E "Expectation" i
|
||||||
|
-- \operatorname{E}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Cov "Covariance" i
|
||||||
|
-- \operatorname{Cov}
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()" i
|
||||||
|
-- snippet ntup "Alpha"
|
||||||
|
-- (x_1, \ldots, x_n)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet mxn "Matrix" i
|
||||||
|
-- m \times n
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet mxn- "Matrix" i
|
||||||
|
-- $m \times n$-matrix
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet nxn "Matrix" i
|
||||||
|
-- n \times n
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet det "Determinant" i
|
||||||
|
-- \operatorname{det}(${1:A})$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet det| "Determinant alternative notation" i
|
||||||
|
-- |${1:A}|$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Span "Span" i
|
||||||
|
-- \operatorname{Span}\\{$1\\}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Nul "Null" i
|
||||||
|
-- \operatorname{Nul}($1)$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet Col "Column space" i
|
||||||
|
-- \operatorname{Col}($1)$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet kern "Kernel" i
|
||||||
|
-- \operatorname{kern}($1)$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet vec "Vector" i
|
||||||
|
-- \mathbf{$1}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "math()"
|
||||||
|
-- snippet vec([A-z]) "Vector ..." r
|
||||||
|
-- `!p snip.rv = "\\mathbf{" + match.group(1) + "}"`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet v1tovp "Vectors v indexed from 1 to p"
|
||||||
|
-- \mathbf{v_1},...,\mathbf{v_p}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet a1toan "Vectors a indexed from 1 to n"
|
||||||
|
-- \mathbf{a_1},...,\mathbf{v_n}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet .. "Dot dot dot" i
|
||||||
|
-- \dots $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet text "MathJax text" i
|
||||||
|
-- \text{$1}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet leq "Less than or equal to" i
|
||||||
|
-- \leq
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet leq "Greater than or equal to" i
|
||||||
|
-- \geq
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet eat "Evaluated at" i
|
||||||
|
-- {\biggr\rvert}_{$1}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet sketch "Link a sketch" i
|
||||||
|
-- [$1](file:///home/h/sketches/$2)
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet deck "Get anki deck"
|
||||||
|
-- `get-anki-decks`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # snippet ` "Inline code" i
|
||||||
|
-- # `$1`
|
||||||
|
-- # endsnippet
|
||||||
|
--
|
||||||
|
-- # Escape backticks
|
||||||
|
-- snippet `` "Code block" bA
|
||||||
|
-- \`\`\`$1
|
||||||
|
-- $2
|
||||||
|
-- \`\`\`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet `tex "Latex block (see latex filter)" bA
|
||||||
|
-- \`\`\`{.tex}
|
||||||
|
-- $1
|
||||||
|
-- \`\`\`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet `tik "Tikz block (see tikz filter)" bA
|
||||||
|
-- \`\`\`{.tex}
|
||||||
|
-- \\begin{tikzpicture}
|
||||||
|
-- $1
|
||||||
|
-- \\end{tikzpicture}
|
||||||
|
-- \`\`\`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet "(\b)fn(\d+)" "" ir
|
||||||
|
-- `!p snip.rv = snip.basename + "_" + match.group(2).zfill(2)`$1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet "ch(\d+)" "Link chapter" ir
|
||||||
|
-- `!p
|
||||||
|
-- num_str = match.group(1).zfill(2)
|
||||||
|
-- title = 3*"."
|
||||||
|
-- link = snip.basename + "_" + num_str
|
||||||
|
-- snip.rv = num_str + ". " + linkify(title, link)
|
||||||
|
-- `
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet "ch(\d+)to(\d+)" "Link chapters ... to ..." irA
|
||||||
|
-- `!p
|
||||||
|
-- for i in range(int(match.group(1)), int(match.group(2)) + 1):
|
||||||
|
-- num_str = str(i).zfill(2)
|
||||||
|
-- title = 3*"."
|
||||||
|
-- link = snip.basename + "_" + num_str
|
||||||
|
-- snip.rv += num_str + ". " + linkify(title, link) + "\n"
|
||||||
|
-- `
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet "sec([\sA-z]+)" "Link section titled ..." r
|
||||||
|
-- `!p
|
||||||
|
-- snip.rv = "* " + linkify(match.group(1), f"{snip.basename}_{slugify(match.group(1))}")
|
||||||
|
-- `
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet cp(\d+) "Comment current page (and date)" r
|
||||||
|
-- `!p snip.rv = "<!--" + datetime.now().strftime("%Y-%m-%d") + " p. " + match.group(1) + "-->"`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (\d+)! "Factorial of ..." r
|
||||||
|
-- `!p snip.rv = factorial(int(match.group(1)))`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet d "Date"
|
||||||
|
-- `!p snip.rv = datetime.now().strftime("%Y-%m-%d")`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet :(\w*) "Fence" r
|
||||||
|
-- `!p snip.rv += ":::" + FENCES.get(match.group(1) or "", "") + "\n" `$1
|
||||||
|
-- `!p snip.rv += ":::"`$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet \[(\w*) "Fence inline" ir
|
||||||
|
-- `!p snip.rv += "["`$1`!p snip.rv += "]{." + FENCES.get(match.group(1) or "", "") + "}"`$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ^eg "Example" r
|
||||||
|
-- E.g. $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # E.g. after list (or list preceded by space)
|
||||||
|
-- snippet (\*\s|\*)eg "Example" r
|
||||||
|
-- * E.g. $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # E.g. after dot (or dot preceded by space)
|
||||||
|
-- snippet (\.\s|\.)eg "Example" r
|
||||||
|
-- . E.g. $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet (?<!^|\*\s|\*|\.\s|\.)eg "Example" r
|
||||||
|
-- e.g. $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Zettelkasten to Anki
|
||||||
|
--
|
||||||
|
-- snippet td "TARGET DECK: <Deck name>"
|
||||||
|
-- TARGET DECK: $1::$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clo "Cloze"
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- ${0:${VISUAL}}$1
|
||||||
|
-- END
|
||||||
|
-- $2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clos "Cloze start"
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- $1
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet cloe "Cloze end"
|
||||||
|
-- END
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clod
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- **Definition$1**
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
-- END
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clop
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- **Property$1**
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
-- END
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clot
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- **Theorem$1**
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
-- END
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet clol
|
||||||
|
-- START
|
||||||
|
-- Cloze
|
||||||
|
-- **Lemma$1**
|
||||||
|
--
|
||||||
|
-- $2
|
||||||
|
-- END
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet "c(\d+)" "Cloze <number>" r
|
||||||
|
-- {{c`!p snip.rv = int(match.group(1))`::${0:${VISUAL}}$1}}$2
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # Match preceded by whitespace or start of line
|
||||||
|
-- snippet (?<!\S)z($|t|l|z|o|\.) "Zotero" r
|
||||||
|
-- `!p
|
||||||
|
--
|
||||||
|
-- ACTIONS = {
|
||||||
|
-- "": "get_citekey",
|
||||||
|
-- "t": "get_title",
|
||||||
|
-- "l": "get_link",
|
||||||
|
-- "z": "get_citekey_brackets",
|
||||||
|
-- "o": "get_file",
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- snip.rv = zot(ACTIONS.get(match.group(1)))
|
||||||
|
-- `
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet zq "Zotero quote" r
|
||||||
|
-- `!p snip.rv = '>\n> --' + zot("get_citekey_brackets")`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet acz "According to ..."
|
||||||
|
-- `!p snip.rv = "According to " + zot("get_citekey")`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet azex "As ... explains"
|
||||||
|
-- `!p snip.rv = "As " + zot("get_citekey") + " explains, "`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet iz "In ..."
|
||||||
|
-- `!p snip.rv = "In " + zot("get_citekey")`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet izd "In ...'s definition"
|
||||||
|
-- `!p snip.rv = "In " + zot("get_citekey") + "'s definition, "`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet zintends "... intends to ..." A
|
||||||
|
-- `!p snip.rv = zot("get_citekey") + " intends to "`
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet tfol "The following" wA
|
||||||
|
-- the following
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet tfolt "It follows that" wA
|
||||||
|
-- it follows that
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet ntfol "In the following" wA
|
||||||
|
-- in the following
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet algos "algorithms" wA
|
||||||
|
-- algorithms
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- snippet algo "algorithm" wA
|
||||||
|
-- algorithm
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- # TODO: Make only available in tikzpicture
|
||||||
|
-- context "code()"
|
||||||
|
-- snippet q "State" w
|
||||||
|
-- \node[state] ($1) [] {$2};
|
||||||
|
-- endsnippet
|
||||||
|
--
|
||||||
|
-- context "code()"
|
||||||
|
-- snippet q0 "Initial state" w
|
||||||
|
-- \node[initial,state] ($1) {$2};
|
||||||
|
-- endsnippet
|
||||||
|
-- ```
|
||||||
|
|
||||||
-- Taken from https://ejmastnak.com/tutorials/vim-latex/luasnip/#anatomy
|
-- Taken from https://ejmastnak.com/tutorials/vim-latex/luasnip/#anatomy
|
||||||
local get_visual = function(_, parent)
|
local get_visual = function(_, parent)
|
||||||
if #parent.snippet.env.LS_SELECT_RAW > 0 then
|
if #parent.snippet.env.LS_SELECT_RAW > 0 then
|
||||||
|
|||||||
24
dots/.config/nvim/snips/scheme.lua
Normal file
24
dots/.config/nvim/snips/scheme.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
return {
|
||||||
|
s("reqtrace", t({ "(#%require racket/trace)" })),
|
||||||
|
s("strln", t({ "(string-length " }), i(1), t({ ")" })),
|
||||||
|
s("impb", t({ "(import (rnrs base (6))", " (rnrs io simple" }), i(0), t({ ")" })),
|
||||||
|
s("def", {
|
||||||
|
t("(define "),
|
||||||
|
i(1),
|
||||||
|
t(" "),
|
||||||
|
i(2),
|
||||||
|
t(")"),
|
||||||
|
}),
|
||||||
|
s("defp", {
|
||||||
|
t("(define ("),
|
||||||
|
i(1),
|
||||||
|
t(" "),
|
||||||
|
i(2),
|
||||||
|
t("))"),
|
||||||
|
}),
|
||||||
|
}
|
||||||
69
dots/.config/nvim/snips/tex.lua
Normal file
69
dots/.config/nvim/snips/tex.lua
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local i = ls.insert_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local f = ls.function_node
|
||||||
|
|
||||||
|
-- Inspired by https://castel.dev/post/lecture-notes-1/
|
||||||
|
|
||||||
|
ls.add_snippets("tex", {
|
||||||
|
s("beg", {
|
||||||
|
t("\\begin{"),
|
||||||
|
i(1),
|
||||||
|
t({ "}", "\t" }),
|
||||||
|
i(0),
|
||||||
|
t({ "", "\\end{" }),
|
||||||
|
f(function(args)
|
||||||
|
return args[1][1]
|
||||||
|
end, { 1 }),
|
||||||
|
t("}"),
|
||||||
|
}),
|
||||||
|
|
||||||
|
s("def", {
|
||||||
|
t("\\begin{definition}"),
|
||||||
|
t({ "", "\t" }),
|
||||||
|
i(0),
|
||||||
|
t({ "", "\\end{definition}" }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
s("fig", {
|
||||||
|
t("\\begin{figure}"),
|
||||||
|
t({ "", "\t" }),
|
||||||
|
i(0),
|
||||||
|
t({ "", "\\end{figure}" }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
s(
|
||||||
|
"time",
|
||||||
|
f(function()
|
||||||
|
return os.date("%H:%M")
|
||||||
|
end)
|
||||||
|
),
|
||||||
|
|
||||||
|
s("i", t("\\textit{"), i(0), t("}")),
|
||||||
|
|
||||||
|
s("b", t("\\textbf{"), i(0), t("}")),
|
||||||
|
|
||||||
|
s("center", {
|
||||||
|
t("\\begin{center}"),
|
||||||
|
t({ "", "" }),
|
||||||
|
i(0),
|
||||||
|
t({ "", "\\end{center}" }),
|
||||||
|
}),
|
||||||
|
|
||||||
|
s("pac", t("\\usepackage{"), i(0), t("}")),
|
||||||
|
|
||||||
|
s("foot", t("\\footnote{"), i(0), t("}")),
|
||||||
|
|
||||||
|
s("dm", {
|
||||||
|
t({ "\\[", "" }),
|
||||||
|
i(1),
|
||||||
|
t({ "", "\\]" }),
|
||||||
|
i(0),
|
||||||
|
}),
|
||||||
|
|
||||||
|
s("ch", t("\\chapter{"), i(0), t("}")),
|
||||||
|
s("sec", t("\\section{"), i(0), t("}")),
|
||||||
|
s("ssec", t("\\subsection{"), i(0), t("}")),
|
||||||
|
s("sssec", t("\\subsubsection{"), i(0), t("}")),
|
||||||
|
})
|
||||||
12
dots/.config/nvim/snips/typescriptreact.lua
Normal file
12
dots/.config/nvim/snips/typescriptreact.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
|
||||||
|
return {
|
||||||
|
s("preJ", {
|
||||||
|
t("<pre>{JSON.stringify("),
|
||||||
|
i(1, "object"), -- first tab stop
|
||||||
|
t(", null, 2)}</pre>"),
|
||||||
|
}),
|
||||||
|
}
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
data.location=$XDG_DATA_HOME/task/
|
|
||||||
hooks.location=$XDG_DATA_HOME/task/hooks
|
|
||||||
|
|
||||||
include /usr/share/doc/task/rc/light-256.theme
|
|
||||||
include ./taskrc.d/$HOSTNAME
|
include ./taskrc.d/$HOSTNAME
|
||||||
include ./taskrc.d/aliases
|
include ./taskrc.d/aliases
|
||||||
include ./taskrc.d/sync
|
|
||||||
include ./taskrc.d/urgency
|
include ./taskrc.d/urgency
|
||||||
include ./taskrc.d/reports
|
include ./taskrc.d/reports
|
||||||
include ./taskrc.d/contexts
|
include ./taskrc.d/contexts
|
||||||
@@ -16,3 +11,5 @@ search.case.sensitive=no
|
|||||||
rc.json.array=on
|
rc.json.array=on
|
||||||
rc.verbose=nothing
|
rc.verbose=nothing
|
||||||
news.version=3.1.0
|
news.version=3.1.0
|
||||||
|
|
||||||
|
recurrence=off
|
||||||
|
|||||||
@@ -1 +1,4 @@
|
|||||||
recurrence=off
|
include /usr/share/doc/task/rc/light-256.theme
|
||||||
|
|
||||||
|
include ./locations
|
||||||
|
include ./sync
|
||||||
|
|||||||
2
dots/.config/task/taskrc.d/locations
Normal file
2
dots/.config/task/taskrc.d/locations
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
data.location=$XDG_DATA_HOME/task/
|
||||||
|
hooks.location=$XDG_DATA_HOME/task/hooks
|
||||||
@@ -1 +0,0 @@
|
|||||||
recurrence=off
|
|
||||||
1
dots/.config/user-dirs.conf
Normal file
1
dots/.config/user-dirs.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
enabled=False
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.gitconfig.email
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
editor = nvim
|
editor = nvim
|
||||||
excludesfile = ~/.gitignore
|
excludesfile = ~/.gitignore
|
||||||
|
|
||||||
[user]
|
[user]
|
||||||
email = hektor.misplon@pm.me
|
|
||||||
name = Hektor Misplon
|
name = Hektor Misplon
|
||||||
username = hektor
|
username = hektor
|
||||||
signingKey = AEB98353B8D72E465C4236435151AF79E723F21C
|
signingKey = AEB98353B8D72E465C4236435151AF79E723F21C
|
||||||
@@ -21,6 +23,8 @@
|
|||||||
sv = status --verbose
|
sv = status --verbose
|
||||||
co = checkout
|
co = checkout
|
||||||
cob = checkout -b
|
cob = checkout -b
|
||||||
|
pullr = "pull --rebase --autostash"
|
||||||
|
pushf = "push --force-with-lease"
|
||||||
# Note these follow the naming convention of my `.bash_aliases`
|
# Note these follow the naming convention of my `.bash_aliases`
|
||||||
al = "!git config -l | grep alias | cut -c 7-"
|
al = "!git config -l | grep alias | cut -c 7-"
|
||||||
alf = "!git config -l | grep alias | cut -c 7- | fzf"
|
alf = "!git config -l | grep alias | cut -c 7- | fzf"
|
||||||
@@ -74,8 +78,6 @@
|
|||||||
[merge]
|
[merge]
|
||||||
tool = nvimdiff
|
tool = nvimdiff
|
||||||
conflictstyle = diff3
|
conflictstyle = diff3
|
||||||
[pull]
|
|
||||||
rebase = true
|
|
||||||
[diff]
|
[diff]
|
||||||
colorMoved = zebra
|
colorMoved = zebra
|
||||||
[commit]
|
[commit]
|
||||||
@@ -83,3 +85,11 @@
|
|||||||
|
|
||||||
[interactive]
|
[interactive]
|
||||||
singleKey = true
|
singleKey = true
|
||||||
|
|
||||||
|
[pull]
|
||||||
|
rebase = true
|
||||||
|
[rerere]
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[includeIf "gitdir:~/work/"]
|
||||||
|
path = ~/.gitconfig.work
|
||||||
|
|||||||
2
dots/.gitconfig.email.example
Normal file
2
dots/.gitconfig.email.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[user]
|
||||||
|
email = your.email@example.com
|
||||||
13
dots/.gitconfig.work
Normal file
13
dots/.gitconfig.work
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[include]
|
||||||
|
path = ~/.gitconfig.work.email
|
||||||
|
|
||||||
|
[core]
|
||||||
|
longpaths = true
|
||||||
|
|
||||||
|
[user]
|
||||||
|
name = Hektor Misplon
|
||||||
|
username = hektor.misplon
|
||||||
|
signingKey = 1C88BE828184CEE6
|
||||||
|
|
||||||
|
[commit]
|
||||||
|
gpgsign = false
|
||||||
2
dots/.gitconfig.work.email.example
Normal file
2
dots/.gitconfig.work.email.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[user]
|
||||||
|
email = your.work.email@example.com
|
||||||
2
dots/.gitignore
vendored
2
dots/.gitignore
vendored
@@ -9,6 +9,7 @@ log/
|
|||||||
# Node
|
# Node
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
node_modules
|
node_modules
|
||||||
|
.npm-cache
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
*.pyc
|
*.pyc
|
||||||
@@ -68,6 +69,7 @@ Thumbs.db
|
|||||||
|
|
||||||
# Kernel Module Compile Results
|
# Kernel Module Compile Results
|
||||||
*.mod*
|
*.mod*
|
||||||
|
!*.mod*.*
|
||||||
*.cmd
|
*.cmd
|
||||||
.tmp_versions/
|
.tmp_versions/
|
||||||
modules.order
|
modules.order
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
let g:taskwiki_taskrc_location='/home/h/.config/task/taskrc'
|
|
||||||
let g:taskwiki_disable_concealcursor=1
|
|
||||||
let g:taskwiki_dont_preserve_folds=1
|
|
||||||
let g:taskwiki_dont_fold=1
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
" Override the pandoc-syntax highlighting colors for more subtle citations
|
|
||||||
hi! link pandocPCite Comment
|
|
||||||
hi! link pandocICite Comment
|
|
||||||
hi! link pandocCiteKey Comment
|
|
||||||
hi! link pandocCiteAnchor Comment
|
|
||||||
hi! link pandocCiteLocator Comment
|
|
||||||
|
|
||||||
" Don't show the CiteKey within the CiteLocator
|
|
||||||
syn match pandocCiteKey /\v\[[^]]+\]/ contained
|
|
||||||
|
|
||||||
" Match cloze delimiters e.g. `{{c1::` and `}}`
|
|
||||||
syn match ClozeDelimiter /{{c\d\+::/ conceal containedin=pandocUListItem,pandocListItem
|
|
||||||
syn match ClozeDelimiter /}}/ conceal containedin=pandocUListItem,pandocListItem
|
|
||||||
" Match text between cloze delimiters
|
|
||||||
syn match Cloze /\({{c\d\+::\)\@<=\(\_[A-Za-z0-9$\ \\\-\*,_`()]*\)\(}}\)\@=/ containedin=pandocUListItem,pandocListItem
|
|
||||||
|
|
||||||
hi! link ClozeDelimiter Special
|
|
||||||
hi! link Cloze Special
|
|
||||||
|
|
||||||
" Fix task UUIDs not being highlighted correctly in pandoc lists
|
|
||||||
syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape,TaskWikiTaskUuid skipempty display
|
|
||||||
syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/
|
|
||||||
syn match TaskWikiTaskUuid containedin=TaskWikiTask /\v#([A-Z]:)?[0-9a-fA-F]{8}$/
|
|
||||||
highlight link TaskWikiTaskUuid Comment
|
|
||||||
|
|
||||||
:runtime! syntax/_comment_keywords.vim
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user