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 = '*' })