kvngvikram / cmp-mkdnflow

nvim-cmp completion source for https://github.com/jakewvincent/mkdnflow.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmp-mkdnflow

A nvim-cmp source for jakewvincent/mkdnflow.nvim. Autocompletion in insert mode when the word you are typing matches any of the .md files in the notebook.

Install using packer.nvim using this entry

use {
	'kvngvikram/cmp-mkdnflow',
	requires = {
		{'jakewvincent/mkdnflow.nvim'},
		{'nvim-lua/plenary.nvim'}
		}
}

Add this sources into the list of sources in your config file.

cmp.setup({
	sources = cmp.config.sources({
		----- Rest of the sources
		----- Rest of the sources
		----- Rest of the sources
		----- Rest of the sources

		{ name = 'mkdnflow' },  -- new source
	}),
})

Also, don't forget to edit your formatting options in cmp.setup.

Possible Issues

  • how does it work with transform_implicit options of links.

Notes

I also use this telescope mapping to jump between different links in notebook

-- Telescope find files in notebook
-- got idea from https://stackoverflow.com/a/73290052
vim.keymap.set('n', '<Leader>k', function()
	if vim.o.filetype == 'markdown' then
		local root_dir = require('mkdnflow').root_dir
		if root_dir then  -- if the dir is not nil
			return ':Telescope find_files search_dirs={"'..root_dir..'"}<CR>'
		end
	end
end, {expr = true, replace_keycodes = true})

About

nvim-cmp completion source for https://github.com/jakewvincent/mkdnflow.nvim


Languages

Language:Lua 100.0%