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

Vertical split preview window

Open cazgp opened this issue 7 years ago • 6 comments

Is it possible to open the preview window vertically?

I run the command, c-w H to move it vertical to see the results, start typing to amend the query, and then the preview autocloses after a few seconds. I could easily write a function that runs the DB command and then does the split move, but I was wondering if you think making it an option makes sense?

cazgp avatar Nov 16 '18 10:11 cazgp

I don't like options for stuff like this, but support for <mods>, which would enable :vert DB, would be a nice enhancement.

tpope avatar Nov 16 '18 22:11 tpope

Yeah that would great :) I did wrap the DB call in a function which does the c-w H automatically, but it ruins the layout when there are multiple splits open. Easily solved by two functions, but support out the box would be cool.

Also (sort of related) the dadbod split auto-closes for some reason. Do you know if dadbod is auto-closing or if that's a vim thing? I'm unsure how to work it out!

cazgp avatar Nov 18 '18 20:11 cazgp

Auto-closes when? Dadbod doesn't close it but there are reasons Vim would (:pclose for example).

tpope avatar Nov 18 '18 21:11 tpope

It's fairly reproducible:

$ vim test.sql i SELECT * FROM users; V :DB o SEL << at that point the DB window closes.

I've tried it with waiting and nothing happens, so it seems to be something linked to typing but I can't work it out. But if you don't think it's dadbod related then it must be some other plugin being funky!

cazgp avatar Nov 19 '18 10:11 cazgp

Sounds like an autocomplete plugin.

tpope avatar Nov 19 '18 12:11 tpope

I have the same issue. It's definitely caused by deoplete.

I'm just doing this right now, which completely destroys deoplete for the whole vim instance, but it works for me cause I only work on sql files in their own separate vim instances anyway.

autocmd FileType sql autocmd! deoplete *

washtubs avatar Dec 13 '18 16:12 washtubs