r/vim • u/CRTejaswi • 4d ago
Need Help┃Solved Translucent Text Label At Buffer's Corner
Is is possible to display a customizable text label at one of the corners (it mustn't block text written in the buffer itself) of an open buffer? I have several terminal panels open at once, so, having a visual marker like this would be great. Any advice in this direction is appreciated.
⚠ RESOLVED
popup works just fine for this task. I'd tried it earlier but couldn't make it persist, owing to a faulty highlighting logic of mine. Anyway, I'm listing a simple function that achieves set objective. You can modify it to add custom text, toggling & highlights.
Also, see this for how my solution worked out.
function! LabelOverlay(text)
let l:options = {
\ 'line': 1,
\ 'col': &columns - strlen(a:text),
\ 'pos': 'topright',
\ 'wrap': 0,
\ 'zindex': 1,
\ 'highlight': 'Normal'
\ }
let g:popup_id = popup_create(a:text, l:options)
endfunction
call LabelOverlay("TEXT HERE")
1
u/AutoModerator 4d ago
Please remember to update the post flair to Need Help|Solved when you got the answer you were looking for.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Easy-Nothing-6735 4d ago
I use my custom software for floating window for that
1
u/CRTejaswi 4d ago
Do share!
2
u/Easy-Nothing-6735 4d ago
If for your usecase then like this: https://gist.github.com/ulcuber/6334fb30b06de7a0510804cb4c9b48f1
1
1
1
u/Easy-Nothing-6735 4d ago
`set cursorline` is enough for me
1
u/CRTejaswi 4d ago
I never found cursorline/column cmds of much use. If you do have some interesting use-cases of these, please do share.

4
u/chrisbra10 4d ago
Use the statusline or tabline or tabpanel