-
Notifications
You must be signed in to change notification settings - Fork 61
Integrate bufferline #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Integrate bufferline #260
Conversation
|
It's ready to be merged ! |
… function / Add some comments / Refactor README.md
| integrations = { | ||
| bufferline = { | ||
| ... | ||
| select = { "id", "title", "filenameStem", "metadata" }, -- Add metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused here why title is being used here, but then titles are accessed with metadata.title below. Shouldn't it be metadata.title here as well or left out completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little bit confusing for me too.
Let me summarize it again.
The metadata table is fetched only from the YAML frontmatter.
So, metadata.title comes exclusively from YAML -- It does not pick up # heading.
On the other hand, title can come from either the YAML frontmatter or a # heading (with YAML taking priority).
Since some people write the title in YAML while others use a # heading, it's better to keep using "title" in select.
Using note.title is a safer fallback.
Possible title styles:
---
title : Title in YAML
---# Title in heading---
title : Title in YAML
---
# Title in headingI tested it again.
Keeping "title" in select and using note.title captures the title in all cases.
Would it be better to add a note about this around the sample code?
e.g.
Note
note.metadata.title captures only YAML title, while note.title can capture either the YAML title or a # heading.
Therefore, including "title" in select table and using note.title is a safer fallback to catch the title in any positions.
tjex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had a look through everything and code looks good, although I have no experience with bufferline. I'll need to setup and double check.
|
I think Which plugin are you using instead of bufferline.nvim? |
|
@riodelphino I'm effectively using the build in statusline, enhanced by tjdevrie's express_line |
|
This will never get merged, will it? |
I've heard that @tjex is so busy now and there is only few reviewers recently. But he seemed positive about the merge. Let's wait leisurely. Or use my folk until merge, at your own risk.
or
@mathias-ewald Does this PR seem useful for you too? |
Thank you. |
|
I wasn't suggesting or expecting you to integrate / adapt for express_line!.. Just answering to your question as to what I use.
@mathias-ewald If it's working, then it will get merged. If you're wanting to help speed things up, then you're welcome to try it out and report back. It would seem you use bufferline already, and should then be a much better authority than me (who doesn't use it) to report whether it works or not. Please understand that it's not motivating or in any way useful, for the first message of someone who's been waiting silently on the sidelines and wanting something to be merged to be, "This will never get merged, will it?". Some prior interaction, even a thumbs up on the initial PR message, shows maintainers and the contributor that there are others interested in it being done. |
|
@tjex You're right. My apologies. It was an inconsiderate response to the issue being created in 2018. I have great interest in this and it's probably one of my greatest pain points navigating my notes. I will see if I can carve out some time to support this project in the future. |
|
@mathias-ewald It was created September 18, 2025. Not September 2018. And yep, carving out the time is the difficult part. But, if you can find the time to assist on a singular PR here and there by pasting the contributors branch in your config and running it, then that helps me alot. The more people who can try out a PR and report that it's working, the better. |
|
I had to make a few changes to get it to load without errors. You are using some globals that I don't have. Yet the bufferline still shows the filenames (id). |
@mathias-ewald Thank you for your debugging ! I guess you added only this lines:
I cannot find where I use raw And I cannot reproduce the issue with your config. |
NOTE: What is
|
|
@mathias-ewald Could you show me the error messages or the global name or the lines you modified? |
|
@riodelphino I meant the config. Specifically:
I have no experience getting a lot of useful logging out of nvim. What I tried was Here's the plugin loaded. Looks right to me. As you can see, bufferline is still the id. |
|
Thank you for reporting. ⭐️ Your config
This does not have any effects on bufferline feature. It just decides which picker you use.
I can't see any keymaps(???) about it in your config. ⭐️ Minimal configMinimal config to use this feature (in my environment) is: integrations = {
bufferline = {
enabled = true,
},
},That's all and it works fine for me. ⭐️ Log fileI saw your log file, but it contains only Vim Events. There is no informations about this feature. ⭐️ Ensure zk and zk-nvim works fineSorry, but please ensure the followings:
⭐️ What error? which variable?
I don't think it is concerned with this feature, but please let me know the error message you get and what global variable cause this error. Procedure:
🚀 Check with my zk & markdown test repoAdditionally, this is my zk and markdown collection for testing. You can clone it and check this feature with them. |
|
Thank you @mathias-ewald. Everything looks fine.
I'm not sure where it comes from too. Executing This error often belongs to opening floating|aside window or opening buffer, from my experiences. (Sorry, I'm not sure the cause.)
This telescope extension is not recommended or maintained, I think. ⭐️ Need extra config !!!And I have to give big apologize🙏 I've forgotten to put this quite important config in return {
'akinsho/bufferline.nvim',
config = function()
require('bufferline').setup({
options = {
---@param buf table
---@return string?
name_formatter = function(buf)
local ext = vim.fn.fnamemodify(buf.name, ':e')
if ext == 'md' then
return require('zk.integrations.bufferline').name_formatter(buf)
else
-- Other ext
return nil
end
end,
},
},
},
}Of course, you should keep below config in formatter = function(note)
return note.title or note.filenameStem or note.id or nil
end,Since I consider that some people are already using their own When I comment out the Please test it !! 🙏 Also it might be able to modify this PR's code to override bufferline's Something like
|
I'm grad to hear that ! Additionally, I pushed a new commit. Just put (And the unused |
I haven't seen it yet in either (It seems like |
|
Bingo. They are bufferline keymaps and commands, which come from But I cannot find any static It's totally out of scope for this PR. I might be able to help it, but please create an new |
You're right: lazyvim. Let's get this merged, as it's super valuable 🚀 |
Thanks for taking the time to look into this during your break. I didn't realize that the feature wasn't working on your side.
Yeah, I know. And thank you again -- your feedback and advice are really helpful for us🌈 |







Easy Integration for bufferline.
Feature
zk.listinstead oflyaml, to fetch zk note information. (title, tags, e.t.c.)