Use deno repl with conjure
- Add the plugin
-- requires tree sitter, to figure the evaluation scope
use {
'nvim-treesitter/nvim-treesitter',
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
}
use 'Olical/conjure'
use 'sigmaSd/conjure-deno'
-
The plugin will automatically be wired into Conjure.
-
Make sure to have tree sitter enabled, and the correct parsers installed
:TSInstall javascript
:TSInstall typescript
- Open a supported filetype
- Use
<leader>cs
to start the repl - You can now use the repl, if you're unsure about the bindings just run
:ConjureSchool
to learn more
Statements should end with ;
, if you use deno fmt
this is done
automatically (it works even better if you have format on save).
This limitation is on purpose to allow sending multi-lines input to the repl in the constraints of stdio ipc
If you want to use this as a node repl (since its really similar), you need to change the deno command here
conjure-deno/fnl/deno/deno.fnl
Line 24 in 4033725
"node --eval require(\"repl\").start()"
and then compile the plugin.
To hack on this plugin first run make deps
then after each change to the fnl
files run make compile
https://github.com/Vigemus/iron.nvim
local iron = require("iron.core")
iron.setup {
config = {
scratch_repl = true,
repl_definition = {
typescript = {
command = { "deno" },
format = require("iron.fts.common").bracketed_paste
},
},
repl_open_cmd = require("iron.view").split.vertical.botright(50)
},
-- Iron doesn't set keymaps by default anymore.
-- You can set them here or manually add keymaps to the functions in iron.core
keymaps = {
visual_send = "<space>is",
send_file = "<space>if",
send_line = "<space>il",
cr = "<space>i<cr>",
interrupt = "<space>i<space>",
exit = "<space>iq",
clear = "<space>ic",
},
-- If the highlight is on, you can change how it looks
-- For the available options, check nvim_set_hl
highlight = {
italic = true
},
ignore_blank_lines = true, -- ignore blank lines when sending visual select lines
}