Add :Chmod command to change mode bits

This commit is contained in:
Kenneth Benzie 2024-04-08 20:52:47 +01:00
parent eee4944354
commit 2098949e9c

View File

@ -99,7 +99,13 @@ end, {
end
})
-- TODO: :Chmod
-- :Chmod change file mode bits
if vim.fn.executable('chmod') == 1 then
vim.api.nvim_create_user_command('Chmod', function(opts)
local file = vim.fn.expand('%:p')
vim.fn.system('chmod ' .. opts.args .. ' ' .. file)
end, { nargs = '+' })
end
-- :Mkdir create a directory, bang to create intermediate directories
vim.api.nvim_create_user_command('Mkdir', function(opts)