Problem with sections when using bullets.vim and markdown format
Hi,
I have a strange problem. I use the bullets.vim plugin [1] to handle lists. It works good normally, but when I am in a section title e.g. marked with `#`, and then insert a new line, the symbol `#` is added at the beginning of the new line too. This only seems to happen when I am editing a wiki file. So, to make it more clear:
```markdown
# title <-- cursor here
```
then, after pressing `enter`
```markdown
# title
# <-- cursor here
```
This happens with any level of title, i.e. `##` or `###`. Do you think that this is something with wiki.vim?
My wiki.vim config is the following (using lazy):
```lua
{
"lervag/wiki.vim",
dependencies = {
{ "lervag/wiki-ft.vim" },
{ "nabla" },
},
lazy = true,
cmd = "WikiIndex",
init = function()
-- Root folder
vim.g.wiki_root = "~/Notes"
-- Keymaps
vim.api.nvim_set_keymap("n", "<leader>wst", ":WikiTags<cr>", { desc = "Search tags." })
-- Creation of links
vim.g.wiki_link_creation = {
wiki = {
link_type = "wiki",
url_extension = ".wiki",
url_transform = function(x)
local name
name, _ = string.gsub(string.lower(x), "[ :]", { [" "] = "-", [":"] = "" })
return name
end,
},
}
-- Filetypes
vim.g.wiki_filetypes = { "wiki" }
end,
config = function()
vim.opt.autochdir = true
end,
},
```
[1] https://github.com/bullets-vim/bullets.vim/
关闭于 2025-10-26 4 条评论