Skip to content

RKBethke/k.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k.nvim

A k repl for Neovim.

Features

  • Buffer and visual selection evaluation
  • Customizable output window

Installation

lazy.nvim:

{
	"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 = {},
}

Configuration

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 Highlighting

Syntax, indent, and filetype support for k can be found in the ngn/k repository.

About

A k repl for Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published