Compare commits

..

133 Commits

Author SHA1 Message Date
6b6556cd80 refactor(home/work): improve configuration structure
- Add nixpkgs.config.allowUnfree setting
- Fix nixGL configuration path to targets.genericLinux.nixGL
- Remove redundant anki program import (now in modules)
- Enable gh and kubecolor programs
- Pass inputs to packages.nix for flake package access

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:41:33 +01:00
2e9c500892 feat(home): add GNOME desktop configuration
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:41:33 +01:00
4cabbcca5d chore(home): add commented experimental anki sync config
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:41:33 +01:00
1f326544d6 refactor(work): set up 'packages.local.nix' approach 2025-12-03 15:41:33 +01:00
69599c8e3d feat(home): add git config with example configuration for non-NixOS 2025-12-03 15:41:33 +01:00
7f3a7c5543 refactor: move common hosts config into 'modules/common.nix' 2025-12-03 15:41:33 +01:00
9d095ffb7e chore: formatting and cleanup
- Format shell.nix skeleton to single line
- Complete ts-node removal from astyanax packages
- Format andromache hardware config
2025-12-03 15:39:08 +01:00
9c1d77eb47 chore: update flake to 'nixos-unstable'
- Switch from 'nixos-25.05' to 'nixos-unstable'
- Update home-manager to follow main branch
2025-12-03 15:39:08 +01:00
baafd655ca fix(astyanax): correct hostname typo from astynanax to astyanax 2025-12-03 15:39:08 +01:00
022e5b17a0 Add neovim 'typescriptreact' snippets 2025-11-27 12:06:38 +01:00
e0a1ec77ed enable wake on lan on 'andromache' host 2025-11-27 10:37:05 +01:00
68bf971992 declare rootless docker for 'andromache' host 2025-11-26 18:37:11 +01:00
80e74d3283 enable recurrence only on one hosts per 'man task-sync' 2025-11-24 18:47:10 +01:00
f93eecfcb1 refactor 'nixosConfigurations' 2025-11-23 23:29:46 +01:00
6d5e6add02 move 'nixos-hardware' from 'vm' to 'astyanax' host 2025-11-23 22:06:25 +01:00
cdf5127071 modularize NixOS secrets config 2025-11-23 22:06:25 +01:00
1a57e8a424 refactor 2025-11-23 19:49:49 +01:00
cf27fdedde use neovim dark mode 2025-11-23 19:48:48 +01:00
92226fff95 declare taskwarrior for all NixOS hosts 2025-11-23 19:37:15 +01:00
2e81d28cc8 split up taskwarrior config to facilitate coexisting NixOS and Arch configs 2025-11-23 19:02:21 +01:00
f5e31ff825 Add (unused) 'printing' module 2025-11-23 16:12:55 +01:00
fdd4c13d34 Refactor 'home/hosts/work' 2025-11-23 16:10:30 +01:00
25dd5fc67b Set up xdg user directories 2025-11-18 23:43:12 +01:00
c3bfb2e449 Add 'vim-plug' vim plugin to neovim flake 2025-11-18 23:42:34 +01:00
283e49281c Update intel CPU microcode 2025-11-18 23:41:55 +01:00
e8c9ea3af0 Improve disko declarations 2025-11-17 21:20:00 +00:00
5f65c9ad92 Refactor 'hosts/' to use 'default.nix' 2025-11-17 20:41:34 +00:00
2793aa4e59 Add gitconfig and gitignore to git home module 2025-11-17 19:15:09 +01:00
6e93f8cb39 Prefer dark theme (gnome) 2025-11-17 19:06:59 +01:00
c8dbef379e Set up 'andromache' host 2025-11-17 19:06:35 +01:00
bdd959f3df Update (networking) hostnames 2025-11-16 16:03:36 +01:00
59575b2ff9 Only open SSH port when SSH is enabled 2025-11-16 16:03:03 +01:00
27c5ec21a4 Refactor 2025-11-16 15:42:11 +01:00
d81e168cd9 Fix vm error 2025-11-16 15:42:03 +01:00
2352981b16 Rename firefox profile from 'work' to 'default' 2025-11-16 02:09:54 +01:00
a0472eccc6 Enable nightlight (dconf setting) 2025-11-16 02:00:21 +01:00
9475aae43a Update flake 2025-11-16 01:40:48 +01:00
7bfe1457f8 Add 'kitty-scrollback.nvim' to neovim flake 2025-11-16 01:38:51 +01:00
0578ba56f9 Modularize gnome config 2025-11-16 01:36:19 +01:00
98faf1c356 Use neovim flake 2025-11-16 01:31:55 +01:00
ff5b4e1665 Add github CLI to 'astyanax' host 2025-11-16 00:19:21 +01:00
b9cab17495 Update 'nvim' flake 2025-11-15 23:56:11 +01:00
3d00618b68 Reuse home modules in 'astyanax' host 2025-11-15 23:49:04 +01:00
8ea508585b Merge NixOS and home manager flakes 2025-11-15 23:49:04 +01:00
bbaf22e871 Remove 'nix-topology' 2025-11-15 23:17:24 +01:00
829655f4ba Add 'Syncthing' example config to 'astyanax' host 2025-11-15 21:09:36 +01:00
fcda5c511e Add 'plocate' to 'astyanax' host 2025-11-15 21:04:21 +01:00
8c91d2a47c Add 'Syncthing' to 'astyanax' host 2025-11-15 20:35:12 +01:00
b3ef701db6 Add bluetooth to 'astyanax' host 2025-11-14 14:08:22 +01:00
d428c88a36 Set up nixos-hardware for 'astyanax' host 2025-11-12 23:20:29 +01:00
d5c0e08eb1 Remove redundant firefox package 2025-11-12 23:20:01 +01:00
11b01dd83f Fix wifi disconnect issue? 2025-11-12 23:04:29 +01:00
a68a903b9e Set up astyanax host 2025-11-12 23:02:30 +01:00
d876d02313 Remove firefox bookmarks 2025-11-11 01:06:20 +01:00
29a8484d1e Set up interception-tools on NixOS 2025-11-10 22:17:39 +01:00
3c385724d0 Improve NixOS default firewall declaration 2025-11-10 21:46:08 +01:00
cf18dcdb67 Add (relevant) '~/.bin' scripts to NixOS 2025-11-10 20:51:55 +01:00
408fb8ee0b Merge commit '63ceb40b4558f0fddb36f8244942d8a432e9182c' 2025-11-10 20:42:31 +01:00
63ceb40b45 Remove redundant 'dmenu' scripts 2025-11-10 20:41:51 +01:00
261223fe5c Add 'bash_aliases' from 'dots' to NixOS 2025-11-10 20:24:19 +01:00
17792f297b Add 'vscode-langservers-extracted' to neovim Nix flake 2025-11-10 18:33:48 +01:00
87008639ba Add 'vscode-langservers-extracted' to neovim Nix flake 2025-11-10 18:33:48 +01:00
512807cacf Update readme's 2025-11-10 18:04:39 +01:00
b7c27b53fa Move 'vm' host home into home manager flake 2025-11-10 17:55:58 +01:00
61278b8fb3 Merge 'home-manager' flake into NixOS flake 2025-11-10 17:47:59 +01:00
b039acd9c1 Merge 'home-manager' flake into NixOS flake 2025-11-10 17:47:59 +01:00
8c7d8f9bc5 Merge commit '85165468f589dbb395b73f0cb17b758ac6fe33aa' 2025-11-10 17:46:25 +01:00
1c4b3be339 Modularize NixOS SSH config 2025-11-10 17:04:45 +01:00
e92d5c0da9 Modularize NixOS fonts config 2025-11-10 16:49:25 +01:00
c267ac6fc7 Set up 'nix-topology' 2025-11-10 16:38:32 +01:00
85165468f5 Update 'kitty.conf' 2025-11-10 15:29:49 +01:00
3fb3b1e521 Set up sops-nix secrets 2025-11-06 23:13:26 +01:00
43f5cc701e Add neovim skeleton module 2025-11-06 14:31:55 +01:00
ffc34d78d7 Fix conform eslint-prettier conflicting formatters 2025-11-06 12:16:10 +01:00
61ac93b68f Add git push/pull aliases 2025-11-06 11:16:14 +01:00
411986643a Update bash aliases 2025-11-06 11:14:59 +01:00
5d88ea6f11 Add back zettelkasten markdown file completion 2025-11-04 23:31:24 +01:00
fa6c4d786b Update gitsigns.nvim config 2025-11-04 23:31:24 +01:00
a07473f125 Add lua module snippet 2025-11-04 23:31:24 +01:00
7fd1b35186 Set up lua language server for Neovim 2025-11-04 23:31:24 +01:00
38e27e7208 Set up kitty-scrollback.nvim 2025-11-04 16:36:10 +01:00
f83d453320 Use 'dockerfile' filetype for 'containerfiles' 2025-11-04 16:36:10 +01:00
4d1b84db3c Update gitignore 2025-11-04 16:36:10 +01:00
bb76c9fa3a Update Nix home manager flake 2025-11-04 16:36:10 +01:00
242d0fe094 Migrate to new Neovim 'lspconfig' version 2025-11-01 23:28:37 +01:00
4567ea177b Add 'nixpkgs.follows' to 'nixgl' input in Nix home manager flake 2025-10-28 22:13:41 +01:00
165c71a2a4 Declare keepassxc config in Nix home manager flake 2025-10-28 12:56:59 +01:00
f42a896d53 Modularize neovim & git config in Nix home manager flake 2025-10-28 11:54:40 +01:00
c605f61445 Modularize firefox config in Nix home manager flake 2025-10-28 11:52:33 +01:00
783908c5eb Declare anki package in Nix home manager flake 2025-10-28 11:46:20 +01:00
966065dd30 Format home manager flake (nixfmt) 2025-10-28 00:19:28 +01:00
01264a395d Move git & neovim into Nix home manager flake 2025-10-28 00:18:10 +01:00
292a2883be Declare bookmarks in firefox toolbar 2025-10-27 23:56:29 +01:00
5a50aa540f Improve pomo script 2025-10-26 22:46:15 +01:00
84e0c7f700 Move firefox (with addons) into Nix home manager flake 2025-10-26 22:42:28 +01:00
a737b50284 Update 'git-cb' script 2025-10-24 10:12:29 +02:00
608a3bc725 Remove taskwarrior related neovim stuff 2025-10-23 16:52:23 +02:00
a668bb47db Set up nix formatter and language server 2025-10-23 16:26:04 +02:00
15cf8bc566 Set up nix formatter and language server 2025-10-23 16:26:04 +02:00
325d0d1d72 Merge commit '2943f5a3716f091ba16bc812339c4159c99486f2' 2025-10-21 00:01:04 +02:00
2943f5a371 Merge commit 'f035c9318b23aea7479c124d749f5678c060e7b3' 2025-10-21 00:00:41 +02:00
89c1417915 Merge commit 'f035c9318b23aea7479c124d749f5678c060e7b3' 2025-10-21 00:00:41 +02:00
f035c9318b Squashed 'dots/' changes from f64b634..24ce8f3
24ce8f3 Migrate '.vim/plugin' to neovim
e3d9612 Remove vim yin/yang colorschemes
05986a3 Migrate '.vim/ftplugin' to neovim
05bc2ec Migrate vim snippets to neovim (LuaSnip)
128ae8e Migrate '.vim/ftdetect/prolog' to neovim
f3188f7 Migrate '.vim/after/syntax' to neovim
85d56f9 Migrate vim init config to neovim
afca2ca Migrate '.vim/after' to neovim
d6875c9 Add 'eslint_d' PID to 'nvim-lint' config
568e45f Remove jira aliases
78fa170 Disable 'xdg-user-dirs' by default
5216f79 Alias bash 'history' command to 'h'
0f29dc3 Add neovim dependencies to flake
c901a1c test
6113c08 Merge commit '490998275cbdc5ff032d4a39794bf850f4bfefec'
470f69f Add neovim 'auto-session' plugin setup
d3a67ab Add minimal readme to my neovim configuration
f79bc54 Add minimal readme to my neovim configuration
4fe60cf Remove neovim lazy load related config
211da54 Fall back to 'paq.nvim' only when not on 'nixCats'
b6d3015 Add 'nixCatsUtils' from 'nixCats'
139089f Add neovim packages to 'nixCats' flake
a54e745 Add minimal 'nixCats' flake template
6e48621 Link NixOS repo in dotfiles repository

