Files
dotfiles/nvim/lua/custom_commands.lua
FaultyBranches 0ff4a94a04 feat: Adding the TSI (Tree-Sitter Install) command, changing the ui2
setup to use floating messages instead of the cmdline output, cleanup of
plugin loading.
2026-05-27 08:25:34 -05:00

17 lines
880 B
Lua

vim.api.nvim_create_user_command('FindAndReplace', function(opts)
-- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window
-- TODO: Does not close the buffers opened through changes
vim.api.nvim_command(string.format('cfdo s/%s/%s/gc', opts.fargs[1], opts.fargs[2]) .. '| update | cclose')
end, { nargs = '*' })
-- TODO: Set up a command for installing treesitter plugins via luarocks
vim.api.nvim_create_user_command('TSI', function(opts)
local result = vim.system({ 'luarocks', 'install', 'tree-sitter-' .. opts.fargs[1] }, { text = true }):wait()
if result.code == 0 then
print('Completed install of tree-sitter-' .. opts.fargs[1])
else
print('Failed to install tree-sitter-' .. opts.fargs[1])
print(result.stdout)
end
end, { nargs = '*' })