Git Product home page Git Product logo

nvim-listchars's Introduction

nvim-listchars

Easily configure and toggle listchars

example

📦 Installation

In order to display listchars by default, you must enable them somewhere in your init.lua before loading the plugin.

vim.opt.list = true

If you simply want to display listchars when needed, you can toggle them ON/OFF with the command :ListcharsToggle.

Lazy (recommended)

With defaults

{ "fraso-dev/nvim-listchars", config = true }

Packer

With defaults

use {
  "fraso-dev/nvim-listchars",
  config = function()
    require("nvim-listchars").setup()
  end
}

⚙️ Configuration

Defaults

{
  save_state = true, -- If enabled, save toggled state in a cache file. Will overwrite current `vim.opt.list` value.
  listchars = { -- `listchars` to be displayed. See available options by running `:help listchars`
    tab = "> ",
    trail = "-",
    nbsp = "+",
  },
  exclude_filetypes = {}, -- List of filetypes where `listchars` is disabled
  lighten_step = 5, -- Amount to add/remove from base color
}

Example with updated preferences

{
  "fraso-dev/nvim-listchars",
  config = function()
    require("nvim-listchars").setup({
      save_state = false,
      listchars = {
        trail = "-",
        eol = "",
        tab = "» ",
      },
      exclude_filetypes = {
        "markdown"
      },
      lighten_step = 10,
    })
  end,
}

You can find the complete list of available chars by running :help listchars

⚡ Commands

:ListcharsStatus
:ListcharsToggle
:ListcharsDisable
:ListcharsEnable
:ListcharsClearCache
:ListcharsLightenColors
:ListcharsDarkenColors

Notes

If you want to enable tab chars you must disable expandtab:

vim.opt.expandtab = false

nvim-listchars's People

Contributors

0xfraso avatar blazkowolf 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.