git-subtree-dir: dots
git-subtree-split: 24ce8f39af
2025-10-20 23:59:27 +02:00
24ce8f39af Migrate '.vim/plugin' to neovim 2025-10-20 23:57:01 +02:00
e3d9612e57 Remove vim yin/yang colorschemes 2025-10-20 23:57:01 +02:00
05986a30bb Migrate '.vim/ftplugin' to neovim 2025-10-20 23:57:01 +02:00
05bc2ec59e Migrate vim snippets to neovim (LuaSnip) 2025-10-20 23:57:01 +02:00
128ae8ed1e Migrate '.vim/ftdetect/prolog' to neovim 2025-10-20 23:57:01 +02:00
f3188f7b4b Migrate '.vim/after/syntax' to neovim 2025-10-20 23:57:01 +02:00
85d56f97d1 Migrate vim init config to neovim 2025-10-20 23:57:01 +02:00
afca2cae5d Migrate '.vim/after' to neovim 2025-10-20 23:57:01 +02:00
d6875c97d9 Add 'eslint_d' PID to 'nvim-lint' config 2025-10-16 12:14:15 +02:00
568e45f59b Remove jira aliases 2025-10-16 12:08:22 +02:00
78fa170e7a Disable 'xdg-user-dirs' by default 2025-10-16 11:56:18 +02:00
5216f7938b Alias bash 'history' command to 'h' 2025-10-16 11:56:18 +02:00
9382d57565 Fix Iosevka font in NixOS 2025-10-15 23:23:58 +02:00
0f29dc3054 Add neovim dependencies to flake 2025-10-15 22:48:09 +02:00
860b66c71f Add neovim dependencies to flake 2025-10-15 22:48:09 +02:00
c901a1cea4 test 2025-10-15 22:25:28 +02:00
cac4b7641c test 2025-10-15 22:25:28 +02:00
9b153e7628 Merge commit '6113c086eb3e642f3fe991b2227b654f0a9b80a1' 2025-10-15 22:21:14 +02:00
6113c086eb Merge commit '490998275cbdc5ff032d4a39794bf850f4bfefec' 2025-10-15 22:18:59 +02:00
470f69fada Add neovim 'auto-session' plugin setup 2025-10-15 22:17:56 +02:00
33c8355ad1 Lock flake 2025-10-15 21:27:59 +02:00
d3a67ab58d Add minimal readme to my neovim configuration 2025-10-15 21:26:56 +02:00
04d9977747 Add minimal readme to my neovim configuration 2025-10-15 21:26:56 +02:00
f79bc5427d Add minimal readme to my neovim configuration 2025-10-15 21:19:22 +02:00
4fe60cf861 Remove neovim lazy load related config 2025-10-15 20:50:58 +02:00
211da54bcf Fall back to 'paq.nvim' only when not on 'nixCats' 2025-10-15 20:38:39 +02:00
b6d3015559 Add 'nixCatsUtils' from 'nixCats' 2025-10-15 20:15:43 +02:00
139089fc9d Add neovim packages to 'nixCats' flake 2025-10-14 22:03:49 +02:00
a54e745190 Add minimal 'nixCats' flake template 2025-10-13 21:59:58 +02:00
6e48621275 Link NixOS repo in dotfiles repository 2025-10-04 18:33:55 +02:00
135 changed files with 3113 additions and 2269 deletions

