Browse code

WIP: refs

Robert Cranston authored on 17/06/2026 16:00:04
Showing 2 changed files

1 1
new file mode 100755
... ...
@@ -0,0 +1,44 @@
1
+#!/bin/sh
2
+set -euC
3
+
4
+cd "$(dirname "$0")"
5
+
6
+## RFCs
7
+# <https://www.rfc-editor.org/series/rfc-download/>
8
+# Roughly 250M.
9
+# The Debian (non-free) packages use the same upstream source but also compress
10
+# the files, which would be nice since Vim handles compressed files
11
+# transparently, but is deemed to fiddly for now. See `update-package.sh` and
12
+# `distribute.sh` at <https://sources.debian.org/src/doc-rfc/latest/debian>.
13
+rsync -avz \
14
+  --include '/rfc[0-9].txt' \
15
+  --include '/rfc[0-9][0-9].txt' \
16
+  --include '/rfc[0-9][0-9][0-9].txt' \
17
+  --include '/rfc[0-9][0-9][0-9][0-9].txt' \
18
+  --include '/rfc[0-9][0-9][0-9][0-9][0-9].txt' \
19
+  --exclude '*' \
20
+  'rsync.rfc-editor.org::rfcs-text-only' \
21
+  'rfc'
22
+
23
+## Khronos
24
+# These are available over HTTP(S) instead of Git, but getting them that way
25
+# runs afoul of anti-bot measures in my experience.
26
+printf '%s\n' \
27
+  'glsl' 'https://github.com/KhronosGroup/GLSL'            '/extensions/*/*' \
28
+  'spv'  'https://github.com/KhronosGroup/SPIRV-Registry'  '/extensions/*/*' \
29
+  'gl'   'https://github.com/KhronosGroup/OpenGL-Registry' '/extensions/*/*' \
30
+  'vk'   'https://github.com/KhronosGroup/Vulkan-Docs'     '/proposals/VK_*' \
31
+| while read name; read url; read pattern;
32
+do
33
+  (
34
+    [ -d "$name" ] || git clone \
35
+      --no-checkout \
36
+      --depth=1 \
37
+      --filter=tree:0 \
38
+      "$url" "$name"
39
+    cd "$name"
40
+    git sparse-checkout init --no-cone
41
+    git sparse-checkout set "$pattern"
42
+    git checkout
43
+  )
44
+done
... ...
@@ -699,6 +699,15 @@ set grepprg=grep\ -nHI " TODO: Local to buffer (or global).
699 699
 """ Quickfix
700 700
 set switchbuf=useopen
701 701
 
702
+""" Path
703
+" Directory of current file, current working directory.
704
+set path=.,,
705
+" See `~/.vim/refs/sync`.
706
+set path-=,
707
+set path+=~/.vim/refs/*/**
708
+set path+=,
709
+set suffixesadd=.txt,.txt.gz,.adoc
710
+
702 711
 "" Mappings
703 712
 " TODO: Categorize into map modes. Use the nonspecific |:map| (|mapmode-nvo|)
704 713
 " and |:map!| (|mapmode-ic|) more often?