Giter VIP home page Giter VIP logo

symbol-overlay.nvim's Introduction

Introduction

This is a neovim plugin for highlighting symbols with overlays. Highlights will be updated automatically along with edits. It depends on neovim-lspconfig and telescope.nvim(optional).

Usage

Toggle highlight under cursor

:lua require('symbol-overlay').toggle() or press <C-t>t by default.

Add highlights in batch

For this to work, telescope.nvim is needed :Telescope symbol_overlay gen or press <C-t>g by default.

List highglights and goto

For this to work, telescope.nvim is needed :Telescope symbol_overlay list or press <C-t>l by default.

Clear all highlights

:lua require('symbol-overlay').clear_all() or press <C-t>c by default.

goto next/prev highlight

:lua require('symbol-overlay').next_highlight() / :lua require('symbol-overlay').prev_highlight()

or press <C-t>n/ <C-t>p by default.

Install

By lazy.nvim:

{
    'hek14/symbol-overlay.nvim'
    dependencies = { "neovim/neovim-lspconfig" }, -- add telescope.nvim if you want to use batch mode
    event = 'BufRead',
    config = function ()
      require('symbol-overlay').setup()
      require'telescope'.load_extension('symbol_overlay') -- comment this if you don't have telescope installed
    end
}

Config

require('symbol-overlay').setup({
    colors = {
          "#1F6C4A",
          '#0000ff',
          "#C70039",
          '#ffa724',
          "#b16286",
          "#d79921",
          "#d65d0e",
          "#458588",
          '#aeee00',
          '#ff0000',
          '#b88823',
          "#a89984",
          '#ff2c4b'
      },
    keymap = {
          toggle = '<C-t>t',
          clear_all = '<C-t>c',
          next_highlight = '<C-t>n',
          prev_highlight = '<C-t>p',
          gen = '<C-t>g',
          list = '<C-t>l',
      }
  })

design

Use namespaces for batch deletion/updating of a set of highlights.

TODO

  • add treesitter backend (maybe)
  • scope-limited search in batch mode, like Telescope symbol_overlay gen @function ".*setup.*"

symbol-overlay.nvim's People

Contributors

hek14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.