Guix and Guile from within VIM

2025-05-23 published

Update my VIM config:

nnoremap GL :Repl guile<CR>
nnoremap GG :Repl guix<CR>

and patch the reply.vim:

Subject: [PATCH] Add Guile and Guix REPL

---
 autoload/reply/lifecycle.vim  | 2 +-
 autoload/reply/repl/guile.vim | 3 +++
 autoload/reply/repl/guix.vim  | 9 +++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 autoload/reply/repl/guile.vim
 create mode 100644 autoload/reply/repl/guix.vim

diff --git a/autoload/reply/lifecycle.vim b/autoload/reply/lifecycle.vim
index 3687525..8c97daa 100644
--- a/autoload/reply/lifecycle.vim
+++ b/autoload/reply/lifecycle.vim
@@ -9,7 +9,7 @@ let s:default_repls = {
 \   'haskell': ['ghci'],
 \   'swift': ['swift'],
 \   'lua': ['lua'],
-\   'scheme': ['gauche', 'chibi_scheme', 'mit_scheme'],
+\   'scheme': ['gauche', 'chibi_scheme', 'mit_scheme', 'guile', 'guix'],
 \   'go': ['go_pry'],
 \   'lisp': ['sbcl', 'clisp'],
 \   'c': ['cling_c'],
diff --git a/autoload/reply/repl/guile.vim b/autoload/reply/repl/guile.vim
new file mode 100644
index 0000000..6f72dd9
--- /dev/null
+++ b/autoload/reply/repl/guile.vim
@@ -0,0 +1,3 @@
+function! reply#repl#guile#new() abort
+    return reply#repl#base('guile')
+endfunction
diff --git a/autoload/reply/repl/guix.vim b/autoload/reply/repl/guix.vim
new file mode 100644
index 0000000..3ad83f7
--- /dev/null
+++ b/autoload/reply/repl/guix.vim
@@ -0,0 +1,9 @@
+let s:repl = reply#repl#base('guix')
+
+function! s:repl.get_command() abort
+    return [self.executable(), 'repl']
+endfunction
+
+function! reply#repl#guix#new() abort
+    return deepcopy(s:repl)
+endfunction
--
2.39.5
go back | CC0 1.0