diff --git a/lua/commands.lua b/lua/commands.lua index e367a28..0686519 100644 --- a/lua/commands.lua +++ b/lua/commands.lua @@ -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)