Closed Zethtren closed 1 year ago
It looks like the auto_set_filetype and auto_set_syntax configs may correct this behavior but will it break anything else? I am okay with all markdown files receiving telekasten.
If I set: take_over_home_dir = false, auto_set_filetype = false, auto_set_syntax = true, install_syntax = true,
I think it should handle what I need. (By name I would expect the appropriate behaviors from this and I will let you know if anything unexpected occurs.)
require('telekasten').setup({ home = '/redacted/zettelkasten', -- Put the name of your notes directory here auto_set_filetype = false, take_over_my_home = false, })
I've run it like this and I am still getting filetype=telekasten.
I would like to see syntax injection while maintaining markdown.
But I am unsure how to achieve this.
Was able to get it running using the other plugin with this configuration.
Peek does not support adding alternative filetypes as far as I can tell.
use { "iamcco/markdown-preview.nvim", run = function() vim.fn["mkdp#util#install"]() end, setup = function() vim.g.mkdp_filetypes = { "markdown", "telekasten" } vim.g.mkdp_browser = '/usr/local/bin/chrome' end, ft = { "markdown" }, }
-- Setup didn't seem to declare these so I re-declared them outside of packer as well. But, this seems to work as expected now.
vim.g.mkdp_filetypes = { "markdown", "telekasten" } vim.g.mkdp_browser = '/usr/local/bin/chrome'
Yes, you are right. If the filetype is set to telekasten, peek does not work. I think the whole filetype/syntax stuff could be refactored a bit more. The specific zettelkasten filetype is only really useful for custom snippets that should only be used for notes and not in generic markdown files (such as README.md). I do not think it has an other use.
I see you posted a FR for peek. I'll see how they respond and will decide what to do after that.
Peek.nvim fixed this in PR #15.
You simply have to add the following to your peek.nvim
configuration:
require('peek').setup({
filetype = { 'markdown' , 'telekasten'}
})
Closing this issue as it is resolved.
Please confirm
Is your feature request related to a problem? Please describe. You mention that using peek.nvim alongside is helpful. And I agree I would love to see the live edits as I make them.
However, without any additional configuration, peek.nvim gives "Not a markdown file" when executed on Telekasten files.
:set filetype?
returnsfiletype=telekasten
Describe the solution you'd like A note next to the suggestion to use peek.nvim on how to correct this behavior.
Describe alternatives you've considered I will do some personal research to see if I can find a solution. But I am relatively new to NeoVim and lua (3-4 months). So please let me know via comment if you find a solution before I do!