2
.gitignore vendored
View File

@@ -4,3 +4,5 @@ result
result-*
nixos-efi-vars.fd
home/hosts/work/packages.local.nix

View File

@@ -1,4 +1,4 @@
# nixos
# NixOS flake
## Set up virtual machine ([`disko`](https://github.com/nix-community/disko/blob/master/docs/interactive-vm.md))

View File

@@ -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
# Programs
alias h="history"
alias o="xdg-open"
alias v="nvim"
alias vf="fzf --bind 'enter:become(nvim {})'"
alias g='git'
alias t=' task'
alias k="kubectl"
alias t='task'
alias tsh='tasksh'
alias z='zathura --fork'
alias f='fzf'

View File

@@ -1,4 +0,0 @@
# shellcheck shell=bash
# vim: set ft=bash :
alias jira-me='jira issue list -a$(jira me)'

View File

@@ -15,7 +15,6 @@
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && . "$HOME/.bash_aliases/hosts/$HOSTNAME"
[ -f "$HOME/.bash_aliases/private" ] && . "$HOME/.bash_aliases/private"
[ -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 {{{
[ -d "$HOME/.bash_completions" ] && for file in "$HOME/.bash_completions"/*; do

View File

@@ -1,6 +1,6 @@
# Scripts
Mostly tiny helper scripts & experiments, some more useful than others.
Mostly tiny helper scripts \& experiments, some more useful than others.
## Setup

View File

@@ -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

View File

@@ -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:"

View File

@@ -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

View File

@@ -1,25 +1,110 @@
#!/usr/bin/env bash
set -euo pipefail
types=(
"feature For new features"
"bugfix For bug fixes"
readonly ALLOWED_MAIN_BRANCHES=("main" "master" "develop")
readonly BRANCH_TYPES=(
"feat For new features"
"hotfix For urgent fixes"
"fix For fixes"
"release For preparing releases"
"chore For non-code tasks"
)
selected=$(printf '%s\n' "${types[@]}" | fzf --prompt="Select branch type: ") || exit 1
type=${selected%% *}
error() {
echo "Error: $1" >&2
exit 1
}
echo "Fetching Jira tickets..."
jira_data=$(jira issue list --assignee=hektor.misplon@rightcrowd.com --order-by=priority --plain --no-headers 2>/dev/null)
warn() {
echo "Warning: $1" >&2
}
if [[ $? -ne 0 || -z "$jira_data" ]]; then
echo "Warning: Could not fetch Jira tickets or no tickets found."
echo "Proceeding without ticket ID..."
ticket_id=""
else
# Create formatted list for fzf: "TICKET-123 - Issue description"
check_dependencies() {
local missing=()
for cmd in git fzf; do
if ! command -v "$cmd" &> /dev/null; then
missing+=("$cmd")
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 '{
ticket_id = $2
$1 = $2 = ""
@@ -32,59 +117,105 @@ else
}')
if [[ -z "$formatted_tickets" ]]; then
echo "No tickets found. Proceeding without ticket ID..."
ticket_id=""
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
warn "No tickets to display. Proceeding without ticket ID."
return 0
fi
fi
editor="${EDITOR:-vi}"
tmpfile=$(mktemp)
local selected_ticket
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
cat > "$tmpfile" << EOF
if [[ "$selected_ticket" != "SKIP"* ]]; then
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
# 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.
# Lines starting with # will be ignored.
EOF
else
cat > "$tmpfile" << 'EOF'
# Enter your branch description below in kebab case (e.g. `my-description`):
else
cat > "$tmpfile" << 'EOF'
# Enter your branch description below in kebab-case (e.g., my-description):
# Lines starting with # will be ignored.
EOF
fi
fi
"$editor" "$tmpfile"
"$editor" "$tmpfile" < /dev/tty > /dev/tty
desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
rm "$tmpfile"
local desc
desc=$(grep -v '^#' "$tmpfile" | tr -d '\n' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
if [[ -z "$desc" ]]; then
echo "No description provided."
exit 1
fi
echo "$desc"
}
if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
echo "Invalid branch description format."
echo "Use lowercase letters, numbers, and hyphens only."
echo "No trailing or consecutive hyphens allowed."
exit 1
fi
validate_description() {
local desc=$1
if [[ -n "$ticket_id" ]]; then
branch="$type/$ticket_id-$desc"
else
branch="$type/$desc"
fi
if [[ -z "$desc" ]]; then
error "No description provided"
fi
echo "Creating branch: $branch"
git checkout -b "$branch"
if [[ ! "$desc" =~ ^[a-z0-9]+(-[a-z0-9]+)*$ ]]; then
error "Invalid branch description format.\nUse lowercase letters, numbers, and hyphens only.\nNo trailing or consecutive hyphens allowed.\nExample: my-feature-description"
fi
}
create_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 "$@"

View File

@@ -14,11 +14,12 @@ from argparse import ArgumentParser
from time import sleep
from plyer import notification
POMO_PATH = os.path.join(os.getenv("XDG_DATA_HOME", os.path.expanduser("~/.local/share")), "pomo")
@atexit.register
def clear():
if os.path.exists('/home/h/.local/share/pomo'):
os.remove('/home/h/.local/share/pomo')
if os.path.exists(POMO_PATH):
os.remove(POMO_PATH)
def format_mins_secs(mins, secs):
return f"{mins:02d}:{secs:02d}"
@@ -30,24 +31,20 @@ def make_countdown():
mins = duration // 60
secs = duration % 60
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)
duration -= 1
return countdown
def main(args):
prep_duration = args.prep_duration * 60
work_duration = args.work_duration * 60
break_duration = args.break_duration * 60
repeats = args.repeats
prep_countdown = make_countdown()
work_countdown = make_countdown()
break_countdown = make_countdown()
prep_countdown(prep_duration)
while repeats != 0:
notification.notify(title="Get started")
work_countdown(work_duration)

View File

@@ -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

View File

@@ -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");

View File

@@ -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
}

View File

@@ -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 ];
};
};
};
}

View File

@@ -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;
};
}

View File

@@ -1,3 +0,0 @@
{ pkgs, config, ... }:
with pkgs; [ ]

View File

@@ -1,27 +1,167 @@
# Fonts
#: Fonts {{{
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_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
input_delay 2
# Transparency
#: }}}
# dynamic_background_opacity yes
# background_opacity 0.0
#: Terminal bell {{{
enable_audio_bell no
enable_audio_bell yes
window_alert_on_bell yes
# Scrollback
#: }}}
scrollback_lines 16384
scrollback_pager nvimpager
#: Window layout {{{
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
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

View 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

View File

@@ -3,4 +3,4 @@
My neovim configuration. Available as a Nix flake [^nixcats]. When installing manually,
`paq.nvim` is used as a fallback plugin manager.
[^nixcats] Based on [this nixCats `example` template](https://github.com/BirdeeHub/nixCats-nvim/tree/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example)
[^nixcats]: Based on [this nixCats `example` template](https://github.com/BirdeeHub/nixCats-nvim/tree/77dffad8235eb77684fcb7599487c8e9f23d5b8f/templates/example)

View File

@@ -1,3 +1,4 @@
vim.cmd([[
function GetClozeNumber()
let REGEX_CLOZE_START = '{{c\d\+::'
@@ -33,3 +34,4 @@ let g:sandwich#recipes += [
\ 'nesting': 1
\ }
\ ]
]])

View File

@@ -0,0 +1,3 @@
require("auto-session").setup({
auto_session_enabled = vim.env.KITTY_SCROLLBACK_NVIM ~= "true", -- See kitty-scrollback.nvim
})

View File

@@ -1,6 +1,6 @@
require("conform").setup({
format_on_save = {
lsp_fallback = true,
format_after_save = {
lsp_fallback = false,
async = false,
timeout_ms = 500,
},
@@ -15,14 +15,15 @@ require("conform").setup({
html = { "prettierd", "prettier", stop_after_first = true },
lua = { "stylua" }, -- configured in stylua.toml
markdown = { "prettierd", "prettier", stop_after_first = true },
javascript = { "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "prettierd", "prettier", stop_after_first = true },
nix = { "nixfmt" },
javascript = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
javascriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
jsonc = { "prettierd", "prettier", stop_after_first = true },
python = { "isort", "black" },
svelte = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "prettierd", "prettier", stop_after_first = true },
yaml = { "prettierd", "prettier", stop_after_first = true },
svelte = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
typescript = { "eslint_d", "prettierd", "prettier", stop_after_first = true },
typescriptreact = { "eslint_d", "eslint", "prettierd", "prettier", stop_after_first = true },
-- yaml = { "prettierd", "prettier", stop_after_first = true },
},
})

View File

@@ -1,8 +1,12 @@
local gitsigns = require("gitsigns")
gitsigns.setup({
current_line_blame_opts = { delay = 0 },
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 = "?" })

View File

@@ -0,0 +1 @@
require("kitty-scrollback").setup()

View File

@@ -1,7 +1,5 @@
require("neodev").setup() -- should setup before lspconfig
local lspconfig = require("lspconfig")
-- vim.g.coq_settings = { auto_start = 'shut-up' }
-- local capabilities = coq.lsp_ensure_capabilities()
@@ -34,8 +32,40 @@ 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 = {},
nixd = {},
pyright = {},
-- tsserver = {},
svelte = {
@@ -103,9 +133,11 @@ local servers = {
for server, config in pairs(servers) do
config.capabilities = capabilities
lspconfig[server].setup(config)
vim.lsp.config(server, config)
end
vim.lsp.enable(vim.tbl_keys(servers))
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(e)
local opts = { buffer = e.bufnr }

View File

@@ -1,3 +1,5 @@
vim.cmd([[
" Paste clipboard images
au FileType pandoc nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
au FileType markdown nmap <buffer><silent> <leader>v :call mdip#MarkdownClipboardImage()<CR>
]])

View File

@@ -63,6 +63,7 @@ cmp.setup({
}),
sources = {
{ name = "copilot", group_index = 2 },
{ name = "zk" },
{ name = "nvim_lsp", keyword_length = 8 },
{ name = "luasnip", max_item_count = 16 },
{ name = "path" },

View File

@@ -1,3 +1,5 @@
vim.env.ESLINT_D_PPID = vim.fn.getpid()
local eslint_linter = "eslint_d"
require("lint").linters_by_ft = {

View File

@@ -1,3 +1,5 @@
vim.cmd([[
nmap s <Nop>
xmap s <Nop>
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
]])

View File

@@ -1,6 +1,8 @@
vim.cmd([[
let g:javascript_plugin_jsdoc = 1 " jsdoc syntax highlighting
let g:javascript_plugin_flow = 1 " flow syntax highlighting
let g:javascript_conceal_function = "ƒ"
let g:javascript_conceal_return = ""
let g:svelte_indent_script = 0
let g:svelte_indent_style = 0
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
let g:pandoc#syntax#conceal#urls=1
let g:pandoc#syntax#codeblocks#embeds#langs=[
\ '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#conceal#cchar_overrides = { "atx": " ", "li": "·" }
let g:pandoc#syntax#conceal#blacklist=[]
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
au FileType pandoc call pandoc#completion#Init()
let g:pandoc#filetypes#pandoc_markdown=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#textwidth=90
let g:pandoc#modules#disabled = ["formatting", "dashes", "yaml", "metadata"]
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
" Tidalcycles (sclang and vim-tidal)
let g:tidal_default_config = {"socket_name": "default", "target_pane": "tidal:1.1"}
let g:tidal_no_mappings = 1
@@ -12,3 +13,4 @@ au FileType tidal com! -nargs=0 H :TidalHush
" SuperCollider
au BufEnter,BufWinEnter,BufNewFile,BufRead *.sc,*.scd se filetype=supercollider
au Filetype supercollider packadd scvim
]])

View File

@@ -1,4 +1,6 @@
vim.cmd([[
let g:vimtex_view_method='zathura'
let g:tex_flavor='latex'
let g:tex_conceal='abdmgs'
let g:vimtex_quickfix_mode=0
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
" Change local buffer to directory of current file after the plugin has loaded
autocmd VimEnter * lcd %:p:h
@@ -106,3 +107,4 @@ let g:wiki_write_on_nav=1
let g:wiki_zotero_root='~/.local/share/zotero'
" ... mappings and commands
" ...
]])

View File

@@ -1,5 +1,7 @@
vim.cmd([[
syn match Todo /TODO/
syn match Todo /FIXME/
syn match Todo /FIX/
syn match Todo /QUESTION/
syn match Todo /NOTE/
]])

View 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")

View File

@@ -1,5 +1,7 @@
vim.cmd([[
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")

View File

@@ -1,3 +1,4 @@
vim.cmd([[
syntax keyword Statement define 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 psi conceal cchar=ψ
syn keyword Operator omega conceal cchar=ω
]])
:runtime! syntax/_comment_keywords.vim
vim.cmd.runtime("syntax/_comment_keywords.lua")

View File

@@ -2,11 +2,11 @@
"nodes": {
"nixCats": {
"locked": {
"lastModified": 1759730664,
"narHash": "sha256-boRlBQ/c4CaHsK/z04QL6+t81mcar37Io94HBX2GflY=",
"lastModified": 1763330129,
"narHash": "sha256-KbOeWIF52SV53BOeETGO2C5ewaV2Ex9iaXH7G72gOr8=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "77dffad8235eb77684fcb7599487c8e9f23d5b8f",
"rev": "c81551ed87db2aefab30a12cf7425ff94dc0ad64",
"type": "github"
},
"original": {
@@ -17,11 +17,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1760256791,
"narHash": "sha256-uTpzDHRASEDeFUuToWSQ46Re8beXyG9dx4W36FQa0/c=",
"lastModified": 1763464769,
"narHash": "sha256-AJHrsT7VoeQzErpBRlLJM1SODcaayp0joAoEA35yiwM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "832e3b6db48508ae436c2c7bfc0cf914eac6938e",
"rev": "6f374686605df381de8541c072038472a5ea2e2d",
"type": "github"
},
"original": {
@@ -66,11 +66,11 @@
"plugins-helm-ls-nvim": {
"flake": false,
"locked": {
"lastModified": 1757598429,
"narHash": "sha256-nzuJxAAaEmuVYg9k0B8OKslxsihhg6RKlhz6E7xJTQU=",
"lastModified": 1761915179,
"narHash": "sha256-W9NRa84l5Cs62OsDeqb+LMxk8oYjhVBCB3o3UmE9a0I=",
"owner": "qvalentin",
"repo": "helm-ls.nvim",
"rev": "f36ecbd3e7b0b2ac8358a9d6a3213888e29943db",
"rev": "d6f3a8d4ad59b4f54cd734267dfb5411679ea608",
"type": "github"
},
"original": {

View File

@@ -59,12 +59,48 @@
{
lspsAndRuntimeDeps = with pkgs; {
general = [
black
clang
clang-tools
gawk
gdtoolkit_4
isort
tree-sitter
ormolu
nodePackages.prettier
nixd
nixfmt
prettierd
shellcheck-minimal
stylua
vscode-langservers-extracted
];
};
startupPlugins = {
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
fzf-lua
ltex_extra-nvim
@@ -107,6 +143,7 @@
copilot-lua
copilot-cmp
pkgs.neovimPlugins.helm-ls-nvim
pkgs.vimPlugins.kitty-scrollback-nvim
];
};

View File

@@ -0,0 +1 @@
vim.opt.matchpairs:append("=:;")

View File

@@ -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, {})

View File

@@ -1,3 +1,4 @@
vim.cmd([[
" Anki helper functions
" 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 AnkiRemoveSelectedClozes :%s/\%V{{c\d\+:://ge | :%s/\%V}}//ge | :%s/\%VSTART\nCloze\n//ge | :%s/\%VEND\n//ge
]])

View File

@@ -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 cocu=""
func! GetContext()
@@ -17,3 +34,4 @@ func! GetContext()
endif
endfunc
com! -nargs=0 GetContext :call GetContext()
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
"
" Source: https://wiki.call-cc.org/vim / Jonathan Palardy
"
@@ -23,3 +24,4 @@ fun! Scheme_eval_defun()
call Scheme_send_sexp(@")
call setpos('.', pos)
endfun
]])

View File

@@ -1,12 +1,28 @@
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("plug")
require("pandoc")
require("keymaps")
require("highlight")
require("paq-setup")
require("statusline")
require("diagnostic")
require("utils")
require("zk")
require("reload")
require("paq-setup") -- when not on nixCats
-- vim.opt.background = "dark"
-- vim.opt.laststatus = 3
vim.opt.background = "dark"
vim.opt.laststatus = 3

View File

@@ -1,7 +1,5 @@
" General config {{{
"
vim.cmd([[
" Tip: acronyms for overview, use `:h` for a quick lookup.
set nocp " Disable vi incompatibility
filetype plugin indent on " Filetype recognition
set enc=utf8 " Default to UTF-8 encoding
@@ -28,6 +26,5 @@ set lcs=trail:·,tab:→\ ,nbsp:␣ " Whitespace rendering
set ar " Autoread
set spellsuggest+=5 " Limit spell suggestions
set wildignore+=*/node_modules/*,*/tmp/*,*.so,*.swp,*.zip
set thesaurus+=~/.vim/thesaurus/mthesaur.txt
" }}}
" set thesaurus+=./thesaurus/mthesaur.txt " FIXME
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
" Taken from /usr/share/vim/vim90/defaults.vim
augroup vimStartup
au!
@@ -12,3 +13,4 @@ augroup vimStartup
\ | endif
augroup END
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
" Folds {{{
set foldmethod=marker
@@ -22,3 +23,4 @@ augroup filetype_snippets
augroup END
" }}}
]])

View File

@@ -7,5 +7,7 @@ vim.filetype.add({
[".*/%.vscode/.*%.json"] = "jsonc",
[".*/%.ssh/config%.d/.*"] = "sshconfig",
["%.env.*"] = "dotenv",
["%.pl$"] = "prolog",
[".*.containerfile.*"] = "dockerfile",
},
})

View File

@@ -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
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })

