Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Preview Window? #2015

Closed
5 tasks
liberninja opened this issue Feb 28, 2016 · 9 comments
Closed
5 tasks

Disable Preview Window? #2015

liberninja opened this issue Feb 28, 2016 · 9 comments

Comments

@liberninja
Copy link

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • [x ] I have read and understood YCM's CONTRIBUTING document.
  • [ x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [ x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [ x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have included the output of
    :YcmToggleLogs stderr.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue.
  • [ x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [ x] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Perhaps I'm missing the purpose of the preview window popping up on top ever time I get a completion option, but it seems to just show what already shows up in the completion dropdown. It's kind of annoying and makes me lose focus of the line I'm working on when it shifts down constantly. Is there a way to disable it completely? I've seen options for autoclosing it after completion, but I don't want it at all.

[If filing a bug report, please include a list of steps that describe how to
reproduce the bug you are experiencing. Also include test code if relevant.]

@puremourning
Copy link
Member

if you don't like the preview window popping up then:

@vheon
Copy link
Contributor

vheon commented Feb 28, 2016

Perhaps I'm missing the purpose of the preview window popping up on top ever time I get a completion option, but it seems to just show what already shows up in the completion dropdown.

If the semantic engine for the language you're working can extract the documentation it will display it there. If you get only what you're already getting in the popup menu then it means that either you don't have documentation for the function you're completing or the semantic engine couldn't pick it up.

In any case the preview window on completion is a built in feature of vim and you can turn it off by

set completeopt-=preview

We add the relevant option only if you have let g:ycm_add_preview_to_completeopt = 1 in your configuration.

@puremourning
Copy link
Member

Hah. Issue ninja!

@oscarmorrison
Copy link

@Valloric @vheon I am using tern. Is there a way to hide the preview window if there are no doc for the item. Eg. Sometimes my custom function is highlighted in the completion menue, and it opens up the preview window empty. How can i make it not show if its empty.

@vheon
Copy link
Contributor

vheon commented Aug 16, 2016

I don't think there is a "native" way of doing it (so no option for that), but with some VimL I think is doable:

autocmd WinEnter * if &previewwindow && line2byte( line( '$' ) + 1 ) <=2 | :pclose | endif

I didn't test it, just wrote it :)

@kybishop
Copy link

For anyone else who ends up here, this option is amazing, and might be what you want: https://github.com/Valloric/YouCompleteMe#the-gycm_autoclose_preview_window_after_insertion-option

@Henry-E
Copy link

Henry-E commented Feb 2, 2018

The autoclose_preview_window option is handy but it resizes the panes every time it does this. Is there a way to prevent this behaviour?

rcarraretto added a commit to rcarraretto/dotfiles that referenced this issue Jan 2, 2019
This reverts commit 76de82b.

I updated YCM plugin and now as I <c-n> it opens a window (preview
window?).

ycm-core/YouCompleteMe#2015 (comment)
rcarraretto added a commit to rcarraretto/dotfiles that referenced this issue Jan 2, 2019
This reverts commit 76de82b.

I updated YCM plugin and now as I <c-n> it opens a window (preview
window?).

ycm-core/YouCompleteMe/issues/2015#issuecomment-189917191
@shuaixr
Copy link

shuaixr commented May 6, 2020

Is there any way to fix the height?

@puremourning
Copy link
Member

These days, if you aren't a fan of the preview window (i'm not), i would recommend using the preview popup

set previewpopup=height:10,width:60,highlight:PMenuSbar
set completeopt+=popup
set completepopup=height:15,width:60,border:off,highlight:PMenuSbar

Otherwise, all the help you need is in :help preview-window

@ycm-core ycm-core locked as resolved and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants