nvim-telekasten / telekasten.nvim

A Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
MIT License
1.42k stars 91 forks source link

[FR] Note in README.md for peek.nvim #225

Closed Zethtren closed 1 year ago

Zethtren commented 1 year ago

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? returns filetype=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!

Zethtren commented 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.)

Zethtren commented 1 year ago

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.

Zethtren commented 1 year ago

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'

lambtho12 commented 1 year ago

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.

lambtho12 commented 1 year ago

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.