A k repl for Neovim.
- Buffer and visual selection evaluation
- Customizable output window
{
"RKBethke/k.nvim",
ft = "k",
keys = {
{
"<CR>",
mode = { "n", "x", "o" },
ft = "k",
function()
require("k").eval()
end,
desc = "Evaluate k buffer",
},
{
"<CR>",
mode = { "v" },
ft = "k",
function()
require("k").eval_selection()
end,
desc = "Evaluate selected k lines",
},
{
"<M-L>",
mode = { "i", "n", "x", "o", "v" },
ft = "k",
function()
require("k").outbuf_clear()
end,
desc = "Clear k output buffer",
},
{
"<M-CR>",
mode = { "n", "x", "o", "v" },
ft = "k",
function()
require("k").outbuf_toggle()
end,
desc = "Show/hide the output buffer",
},
},
opts = {},
}
Default Settings
{
-- Path to the k executable.
path = "k",
-- Clear output after every evaluation.
overwrite = false,
outbuf = {
-- Display output in a floating window.
float = false,
-- Map defining the floating window configuration. See `:h nvim_open_win`
-- Values may be functions which are evaluated at window open.
float_opts = {
relative = "editor",
anchor = "NE",
row = 0,
col = function()
return vim.o.columns
end,
width = 64,
height = function()
return vim.fn.winheight(0)
end,
border = "single",
style = "minimal",
},
},
}
Syntax, indent, and filetype support for k can be found in the ngn/k repository.