neovim configuration using rocks.nvim plugin manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(command): add `:TSEditQuery` command

+20
+20
lua/core/commands.lua
··· 27 27 end, { 28 28 desc = "Open lsp.log file", 29 29 }) 30 + vim.api.nvim_create_user_command("TSEditQuery", function (opts) 31 + local lang = opts.fargs[1] 32 + local query = opts.fargs[2] 33 + local files = vim.treesitter.query.get_files(lang, query) 34 + if #files == 1 then 35 + vim.cmd.edit(files[1]) 36 + return 37 + elseif #files < 1 then 38 + vim.notify(("can't find '%s' query for language '%s'"):format(query, lang)) 39 + return 40 + end 41 + vim.ui.select(files, { 42 + prompt = "Select query file", 43 + }, function (choice) 44 + vim.cmd.edit(choice) 45 + end) 46 + end, { 47 + nargs = "+", 48 + desc = "", 49 + })