nvim-treesitter-refactor
nvim-treesitter
Our great sponsors
nvim-treesitter-refactor | nvim-treesitter | |
---|---|---|
14 | 300 | |
370 | 9,225 | |
2.4% | 5.3% | |
2.3 | 9.9 | |
12 months ago | 43 minutes ago | |
Lua | Scheme | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
nvim-treesitter-refactor
-
A plugin i can’t seem to find!
Maybe this? nvim-treesitter-refactor
-
Looking for a cursor highlighting plugin posted recently
These days though I'm using the https://github.com/nvim-treesitter/nvim-treesitter-refactor plugin. It goes one step further and only highlights the matches that are in the same scope. Makes a big difference in a lot of programming languages where you use the same variable named in a lot of smaller functions/methods right next to each other.
-
Anything like Blockman in Neovim?
My desires are not sated, but it seems quite nice. (I recall treesitter-refactor has a similar scope highlighter, but it could be a bit aggressive near root scope -- this might be a more gentle version.
-
How to highlight the symbol under the cursor?
check https://github.com/nvim-treesitter/nvim-treesitter-refactor/
-
Very slow input latency for haskell when treesitter highlighting is enabled
Treesitter performance is a hard problem. First, check the following: 1. Do you use nvim_treesitter#foldexpr()? Try not to use foldmethod=expr in insert mode. Or just switch to nvim-ufo. 2. Do you use nvim-treesitter-refactor's highlight_definitions or highlight_current_scope? These features do slower the performance. Try to disable these features. 3. I've heard some language parser is not good in terms of performance. Since I don't write haskell, I can't help you here. But you can create issue in nvim-treesitter.
-
Looking for treesitter-based (but not LSP-based) plugins with commands like "hover documentation"
For instance, with plugins like nvim-treesitter-refactor and ray-x/navigator.lua, you can use a bunch of commands like "go to definition" and "smart rename" without an LSP server.
-
What do you use treesitter for other than highlighting?
TS Refactor
-
Is there any plugin to highlight occurences of a value under cursor?
If you have treesitter, you can use nvim-treesitter-refactor. It has the highlight_definitions option that will highlight the definitions of a variable.
-
What’s your home office setup?
Oh! I've actually never tried Emacs text navigation. My brief stint with Emacs was with Spacemacs (w/ the evil-mode plugin). If I knew any lisp when I had given Spacemacs a whirl then there's a chance I may have stuck with it. I've played with Clojure a bit. Ah, it appears that you're a data-eng -- heavy on the Python. Are you trying to mimic something that PyCharm provides? I'm just happy that LSP has come where it has in such little time and that's already improved working with code in various languages quite a bit. Neovim moves incredibly fast and having LuaJIT with support for Lua had completely opened the floodgates for ports of old Vim plugins and made way for newer ones with floating windows/floating terminals. There are two projects each with hundreds of stars on GitHub meant to mimic or one-up org-mode (one has an entirely new spec) with immense development activity. The one-up that Neovim has over Vim presently is tree-sitter (because the core team wrote a wrapper) and exposes a Lua interface for plugin devs that want to use it. It's been neat for themes and my new favorite find-and-replace plugin (https://github.com/nvim-treesitter/nvim-treesitter-refactor). Because there's type data coming from the AST, it's much less likely to have accidental replacements (if at all). It looks like Emacs is making some headway here, though: https://github.com/emacs-tree-sitter
-
Does anyone have any examples of how to use vim.lsp.util.buf_highlight_references()?
You can also navigate between the highlights using treesitter-refactor: https://github.com/nvim-treesitter/nvim-treesitter-refactor
nvim-treesitter
-
JetBrains' unremovable AI assistant meets irresistible outcry
I suggest looking for blog posts about this, you're gunnuh wanna pick out a plugin manager and stuff. It's kind of like a package manager for neovim. You can install everything manually but usually you manually install a plugin manager and it gives you commands to manage the rest of your plugins.
These two plugins are the bare minimum in my view.
https://github.com/nvim-treesitter/nvim-treesitter
Treesitter gives you much better syntax highlighting based on a parser for a given language.
https://github.com/neovim/nvim-lspconfig
This plugin helps you connect to a given language LSP quickly with sensible defaults. You more or less pick your language from here and copy paste a snippet, and then install the relevant LSP:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/ser...
For Python you'll want pylsp. For JavaScript it will depend on what frontend framework you're using, I probably can't help you there.
pylsp itself takes some plugins and you'll probably want them. https://github.com/python-lsp/python-lsp-server
Best of luck! Happy hacking.
-
Do I need NeoVIM?
https://github.com/hrsh7th/nvim-cmp This is an autocompletion engine https://github.com/nvim-treesitter/nvim-treesitter This allows NeoVim to install parsing scripts so NeoVim can do things like code highlighting. https://github.com/williamboman/mason.nvim Not strictly necessary, but allows you to access a repo of LSP, install them, and configure them for without you actively messing about in config files. https://github.com/neovim/nvim-lspconfig Also not strictly necessary, but vastly simplifies LSP setup. https://github.com/williamboman/mason-lspconfig.nvim This lets the above two plugins talk to each other more easily.
- Problem with highlighting when attempting to create own treesitter parser
-
neorg problem, all other plugins deactivate when added to init.lua
vim.opt.rtp:prepend(lazypath) require('lazy').setup({ { "nvim-neorg/neorg", build = ":Neorg sync-parsers", opts = { load = { ["core.defaults"] = {}, -- Loads default behaviour ["core.concealer"] = {}, -- Adds pretty icons to your documents ["core.dirman"] = { -- Manages Neorg workspaces config = { workspaces = { notes = "~/notes", }, defaultworkspace = "notes", }, }, }, }, dependencies = { { "nvim-lua/plenary.nvim", }, { -- YOU ALMOST CERTAINLY WANT A MORE ROBUST nvim-treesitter SETUP -- see https://github.com/nvim-treesitter/nvim-treesitter "nvim-treesitter/nvim-treesitter", opts = { auto_install = true, highlight = { enable = true, additional_vim_regex_highlighting = false, }, }, config = function(,opts) require('nvim-treesitter.configs').setup(opts) end }, { "folke/tokyonight.nvim", config=function(,) vim.cmd.colorscheme "tokyonight-storm" end,}, }, }, }) require 'plugins' ```
- What is this color scheme
-
How do you fix inconsistent colorscheme (struct and class)?
Install nvim-treesitter
-
tree-sitter-comment now supports http/s links
To use it, just update to the latest version of nvim-treesitter, and don't forget to run `:TSUpdate` and have the comment parser installed.
-
Plugin for Automatic Highlight of Custom (typedef-d) Types?
If you are using Neovim, Tree-sitter does this very well for quite a number of languages, inc C and C++. https://github.com/nvim-treesitter/nvim-treesitter
-
[WIP] A feature-rich, polished, highly customizable winbar, with drop down menu support and multiple backends
Zero-depency, yes, this is not another extension of navic. It does not even depends on nvim-treesitter or nvim-lspconfig, nor do you need to register an 'on_attach' function. as long as treesitter parsers or language servers are intalled correctly, the winbar should start working out of the box
-
How do I show Markdown headings in different colours?
Are you using tree sitter? If so support for this was merged relatively recently https://github.com/nvim-treesitter/nvim-treesitter/pull/4798
What are some alternatives?
coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
nvim-lspconfig - Quickstart configs for Nvim LSP
vim-polyglot - A solid language pack for Vim.
vim-python-pep8-indent - A nicer Python indentation style for vim.
packer.nvim - A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
tree-sitter - An incremental parsing system for programming tools
telescope.nvim - Find, Filter, Preview, Pick. All lua, all the time.
nvim-autopairs - autopairs for neovim written in lua
indent-blankline.nvim - Indent guides for Neovim
semshi - 🌈 Semantic Highlighting for Python in Neovim
minimap.vim - 📡 Blazing fast minimap / scrollbar for vim, powered by code-minimap written in Rust.
playground - Treesitter playground integrated into Neovim