vim-dadbod-ui icon indicating copy to clipboard operation
vim-dadbod-ui copied to clipboard

[Feature Request] Allow for context.vim in dbout buffer to keep headers visible

Open SebastianBehrens opened this issue 1 year ago • 5 comments

Would it not be nice to have the column headers visible even when scrolling through a table?

Context.vim is such a plugin for base vim. With the following config for that plugin one can keep the headers if one yanks the context of the dbout buffer to a modifiable buffer.

let g:context_extend_regex = '^\s*\([]{})]\|end\|else\|\(case\|default\|done\|elif\|fi\)\>\)\|^-\+'
let g:context_join_regex = '^\W*$\|^[^-]\+'
let g:context_skip_regex = '^\([<=>]\{7\}\|\s*\($\|\h\+\S\s*:\|#\|//\|/\*\|\*\($\|\s\|/\)\)\)\|^-\+'

What do you think?

SebastianBehrens avatar Sep 01 '23 08:09 SebastianBehrens

I'm not familiar with that plugin. Do you know it could be introduced here? I see a lot of global variables in there, but I don't see a way to define it for specific filetypes.

Maybe we could just add some wiki how to use it instead of implementing it.

kristijanhusak avatar Sep 14 '23 10:09 kristijanhusak

Yes, using instead of implementing would make sense.

One issue though, the .dbout buffer with the results seems to be configured such that the plugin cannot modify it.

The regex above extends the plugin for results from MSSQL.

SebastianBehrens avatar Nov 02 '23 16:11 SebastianBehrens

Why would it need to modify the buffer? Isn't it supposed to create floating window(s) above the actual buffer?

kristijanhusak avatar Nov 02 '23 17:11 kristijanhusak

I guess it is. What I wanted to say is that context.vim does not work on the .dbout buffer. But, admittedly, I don't know exactly why.

SebastianBehrens avatar Nov 02 '23 17:11 SebastianBehrens

To frame the problem differently and maybe without context.vim: It would be nice to see the header line of the output when inspecting output that is taller than the buffer height.

SebastianBehrens avatar Nov 02 '23 17:11 SebastianBehrens