aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-12-14 23:10:04 +0000
committerJuan J. Martinez <jjm@usebox.net>2022-12-14 23:10:04 +0000
commite041ad6668b26be0212407588fa285fc639a6453 (patch)
treec0f7c553b3c1c1685da2daa596e97484fc0c9044
parent98bfaa305cc0b081f3fc38232264c6002fd778ec (diff)
downloaddotnvim-e041ad6668b26be0212407588fa285fc639a6453.tar.gz
dotnvim-e041ad6668b26be0212407588fa285fc639a6453.zip
Trying scheme
-rw-r--r--after/ftplugin/scheme.vim28
-rwxr-xr-xgen-scheme-words18
2 files changed, 46 insertions, 0 deletions
diff --git a/after/ftplugin/scheme.vim b/after/ftplugin/scheme.vim
new file mode 100644
index 0000000..197aa08
--- /dev/null
+++ b/after/ftplugin/scheme.vim
@@ -0,0 +1,28 @@
+"" requires:
+""
+"" chicken-install chicken-doc
+"" cd `csi -R chicken.platform -p '(chicken-home)'`
+"" curl https://3e8.org/pub/chicken-doc/chicken-doc-repo-5.tgz | tar zx
+""
+"" then run ../gen-scheme-words
+""
+let b:is_chicken=1
+
+setl complete+=d,k~/.local/share/scheme/words/**
+
+setl include=\^\(\\(use\\\|require-extension\\)\\s\\+
+setl includeexpr=substitute(v:fname,'$','.scm','')
+setl path+=/home/chl/.cache/chicken-install
+setl suffixesadd=.scm
+
+fun! Scheme_indent_top_sexp()
+ let pos = getpos('.')
+ silent! exec 'normal! 99[(=%'
+ call setpos('.', pos)
+endfun
+
+nmap <buffer> <silent> == :call Scheme_indent_top_sexp()<cr>
+nmap <buffer> gs :10 split term://csi -s %<cr>:startinsert<cr>
+
+setl makeprg=csc\ %
+setlocal keywordprg=chicken-doc\ scheme
diff --git a/gen-scheme-words b/gen-scheme-words
new file mode 100755
index 0000000..5f2185e
--- /dev/null
+++ b/gen-scheme-words
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+dir="$HOME/.local/share/scheme/words"
+
+first() { cut -d' ' -f1; }
+
+mkdir -p "$dir"
+
+for n in $(chicken-doc -c chicken | first)
+do
+ chicken-doc -c chicken "$n" | first | tee "$dir/chicken-$n"
+done
+
+for n in $(chicken-doc -c | first)
+do
+ [ "$n" = "chicken" ] || chicken-doc -c "$n" | first | tee "$dir/$n"
+done
+