8000 GitHub - i3d/nvim_context_vt: Virtual text context for neovim treesitter
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

i3d/nvim_context_vt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 

Repository files navigation

Nvim context vt

Shows virtual text of the current context at the end of:

  • functions
  • methods
  • if statements
  • foreach statements
  • classes

Debug

If a context expected is not shown you can try to use :lua require 'nvim_context_vt'.showDebug() to get current and parent node info.

Mandatory jif

example

How to install

Install treesitter, then use your favourite package manager.

There are no dependencies.

Advanced usage

You can use a callback to change the virtual text content.

require('nvim_context_vt').setup {
  custom_text_handler = function(node)
    return 'my custom virtual text'
  end,
}

If you return nil, no virtual text will be displayed. You can use it to filter out node type which you don't to want virtual text to appear.

require('nvim_context_vt').setup {
  custom_text_handler = function(node)
    if node:type() == 'function' then
      return nil
    end
    return ts_utils.get_node_text(node)[1]
  end,
}

About

Virtual text context for neovim treesitter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 92.0%
  • Vim Script 8.0%
0