View File

@@ -1,3 +1,5 @@
vim.cmd([[
let g:netrw_winsize = 30
let g:netrw_liststyle=3
let g:netrw_banner = 0
]])

View File

@@ -1,3 +1,4 @@
vim.cmd([[
fu! Compile()
if expand('%:e') == "md"
:silent exec "!pandoc % -s -o /tmp/op.pdf &"
@@ -8,3 +9,4 @@ fu! Preview()
:call Compile()
:silent exec "!zathura /tmp/op.pdf &"
endfu
]])

View File

@@ -42,4 +42,5 @@ require("nixCatsUtils.catPacker").setup({
{ "zbirenbaum/copilot.lua" },
{ "zbirenbaum/copilot-cmp" },
{ "qvalentin/helm-ls.nvim", ft = "helm" },
{ "mikesmithgh/kitty-scrollback.nvim" },
})

View 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

View File

@@ -1,5 +1,7 @@
vim.cmd([[
augroup Vim
au!
" Reload vim config when ~/.vimrc is changed
au BufWritePost $HOME/.vimrc so $MYVIMRC | redraw | echo "Reloaded vimrc"
augroup END
]])

View 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",
})

View File

@@ -1,3 +1,4 @@
vim.cmd([[
se ls=2
se stl=\ %0*%n
se stl+=\ %m
@@ -5,3 +6,4 @@ se stl+=\ %y%0*
se stl+=\ %<%F
se stl+=\ %0*%=%5l%*
se stl+=%0*/%L%*
]])

