Skip to content
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

Segment idea: list all opened buffers on the bar #4

Open
rochacbruno opened this issue Sep 18, 2023 · 1 comment
Open

Segment idea: list all opened buffers on the bar #4

rochacbruno opened this issue Sep 18, 2023 · 1 comment

Comments

@rochacbruno
Copy link

rochacbruno commented Sep 18, 2023

Just like the bufline in vim and helix, it would be nice to create a segment to show opened buffers on the tabline.

The info seems to be available on %val{buflist}

Something like

[custom.kakbuflist]
description = "Open buffers"
format = "[ %val{buflist} ]($style)"
style = "fg:white"
when = ''
shell = ['true']
disabled = false

this is how it looks like

2023-09-19_14-26

Any idea on how do I make it better?

  • format the quoted list returned by buflist
  • omit the current opened buffer from list, as it already shows on the other segment
  • omit the debug buffer
  • add a marker to modified buffers
@rochacbruno
Copy link
Author

Ok, I got something working

[custom.kakbuflist]
description = "Open buffers"
format = "[ $output ]($style)"
style = "fg:white"
when = 'true'
shell = ['sh']
command = 'kks get -s ${kak_session##*/} %val{buflist} | grep -vE "(\*debug\*|${kak_buffile##*/})" | paste -s -d "|" '
disabled = false

requires the installation of https://github.com/kkga/kks

Looks better now

kakbuflist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant