Example from Quarkdown's collection of mock documents
Quarkdown support for coc.nvim.
- LSP Support: Powered by
quarkdown-lsp(via Quarkdown's CLI) - Completions: Smart completion for keywords and functions.
- Semantic Highlighting: Colouring for function calls, types, and parameters.
- Compilation: Built-in commands to compile and watch Quarkdown files.
- Ensure the
quarkdownCLI is installed and in your$PATH. - Ensure you have coc.nvim installed. Follow their setup instructions.
- Either of the installation methods listed below.
Note: The associated keybinds and LSP takes a while to load after the first installation.
Using :CocInstall directly.
:CocInstall https://github.com/bladeacer/coc-quarkdownUsing your favourite vim/nvim package manager.
For vim-plug.
call plug#begin()
Plug 'bladeacer/coc-quarkdown', {'do': 'npm install && npm run build'}
call plug#end()Installation might sometimes requires a few tries to get through.
Try saving the configuration file, restarting Vim and calling :PlugInstall.
There should be stdout output when building the extension.
For lazy.vim.
{
'bladeacer/coc-quarkdown',
build = 'npm install && npm run build',
ft = { "quarkdown", "qd" }
}This extension registers the following commands:
| Command | Description | Default Keymap (Local) |
|---|---|---|
coc-quarkdown.compile |
Compiles the current file | <leader>mc |
coc-quarkdown.watch |
Starts compiler in watch mode | <leader>mw |
coc-quarkdown.stop |
Stops any active action (compile/watch) | <leader>ms |
Note: Keymaps are buffer-local and only activate for
quarkdownfiletypes.
By default, the extension maps <leader>qc and <leader>qw for you.
If you want to use different keys, you can override the defaults in your
configuration file.
Adapt into to your .vimrc or its equivalent.
" Example: Change the compilation shortcut to F5
autocmd FileType quarkdown nnoremap <buffer> <F5> :CocCommand coc-quarkdown.compile<CR>Adapt into to your init.lua or its equivalent.
vim.api.nvim_create_autocmd("FileType", {
pattern = "quarkdown",
callback = function()
-- Example: Compile on F5
vim.keymap.set("n", "<F5>", ":CocCommand coc-quarkdown.compile<CR>", { buffer = true, silent = true })
end,
})- Pass custom flags (configuration + runtime override) when running compile/watch.
MIT.
- Quarkdown for the LSP implementation and awesome software :D
- Built with create-coc-extension.
