Skip to content

xxmao123/kcl.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-kcl

Neovim KCL Extension

image

⚡️ Requirements

Manually:

Install the kcl-language-server from the binary.

Don't forget to ensure it is in your $PATH

export PATH=$PATH:{install-location}/kclvm/bin
which kcl-language-server

Simply call :MasonInstall kcl to install the kcl-language-server

:MasonInstall kcl

📦 Installation

Install the plugin using your prefered plugin manager such as:

use 'kcl-lang/vim-kcl'
{ "kcl-lang/vim-kcl" },

⚙️ Configuration

❗️ You may want a more advanced configuration to ensure *.k files are bound to ftiletype=kcl

For example (with the lazy plugin manager)

{
	"kcl-lang/vim-kcl",
	init = function()
		vim.api.nvim_command([[autocmd BufRead,BufNewFile *.k set filetype=kcl]])
	end,
	ft = {
		"kcl",
	},
},

🚀 LSP Config

You may want to adjust your lspconfig.. for example:

local util = require("lspconfig.util")

return {
	cmd = { "kcl-language-server" },
	filetypes = { "kcl" },
	root_dir = util.root_pattern(".git"),
}

✨ Features

  • Syntax Highlight
  • Code folding
  • Quick Comment
  • Diagnostics: Warnings and errors in KCL file.

🍭 Commands

Insert mode:

Ctrl+\ Toggle comment.

Normal mode:

zC Close all folds under the cursor recursively.

zO Open all folds under the cursor recursively.

zM Close all folds.

zR Open all folds.

Releases

No releases published

Packages

No packages published

Languages

  • Lua 65.1%
  • Vim Script 34.9%