All Projects → haringsrob → nvim_context_vt

haringsrob / nvim_context_vt

Licence: MIT License
Virtual text context for neovim treesitter

Programming Languages

lua
6591 projects
Vim Script
2826 projects

Projects that are alternatives of or similar to nvim context vt

boo-colorscheme-nvim
Boo is a colorscheme for Neovim with handcrafted support for LSP, Treesitter.
Stars: ✭ 62 (-67.88%)
Mutual labels:  neovim, neovim-plugin, treesitter
Comment.nvim
🧠 💪 // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
Stars: ✭ 796 (+312.44%)
Mutual labels:  neovim, neovim-plugin, treesitter
Neovim Ruby
Ruby support for Neovim
Stars: ✭ 202 (+4.66%)
Mutual labels:  neovim, neovim-plugin
Lualine.nvim
A blazing fast and easy to configure neovim statusline written in pure lua.
Stars: ✭ 198 (+2.59%)
Mutual labels:  neovim, neovim-plugin
aurora
24-bit dark theme for (Neo)vim. Optimized for treesitter, LSP.
Stars: ✭ 141 (-26.94%)
Mutual labels:  neovim-plugin, treesitter
Deoplete Clang
deoplete.nvim source for C/C++/Obj-C/Obj-C++ with clang-python3
Stars: ✭ 186 (-3.63%)
Mutual labels:  neovim, neovim-plugin
Visual Split.vim
Vim plugin to control splits with visual selections or text objects
Stars: ✭ 190 (-1.55%)
Mutual labels:  neovim, neovim-plugin
Nvim Go
Go development plugin for Neovim written in pure Go
Stars: ✭ 207 (+7.25%)
Mutual labels:  neovim, neovim-plugin
Vim Dadbod Completion
Database autocompletion powered by https://github.com/tpope/vim-dadbod
Stars: ✭ 163 (-15.54%)
Mutual labels:  neovim, neovim-plugin
Vim Vsnip
Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
Stars: ✭ 224 (+16.06%)
Mutual labels:  neovim, neovim-plugin
Indent Blankline.nvim
Indent guides for Neovim
Stars: ✭ 203 (+5.18%)
Mutual labels:  neovim, neovim-plugin
Vim Ghost
Vim/Nvim client for GhostText - Edit browser text areas in Vim/Neovim
Stars: ✭ 245 (+26.94%)
Mutual labels:  neovim, neovim-plugin
Instant.nvim
collaborative editing in Neovim using built-in capabilities
Stars: ✭ 178 (-7.77%)
Mutual labels:  neovim, neovim-plugin
Animate.vim
A Vim Window Animation Library
Stars: ✭ 173 (-10.36%)
Mutual labels:  neovim, neovim-plugin
Vim Packager
Vim plugin manager that utilizes "jobs" and "pack" features.
Stars: ✭ 197 (+2.07%)
Mutual labels:  neovim, neovim-plugin
Neotex
latex live preview - plugin for neovim and vim 8
Stars: ✭ 170 (-11.92%)
Mutual labels:  neovim, neovim-plugin
Lsp Status.nvim
Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
Stars: ✭ 201 (+4.15%)
Mutual labels:  neovim, neovim-plugin
nvim-highlite
A colorscheme template that is "lite" on logic for the developer.
Stars: ✭ 163 (-15.54%)
Mutual labels:  neovim-plugin, treesitter
Acid.nvim
Asynchronous Clojure Interactive Development
Stars: ✭ 147 (-23.83%)
Mutual labels:  neovim, neovim-plugin
Targets.vim
Vim plugin that provides additional text objects
Stars: ✭ 2,114 (+995.34%)
Mutual labels:  neovim, neovim-plugin

nvim_context_vt

Shows virtual text of the current context after functions, methods, statements, etc.

nvim_context_vt

How to install

Use your favourite package manager and install treesitter alongside this plugin. No configuration is required out of the box.

Advanced usage

To customize the behavior use the setup function:

require('nvim_context_vt').setup({
  -- Enable by default. You can disable and use :NvimContextVtToggle to maually enable.
  -- Default: true
  enabled = true,

  -- Override default virtual text prefix
  -- Default: '-->'
  prefix = '',

  -- Override the internal highlight group name
  -- Default: 'ContextVt'
  highlight = 'CustomContextVt',

  -- Disable virtual text for given filetypes
  -- Default: { 'markdown' }
  disable_ft = { 'markdown' },

  -- Disable display of virtual text below blocks for indentation based languages like Python
  -- Default: false
  disable_virtual_lines = false,

  -- Same as above but only for spesific filetypes
  -- Default: {}
  disable_virtual_lines_ft = { 'yaml' },

  -- How many lines required after starting position to show virtual text
  -- Default: 1 (equals two lines total)
  min_rows = 1,

  -- Same as above but only for spesific filetypes
  -- Default: {}
  min_rows_ft = {},

  -- Custom virtual text node parser callback
  -- Default: nil
  custom_parser = function(node, ft, opts)
    local ts_utils = require('nvim-treesitter.ts_utils')

    -- If you return `nil`, no virtual text will be displayed.
    if node:type() == 'function' then
      return nil
    end

    -- This is the standard text
    return '--> ' .. ts_utils.get_node_text(node)[1]
  end,

  -- Custom node validator callback
  -- Default: nil
  custom_validator = function(node, ft, opts)
    -- Internally a node is matched against min_rows and configured targets
    local default_validator = require('nvim_context_vt.utils').default_validator
    if default_validator(node, ft) then
      -- Custom behaviour after using the internal validator
      if node:type() == 'function' then
        return false
      end
    end

    return true
  end,

  -- Custom node virtual text resolver callback
  -- Default: nil
  custom_resolver = function(nodes, ft, opts)
    -- By default the last node is used
    return nodes[#nodes]
  end,
})

Commands

  • :NvimContextVtToggle - Enable/disable context virtual text

Debug

If you don't see the expected context vitual text, run :NvimContextVtDebug to print out the context tree. Use this information to open a pull-request or an issue to add support.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].