👎 Are you tired of the crappy experience navigating the builtin TSInstallInfo
window? 👎
👍 When you just want to search to see if you have a parser installed? 👍
🚫 But instead you have to scroll, scroll, and scroll some more until you find the language you're looking for? 🚫
Searching to see if a parser is installed with TSInstallInfo |
What if I told you it didn't have to be this way?
What if I told you that you could browse, install, and uninstall treesitter parsers from the comfort telescope.nvim?
Well, I guess I mean continue to search, but specifically for treesitter parsers inside telescope... I digress.
Searching for a parser using :Telescope treesitter_info |
Setup is easy! Add the extension as a dependency to your telescope config!
-- using lazy.nvim
return {
'nvim-telescope/telescope.nvim',
...
dependencies = {
'nvim-lua/plenary.nvim',
'roycrippen4/telescope-treesitter-info.nvim',
},
...
config = function()
require('telescope').load_extension('treesitter_info')
end
We don't support configuration! SIMPLE
Use the following command to open the treesitter parser list in telescope!
:Telescope treesitter_info
We also took the liberty of deciding you don't need the old command anymore now that you are stuck in our walled garden!
🔥 You can also use the original command to open the parser list in telescope because we overrode it! 🔥
:TSInstallInfo
You can even set it up as a keymap!!!
vim.keymap.set(
'n',
'<leader>fp',
'<cmd> Telescope treesitter_info <CR>',
{ desc = 'Find treesitter info' }
)
Well let me tell you this!
You can select a language with <cr>
in telescope's results and the plugin will autofill the corresponding Install or Uninstall command for that language in the command line!
Let's say you don't have the java
parser installed (because who would, am I right?).
You can open the picker using any of the methods described above, search for java
, and hit <cr>
.
The plugin will have autofilled :TSInstall java
.
All you have to do now, and this is important, is hit <esc>
to exit, because why the fuck would you install the parser for java! It's that simple!