crusj / bookmarks.nvim

Remember file locations and sort by time and frequency and support telescope.
MIT License
222 stars 17 forks source link

Syntax highlighting / Set filetype for previewed file in bookmarks float window #18

Closed ttytm closed 1 year ago

ttytm commented 1 year ago

Currently, no filetype is set for a previewed filed. Setting the ft would enable syntax highlighting.

I didn't made any implementation test yet, so my theoretical assumptionion on how this could be solved: It might be possible to directly retrieve the filetype when opening the preview. If not, it might be worth the tradeoff to additionally save ft = vim.bo.ft on bookmark creation.

Screenshot, manually setting the ft in a previewed file after opening the window.

Screenshot_20230410_114726

Might be related to #13 (edit: didn't read through the issue properly. No relation afaik.)

crusj commented 1 year ago

Currently, no filetype is set for a previewed filed. Setting the ft would enable syntax highlighting.

I didn't made any implementation test yet, so my theoretical assumptionion on how this could be solved: It might be possible to directly retrieve the filetype when opening the preview. If not, it might be worth the tradeoff to additionally save ft = vim.bo.ft on bookmark creation.

Screenshot, manually setting the ft in a previewed file after opening the window.

Screenshot_20230410_114726

Might be related to #13 (edit: didn't read through the issue properly. No relation afaik.)

In the setup options, preview_ext_enable is used to configure whether to add a filetype suffix to the current buffer.

ttytm commented 1 year ago

Awesome! Sorry for not checking better beforehand. Let me close this.