Git Product home page Git Product logo

indent-blankline.nvim's Introduction

Indent Blankline

This plugin adds indentation guides to empty lines.

It is recommended, but not required, to use it together with Yggdroot/indentLine.

This plugin requires Neovim 0.4.0 or higher. It makes use of Neovim only features so it will not work in Vim.

Note

If you are using Neomvim 0.5, you should use the lua branch.
It is much faster and has real-time update support.
It will become the default once Neovim 0.5 is released.

Details

indent-blankline uses the virtual text feature from Neovim to display indentation guides on empty lines.
Virtual text can currently only be added after the end of the line, so it is not possible to use this to display indentation guides on lines with text.

The indentation level is generated like Neovim would generate normal indentation.
If indentexpr is empty, it uses cindent().
If indentexpr is set to lisp, it uses lispindent().
If indentexpr is set to anything else, it uses that function.

The lines to indent and the level of indentation is computed asynchronously with an embedded read-only instance of Neovim.

This makes generation of indentation not affect normal editing. But it could be resource intensive.
indent-blankline needs to open buffers in read-only mode with autocommands, to set up the correct indentexpr. In most cases this should not cause issues, but if you have side effects defined for opening buffers, this might lead to undesired execution of those.

A possible solution for this would be to check if Neovim has a UI attached before running such side effects.

if len(nvim_list_uis())
    " your side effect code
endif

IndentLine dependency

indent-blankline does not require the indentLine Plugin. But it is recommended to use the two together.

Almost all settings from indentLine will work seamlessly with indent-blankline as well without any setup.

Settings

Please see :help indent_blankline.txt

Screenshots

Screenshots are made together with indentLine

Default settings

Screenshot

With custom listchars and g:indent_blankline_space_char

Screenshot

indent-blankline.nvim's People

Contributors

etiamnullam avatar jpfender avatar lukas-reineke 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.