View File

@@ -1,6 +1,8 @@
vim.cmd([[
function! SynGroup()
let l:s = synID(line('.'), col('.'), 1)
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
endfun
com! -nargs=0 Syn :call SynGroup()
]])

View File

@@ -1,5 +0,0 @@
vim.cmd([[
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc"
]])

View 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)

View File

@@ -1,3 +1,6 @@
require("zk.cmp")
vim.cmd([[
let s:zk_preview_enabled = 0
let s:live_server_job = -1
au BufEnter /home/h/.zk/*.md silent exe '!echo "%" > /home/h/.zk/current-zettel.txt'
@@ -18,3 +21,4 @@ endfunction
command! ToggleZKPreview call ToggleZKPreview()
nn <leader>o :ToggleZKPreview<cr> :!xdg-open http://localhost:8080/%:t:r.html & <cr>
]])

View File

@@ -0,0 +1,10 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs =
{ self, nixpkgs }:
{
};
}

View File

@@ -0,0 +1,4 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell { nativeBuildInputs = with pkgs.buildPackages; [ ]; }

View File

@@ -27,7 +27,7 @@ return {
t("flex-wrap: wrap;"),
i(0),
}),
s({ trig = "dfc", dscr = "Display flex column" }, {
s({ trig = "dfc", dscr = "Add 'flex-direction: column;'" }, {
t("display: flex;"),
t("flex-direction: column;"),
i(0),

View 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" }),
}),
}

View File

@@ -5,6 +5,905 @@ local d = ls.dynamic_node
local sn = ls.snippet_node
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
local get_visual = function(_, parent)
if #parent.snippet.env.LS_SELECT_RAW > 0 then

View 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("))"),
}),
}

View 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("}")),
})

View 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>"),
}),
}

View File

@@ -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/aliases
include ./taskrc.d/sync
include ./taskrc.d/urgency
include ./taskrc.d/reports
include ./taskrc.d/contexts
@@ -16,3 +11,5 @@ search.case.sensitive=no
rc.json.array=on
rc.verbose=nothing
news.version=3.1.0
recurrence=off

View File

@@ -1 +1,4 @@
recurrence=off
include /usr/share/doc/task/rc/light-256.theme
include ./locations
include ./sync

View File

@@ -0,0 +1,2 @@
data.location=$XDG_DATA_HOME/task/
hooks.location=$XDG_DATA_HOME/task/hooks

View File

@@ -1 +0,0 @@
recurrence=off

View File

@@ -0,0 +1 @@
enabled=False

View File

@@ -1,9 +1,11 @@
[include]
path = ~/.gitconfig.email
[core]
editor = nvim
excludesfile = ~/.gitignore
[user]
email = hektor.misplon@pm.me
name = Hektor Misplon
username = hektor
signingKey = AEB98353B8D72E465C4236435151AF79E723F21C
@@ -21,6 +23,8 @@
sv = status --verbose
co = checkout
cob = checkout -b
pullr = "pull --rebase --autostash"
pushf = "push --force-with-lease"
# Note these follow the naming convention of my `.bash_aliases`
al = "!git config -l | grep alias | cut -c 7-"
alf = "!git config -l | grep alias | cut -c 7- | fzf"
@@ -74,8 +78,6 @@
[merge]
tool = nvimdiff
conflictstyle = diff3
[pull]
rebase = true
[diff]
colorMoved = zebra
[commit]
@@ -83,3 +85,11 @@
[interactive]
singleKey = true
[pull]
rebase = true
[rerere]
enabled = true
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig.work

View File

@@ -0,0 +1,2 @@
[user]
email = your.email@example.com

13
dots/.gitconfig.work Normal file
View 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

View File

@@ -0,0 +1,2 @@
[user]
email = your.work.email@example.com

2
dots/.gitignore vendored
View File

@@ -9,6 +9,7 @@ log/
# Node
npm-debug.log
node_modules
.npm-cache
# Python
*.pyc
@@ -68,6 +69,7 @@ Thumbs.db
# Kernel Module Compile Results
*.mod*
!*.mod*.*
*.cmd
.tmp_versions/
modules.order

View File

@@ -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

View File

@@ -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

View File

@@ -1,210 +0,0 @@
" YinYang - black/white color scheme
if (&background ==# "dark" && get(g:, "colors_name", "") ==# "yang")
runtime! colors/yin.vim
finish
endif
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "yang"
let s:palette = {}
let s:palette.white = [254, '#f7f7f7']
let s:palette.gray15 = [253, '#e4e4e4']
let s:palette.gray14 = [250, '#bcbcbc']
let s:palette.gray13 = [249, '#b2b2b2']
let s:palette.gray12 = [248, '#a8a8a8']
let s:palette.gray11 = [247, '#9e9e9e']
let s:palette.gray10 = [246, '#949494']
let s:palette.gray09 = [245, '#8a8a8a']
let s:palette.gray08 = [244, '#808080']
let s:palette.gray07 = [243, '#767676']
let s:palette.gray06 = [242, '#666666']
let s:palette.gray05 = [241, '#606060']
let s:palette.gray04 = [240, '#585858']
let s:palette.gray03 = [239, '#4e4e4e']
let s:palette.gray02 = [238, '#444444']
let s:palette.gray01 = [235, '#262626']
let s:palette.black = [233, '#121212']
let s:palette.purple = [98, '#875fd7']
let s:palette.brown = [130, '#af5f00']
let s:palette.blue = [67, '#5f87af']
let s:palette.darkblue = [27, '#005fff']
let s:palette.green = [65, '#5f875f']
let s:palette.red = [88, '#870000']
let s:palette.orange = [166, '#5f5fd7']
if has("nvim")
let g:terminal_color_0 = s:palette.gray01[1]
let g:terminal_color_1 = s:palette.gray06[1]
let g:terminal_color_2 = s:palette.gray03[1]
let g:terminal_color_3 = s:palette.gray11[1]
let g:terminal_color_4 = s:palette.gray02[1]
let g:terminal_color_5 = s:palette.gray08[1]
let g:terminal_color_6 = s:palette.gray09[1]
let g:terminal_color_7 = s:palette.gray13[1]
let g:terminal_color_8 = s:palette.gray03[1]
let g:terminal_color_9 = s:palette.gray10[1]
let g:terminal_color_10 = s:palette.gray07[1]
let g:terminal_color_11 = s:palette.gray13[1]
let g:terminal_color_12 = s:palette.gray05[1]
let g:terminal_color_13 = s:palette.gray12[1]
let g:terminal_color_14 = s:palette.gray14[1]
let g:terminal_color_15 = s:palette.white[1]
elseif has("terminal")
let g:terminal_ansi_colors = [
\ s:palette.gray01[1],
\ s:palette.gray06[1],
\ s:palette.gray03[1],
\ s:palette.gray11[1],
\ s:palette.gray02[1],
\ s:palette.gray08[1],
\ s:palette.gray09[1],
\ s:palette.gray13[1],
\ s:palette.gray03[1],
\ s:palette.gray10[1],
\ s:palette.gray07[1],
\ s:palette.gray13[1],
\ s:palette.gray05[1],
\ s:palette.gray12[1],
\ s:palette.gray14[1],
\ s:palette.white[1]
\ ]
endif
function! s:hi(group, fg_color, bg_color, style)
let highlight_command = ['hi', a:group]
if !empty(a:fg_color)
let [ctermfg, guifg] = a:fg_color
call add(highlight_command, printf('ctermfg=%d guifg=%s', ctermfg, guifg))
endif
if !empty(a:bg_color)
let [ctermbg, guibg] = a:bg_color
call add(highlight_command, printf('ctermbg=%d guibg=%s', ctermbg, guibg))
endif
if !empty(a:style)
call add(highlight_command, printf('cterm=%s gui=%s', a:style, a:style))
endif
execute join(highlight_command, ' ')
endfunction
call s:hi('Normal', s:palette.gray05, s:palette.white, '')
set background=light
call s:hi('Constant', s:palette.gray11, [], 'bold')
call s:hi('String', s:palette.gray08, [], '')
call s:hi('Number', s:palette.gray10, [], '')
call s:hi('Identifier', s:palette.gray06, [], 'none')
call s:hi('Function', s:palette.gray06, [], '')
call s:hi('Statement', s:palette.gray08, [], 'bold')
call s:hi('Operator', s:palette.gray03, [], 'none')
call s:hi('Keyword', s:palette.gray10, [], '')
call s:hi('PreProc', s:palette.gray10, [], 'none')
call s:hi('Type', s:palette.gray09, [], 'bold')
call s:hi('Special', s:palette.gray10, [], '')
call s:hi('SpecialComment', s:palette.gray12, [], 'bold')
call s:hi('Title', s:palette.gray10, [], 'bold')
call s:hi('Todo', s:palette.purple, s:palette.white, '')
if has("nvim") || has("gui_running")
call s:hi('Comment', s:palette.gray12, [], 'italic')
else
call s:hi('Comment', s:palette.gray12, [], '')
endif
call s:hi('LineNr', s:palette.gray13, s:palette.gray15, 'none')
call s:hi('FoldColumn', s:palette.gray08, s:palette.gray15, 'none')
call s:hi('CursorLine', [], s:palette.gray15, 'none')
call s:hi('CursorLineNr', s:palette.gray06, s:palette.gray15, 'none')
call s:hi('Visual', s:palette.white, s:palette.gray06, '')
call s:hi('Search', s:palette.gray15, s:palette.gray03, 'none')
call s:hi('IncSearch', s:palette.white, s:palette.gray11, 'bold')
call s:hi('SpellBad', s:palette.red, s:palette.white, 'undercurl')
call s:hi('SpellCap', s:palette.red, s:palette.white, 'undercurl')
call s:hi('SpellLocal', s:palette.red, s:palette.white, 'undercurl')
call s:hi('SpellRare', s:palette.brown, s:palette.white, 'undercurl')
call s:hi('Error', s:palette.red, s:palette.white, 'bold')
call s:hi('ErrorMsg', s:palette.red, s:palette.white, '')
call s:hi('WarningMsg', s:palette.brown, s:palette.white, '')
call s:hi('ModeMsg', s:palette.gray10, [], '')
call s:hi('MoreMsg', s:palette.gray10, [], '')
call s:hi('MatchParen', s:palette.orange, s:palette.white, '')
call s:hi('Cursor', [], s:palette.gray12, '')
call s:hi('Underlined', s:palette.gray08, [], 'underline')
call s:hi('SpecialKey', s:palette.gray13, [], '')
call s:hi('NonText', s:palette.gray13, [], '')
call s:hi('Directory', s:palette.gray08, [], '')
call s:hi('Pmenu', s:palette.gray05, s:palette.gray14, 'none')
call s:hi('PmenuSbar', s:palette.white, s:palette.gray01, 'none')
call s:hi('PmenuSel', s:palette.gray14, s:palette.gray05, '')
call s:hi('PmenuThumb', s:palette.gray14, s:palette.gray03, 'none')
call s:hi('StatusLine', s:palette.gray03, s:palette.gray13, 'none')
call s:hi('StatusLineNC', s:palette.gray13, s:palette.gray15, 'none')
call s:hi('WildMenu', s:palette.gray08, [], '')
call s:hi('VertSplit', s:palette.gray13, s:palette.white, 'none')
call s:hi('DiffAdd', s:palette.white, s:palette.green, '')
call s:hi('DiffChange', s:palette.white, s:palette.blue, '')
call s:hi('DiffDelete', s:palette.white, s:palette.red, '')
call s:hi('DiffText', s:palette.white, s:palette.darkblue, '')
call s:hi('DiffAdded', s:palette.green, s:palette.white, '')
call s:hi('DiffChanged', s:palette.blue, s:palette.white, '')
call s:hi('DiffRemoved', s:palette.red, s:palette.white, '')
highlight! link Character Constant
highlight! link Float Number
highlight! link Boolean Number
highlight! link SignColumn FoldColumn
highlight! link ColorColumn FoldColumn
highlight! link CursorColumn CursorLine
highlight! link Folded LineNr
highlight! link Conceal Normal
highlight! link ErrorMsg Error
highlight! link Conditional Statement
highlight! link Repeat Statement
highlight! link Label Statement
highlight! link Exception Statement
highlight! link Include PreProc
highlight! link Define PreProc
highlight! link Macro PreProc
highlight! link PreCondit PreProc
highlight! link StorageClass Type
highlight! link Structure Type
highlight! link Typedef Type
highlight! link SpecialChar Special
highlight! link Tag Special
highlight! link Delimiter Special
highlight! link Debug Special
highlight! link Question Special
highlight! link VisualNOS Visual
highlight! link TabLine StatusLineNC
highlight! link TabLineFill StatusLineNC
highlight! link TabLineSel StatusLine

View File

@@ -1,212 +0,0 @@
" YinYang - black/white color scheme
if (&background ==# "light" && get(g:, "colors_name", "") ==# "yin")
runtime! colors/yang.vim
finish
endif
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "yin"
let s:palette = {}
let s:palette.blackest = [0, '#0c0c0c']
let s:palette.black = [233, '#111111']
let s:palette.gray01 = [235, '#1e1e1e']
let s:palette.gray02 = [238, '#444444']
let s:palette.gray03 = [239, '#4e4e4e']
let s:palette.gray04 = [240, '#585858']
let s:palette.gray05 = [242, '#666666']
let s:palette.gray06 = [243, '#767676']
let s:palette.gray07 = [244, '#808080']
let s:palette.gray08 = [245, '#8a8a8a']
let s:palette.gray09 = [246, '#949494']
let s:palette.gray10 = [247, '#9e9e9e']
let s:palette.gray11 = [248, '#a8a8a8']
let s:palette.gray12 = [249, '#b2b2b2']
let s:palette.gray13 = [250, '#bcbcbc']
let s:palette.gray14 = [251, '#c6c6c6']
let s:palette.gray15 = [254, '#e4e4e4']
let s:palette.white = [255, '#eeeeee']
let s:palette.comments = copy(s:palette.gray03)
let s:palette.purple = [62, '#5f5fd7']
let s:palette.brown = [94, '#875f00']
let s:palette.blue = [24, '#005f87']
let s:palette.lightblue = [31, '#00afff']
let s:palette.green = [29, '#00875f']
let s:palette.red = [88, '#870000']
let s:palette.orange = [166, '#5f5fd7']
if has("nvim")
let g:terminal_color_0 = s:palette.gray01[1]
let g:terminal_color_1 = s:palette.gray06[1]
let g:terminal_color_2 = s:palette.gray03[1]
let g:terminal_color_3 = s:palette.gray11[1]
let g:terminal_color_4 = s:palette.gray02[1]
let g:terminal_color_5 = s:palette.gray08[1]
let g:terminal_color_6 = s:palette.gray09[1]
let g:terminal_color_7 = s:palette.gray13[1]
let g:terminal_color_8 = s:palette.gray03[1]
let g:terminal_color_9 = s:palette.gray10[1]
let g:terminal_color_10 = s:palette.gray07[1]
let g:terminal_color_11 = s:palette.gray15[1]
let g:terminal_color_12 = s:palette.gray05[1]
let g:terminal_color_13 = s:palette.gray12[1]
let g:terminal_color_14 = s:palette.gray14[1]
let g:terminal_color_15 = s:palette.white[1]
elseif has("terminal")
let g:terminal_ansi_colors = [
\ s:palette.gray01[1],
\ s:palette.gray06[1],
\ s:palette.gray03[1],
\ s:palette.gray11[1],
\ s:palette.gray02[1],
\ s:palette.gray08[1],
\ s:palette.gray09[1],
\ s:palette.gray13[1],
\ s:palette.gray03[1],
\ s:palette.gray10[1],
\ s:palette.gray07[1],
\ s:palette.gray15[1],
\ s:palette.gray05[1],
\ s:palette.gray12[1],
\ s:palette.gray14[1],
\ s:palette.white[1]
\ ]
endif
function! s:hi(group, fg_color, bg_color, style)
let highlight_command = ['hi', a:group]
if !empty(a:fg_color)
let [ctermfg, guifg] = a:fg_color
call add(highlight_command, printf('ctermfg=%d guifg=%s', ctermfg, guifg))
endif
if !empty(a:bg_color)
let [ctermbg, guibg] = a:bg_color
call add(highlight_command, printf('ctermbg=%d guibg=%s', ctermbg, guibg))
endif
if !empty(a:style)
call add(highlight_command, printf('cterm=%s gui=%s', a:style, a:style))
endif
execute join(highlight_command, ' ')
endfunction
call s:hi('Normal', s:palette.gray11, s:palette.black, '')
set background=dark
call s:hi('Constant', s:palette.gray05, [], 'bold')
call s:hi('String', s:palette.gray10, [], '')
call s:hi('Number', s:palette.gray06, [], '')
call s:hi('Identifier', s:palette.gray08, [], 'none')
call s:hi('Function', s:palette.gray08, [], '')
call s:hi('Statement', s:palette.gray05, [], 'bold')
call s:hi('Operator', s:palette.gray05, [], 'none')
call s:hi('Keyword', s:palette.gray05, [], '')
call s:hi('PreProc', s:palette.gray07, [], 'none')
call s:hi('Type', s:palette.gray05, [], 'bold')
call s:hi('Special', s:palette.gray05, [], '')
call s:hi('SpecialComment', s:palette.comments, [], 'bold')
call s:hi('Title', s:palette.gray07, [], 'bold')
call s:hi('Todo', s:palette.purple, s:palette.black, '')
if has("nvim") || has("gui_running")
call s:hi('Comment', s:palette.comments, [], 'italic')
else
call s:hi('Comment', s:palette.comments, [], '')
endif
call s:hi('LineNr', s:palette.gray02, s:palette.black, 'none')
call s:hi('FoldColumn', s:palette.gray07, s:palette.gray01, 'none')
call s:hi('CursorLine', [], s:palette.gray01, 'none')
call s:hi('CursorLineNr', s:palette.gray14, s:palette.gray01, 'none')
call s:hi('Visual', s:palette.black, s:palette.gray06, '')
call s:hi('Search', s:palette.gray01, s:palette.gray11, 'none')
call s:hi('IncSearch', s:palette.black, s:palette.gray07, 'bold')
call s:hi('SpellBad', s:palette.red, s:palette.black, 'undercurl')
call s:hi('SpellCap', s:palette.red, s:palette.black, 'undercurl')
call s:hi('SpellLocal', s:palette.red, s:palette.black, 'undercurl')
call s:hi('SpellRare', s:palette.brown, s:palette.black, 'undercurl')
call s:hi('Error', s:palette.red, s:palette.black, 'bold')
call s:hi('ErrorMsg', s:palette.red, s:palette.black, '')
call s:hi('WarningMsg', s:palette.brown, s:palette.black, '')
call s:hi('ModeMsg', s:palette.gray10, [], '')
call s:hi('MoreMsg', s:palette.gray10, [], '')
call s:hi('MatchParen', s:palette.orange, s:palette.black, '')
call s:hi('Cursor', [], s:palette.gray12, '')
call s:hi('Underlined', s:palette.gray08, [], 'underline')
call s:hi('SpecialKey', s:palette.gray04, [], '')
call s:hi('NonText', s:palette.gray04, [], '')
call s:hi('Directory', s:palette.gray08, [], '')
call s:hi('Pmenu', s:palette.gray10, s:palette.gray03, 'none')
call s:hi('PmenuSbar', s:palette.black, s:palette.gray15, 'none')
call s:hi('PmenuSel', s:palette.gray03, s:palette.gray10, '')
call s:hi('PmenuThumb', s:palette.gray03, s:palette.gray09, 'none')
call s:hi('StatusLine', s:palette.gray12, s:palette.gray01, 'none')
call s:hi('StatusLineNC', s:palette.black, s:palette.black, 'none')
call s:hi('WildMenu', s:palette.gray08, [], '')
call s:hi('VertSplit', s:palette.gray03, s:palette.black, 'none')
call s:hi('DiffAdd', s:palette.blackest, s:palette.green, '')
call s:hi('DiffChange', s:palette.blackest, s:palette.blue, '')
call s:hi('DiffDelete', s:palette.blackest, s:palette.red, '')
call s:hi('DiffText', s:palette.black, s:palette.lightblue, '')
call s:hi('DiffAdded', s:palette.green, s:palette.black, '')
call s:hi('DiffChanged', s:palette.blue, s:palette.black, '')
call s:hi('DiffRemoved', s:palette.red, s:palette.black, '')
highlight! link Character Constant
highlight! link Float Number
highlight! link Boolean Number
highlight! link SignColumn FoldColumn
highlight! link ColorColumn FoldColumn
highlight! link CursorColumn CursorLine
highlight! link Folded LineNr
highlight! link Conceal Normal
highlight! link ErrorMsg Error
highlight! link Conditional Statement
highlight! link Repeat Statement
highlight! link Label Statement
highlight! link Exception Statement
highlight! link Include PreProc
highlight! link Define PreProc
highlight! link Macro PreProc
highlight! link PreCondit PreProc
highlight! link StorageClass Type
highlight! link Structure Type
highlight! link Typedef Type
highlight! link SpecialChar Special
highlight! link Tag Special
highlight! link Delimiter Special
highlight! link Debug Special
highlight! link Question Special
highlight! link VisualNOS Visual
highlight! link TabLine StatusLineNC
highlight! link TabLineFill StatusLineNC
highlight! link TabLineSel StatusLine

View File

@@ -1 +0,0 @@
autocmd BufNewFile,BufReadPost *.pl set filetype=prolog

View File

@@ -1 +0,0 @@
set mps+==:;

View File

@@ -1,3 +0,0 @@
set termguicolors
set bg=light
hi Normal ctermbg=none guibg=NONE

View File

@@ -1,44 +0,0 @@
" 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>

View File

@@ -1,34 +0,0 @@
" Plugins {{{
" Plug setup {{{
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'
Plug 'hektor/taskwiki'
" 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'
call plug#end()
" }}}

View File

@@ -1,7 +0,0 @@
snippet fne "Filename (+extension)" i
`!p snip.rv = snip.fn`
endsnippet
# snippet ^fn "Filename basename" ir
# `!p snip.rv = snip.basename`
endsnippet

View File

@@ -1,72 +0,0 @@
snippet b1(\w+) "Border (1px)" r
`!p
import re
colors = {
'r': 'red',
'g': 'green',
'b': 'blue',
'y': 'yellow',
'o': 'orange',
'p': 'purple',
'c': 'cyan',
'm': 'magenta',
'w': 'white',
}
color = colors.get(match.group(1), 'black')
snip.rv = f"border: 1px solid {color};"
`$0
endsnippet
snippet df "Use flexbox layout"
display: flex;
$0
endsnippet
snippet fr "Use row direction (flex)"
flex-direction: row;
$0
endsnippet
snippet fc "Use column direction (flex)"
flex-direction: column;
$0
endsnippet
snippet dfr "Use flexbox layout in row direction"
display: flex;
flex-direction: row;
$0
endsnippet
snippet dfr "Use flexbox layout in column direction"
display: flex;
flex-direction: column;
$0
endsnippet
snippet dg "Use CSS grid layout"
display: grid;
$0
endsnippet
snippet db "Use block layout"
display: block;
$0
endsnippet
snippet dn "Set display to 'none'"
display: none;
$0
endsnippet
snippet var "Use CSS variable"
var(--$1)$0
endsnippet
snippet m
margin: $0;
endsnippet
snippet p
padding: $0;
endsnippet

View File

@@ -1,51 +0,0 @@
snippet ifdef
#ifdef GL_ES
precision mediump float;
#endif
endsnippet
snippet defpi
#define PI 3.14159265359
endsnippet
snippet main
void main() {
$1
}
endsnippet
snippet uni
uniform $1;
endsnippet
snippet unif
uniform float $1;
endsnippet
snippet univ
uniform vec$1 float $2;
endsnippet
snippet univ2
uniform vec2 float $1;
endsnippet
snippet univ3
uniform vec3 float $1;
endsnippet
snippet univ4
uniform vec4 float $1;
endsnippet
snippet f
float
endsnippet
snippet v
vec
endsnippet
snippet ss
smoothstep($1)$2
endsnippet

View File

@@ -1,11 +0,0 @@
snippet clg "console.log"
console.log($0)
endsnippet
snippet Js "JSON.stringify"
JSON.stringify($0)
endsnippet
snippet Jsf "JSON.stringify (formatted)"
JSON.stringify($0, 0, 2)
endsnippet

View File

@@ -1,900 +0,0 @@
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 task "Task" i
* [ ] $1 -- pro:$2
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

View File

@@ -1,20 +0,0 @@
snippet reqtrace "(#%require racket/trace)" b
(#%require racket/trace)
endsnippet
snippet strln "(string-length <string>)" b
(string-length $0)
endsnippet
snippet impb "Import rnrs base libraries" b
(import (rnrs base (6))
(rnrs io simple)$0)
endsnippet
snippet def "(define <name> <variable>)" b
(define $0 $1)
endsnippet
snippet defp "(define (<procedure-name> <arguments>))" b
(define ($0 $1))
endsnippet

View File

@@ -1,19 +0,0 @@
extends html, javascript, css
snippet oM
onMount(() => $0)
endsnippet
snippet oD
onDestroy(() => $0)
endsnippet
snippet preJsf "JSON.stringify (formatted and wrapped)"
<pre>
{JSON.stringify($0, 0, 2)}
</pre>
endsnippet
snippet :g "Open :global("
:global(
endsnippet

View File

@@ -1,78 +0,0 @@
#
# Inspired by https://castel.dev/post/lecture-notes-1/
#
snippet beg "begin{} / end{}" b
\begin{$1}
$0
\end{$1}
endsnippet
snippet def "begin{definition} / end{definition}" b
\begin{definition}
$0
\end{defintion}
endsnippet
snippet fig "begin{figure} / end{figure}" b
\begin{figure}
$0
\end{figure}
endsnippet
snippet time "Time"
`date +%R`
endsnippet
snippet i
\textit{$0}
endsnippet
snippet b
\textbf{$0}
endsnippet
snippet center
\begin{center}
$0
\end{center}
endsnippet
snippet pac
\usepackage{$0}
endsnippet
snippet foot
\footnote{$0}
endsnippet
# snippet m "Math" wA
# $${1}$`!p
# if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
# snip.rv = ' '
# else:
# snip.rv = ''
# `$2
# endsnippet
snippet dm "Math" wA
\[
$1
\]$0
endsnippet
snippet ch
\chapter{$0}
endsnippet
snippet sec
\section{$0}
endsnippet
snippet ssec
\subsection{$0}
endsnippet
snippet sssec
\subsubsection{$0}
endsnippet

View File

@@ -1,4 +0,0 @@
source ~/.vim/init/base.vim
source ~/.vim/init/mappings.vim
source ~/.vim/init/plugins.vim
source ~/.vim/init/colors.vim

Some files were not shown because too many files have changed in this diff Show More