maralla / completor.vim

Async completion framework made ease.
MIT License
1.31k stars 62 forks source link

Improvement for docs window #153

Closed gasabr closed 5 years ago

gasabr commented 6 years ago

First of all, thank you for such an amazing tool!

I have a little suggestion for docs window, which pops up sometimes on the top of the screen. It's super useful, but is it possible to keep the line being edited in the same position on the screen as it was before the window popped up? The problem is, after the docs window is closed I have to search for the place I was typing and this makes the process a bit annoying.

I know almost nothing about vim script, but from the user experience point of view here are my thoughts on how it could be done "better":

  1. Overlap the lines below the pop up window, if possible.
  2. Separate window for docs (split the screen and toggle it when needed as nerdtree or tagbar)
maralla commented 6 years ago

Thanks for reporting! Do you mean the preview window:

com

The preview window which contains the docs should not change the cursor position normally.

gasabr commented 6 years ago

What you showed is the perfect behaviour I was thinking about, but in my case docs window appears to be on top of the editor. What should I do to move to the bottom?

25

maralla commented 6 years ago

You can add this settings to your vimrc:

set splitbelow
gasabr commented 6 years ago

Thank you for the completor and for the tip! And sorry for stupid question.

ghost commented 6 years ago

@maralla, @gasabr : Does completor bundled with docs?

ghost commented 6 years ago

How to keep doc windows and how to resize it, I try to read it but it destroyed when I click on. I doubt it's expected behavior. So how to resize it?

maralla commented 6 years ago

The doc window will be closed after completion finished by default. You can add the following config to make the doc window keep open after finished:

let g:completor_auto_close_doc = 0

The doc window is a vim feature. You can switch to the doc window and use <Ctrl-W> +/- to increase/decrease height. You can use the config set &previewheight = 12 to set the default height of the doc window.

ghost commented 6 years ago

I thought it was echodoc plugin, if not how to disable doc window so echodoc will print only function prototype?

ghost commented 6 years ago

Oh, I have the answer.