boltlessengineer/bufterm.nvim

show the current terminal index

Closed this issue · 4 comments

when i have multiple terminals open i get lost cycling between them, i would like to show in my statusline how many terminals exist and which one i'm currently in, like in the demo video. giving us a way to show the index of the current terminal by exposing the get_index function would be helpful. thanks for the amazing plugin <3

Although I used that function in video, I would recommend you to use just buffer-id to identify the terminal.

Anyways, the get_index function is exposed now as an option :)

thanks, aren't buffer ids random? i don't know what you mean by buffer-id

thanks, aren't buffer ids random? i don't know what you mean by buffer-id

As far as I know, buffer-id is assigned sequentially each time a buffer is created, starting from 0. And ids returned from get_index() function will return current index of given buffer from list of terminal buffers. It can change if you remove some terminal buffers you previously made, so I won't recommend using it as identifier.

Getting used to distinguish terminal buffers by buffer-id like other normal file buffer will be better approach as generalization in concept of buffer is whole concept of this plugin 😁

ah i get what you mean now, if my buffer ids were small and sequential i'd probably use them but they get ugly when i use something like nvim-bqf or trouble.nvim, the buffer list ls! gets filled with unloaded buffers and my buffers ids start reaching big numbers, idk what other plugins mess it up but when i open a file with telescope, then open another file sometimes the buffer id jumps my 10 and other times by 2 and so on... so yeah i'd rather see [1, 2, 3] and cycle between them than buffer ids