Git Product home page Git Product logo

float-preview.nvim's Introduction

float-preview.nvim

With let g:float_preview#docked = 1:

asciicast

With let g:float_preview#docked = 0:

asciicast

Note that this is a general purpose plugin instead of ncm2 only, it applies to :help complete-items with info field available.

Why ?

Vim's builtin set completeopt+=preview is annoying. When the preview window is opened, it simply pumps text out of my eye spot. Which makes it very disturbing and actually unusable.

This plugin uses neovim's floating Window, it should never pumps text out of your eye spot.

Config && API

g:float_preview#win

When the floating window opens, float-preview.nvim will emit a custom autocommand which you can use to further configure the opened window. The window ID will be exposed through g:float_preview#win.

Example: a function that disables numbers and the cursor line in the opened window.

function! DisableExtras()
  call nvim_win_set_option(g:float_preview#win, 'number', v:false)
  call nvim_win_set_option(g:float_preview#win, 'relativenumber', v:false)
  call nvim_win_set_option(g:float_preview#win, 'cursorline', v:false)
endfunction

autocmd User FloatPreviewWinOpen call DisableExtras()

g:float_preview#docked

If set to 0, the preview window will be displayed beside the popup menu. Defaults to 1.

g:float_preview#winhl

Custom highlights for preview window. See :help 'winhl' for more information.

g:float_preview#max_height

Height of the preview window. Defaults to :help 'previewheight'.

g:float_preview#max_width

Only used when g:float_preview#docked == 0. Max width of the preview window. Defaults to 50.

g:float_preview#auto_close

Defaults to 1. Only used when g:float_preview#docked == 1.

If you don't want this plugin auto closing the preview window, use :let g:float_preview#auto_close = 0 and call float_preview#close() by yourself.

float-preview.nvim's People

Contributors

alok avatar resolritter avatar roxma avatar shatur avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.