Generally speaking, that's exactly what the :noautocmd command modifier is for. Just prefix your command with that and all autocommands should be disabled for just the run of that command.
Of course, this is the scorched earth approach. If there are other autocommands that you need to keep enabled and you're trying to ignore just the one you ...
The primary difference is that readonly is per-buffer and write is global to vim.
readonly is generally used when editing specific files that you do not have access to write (like /etc/fstab). Any buffer can be set to readonly if you want to prevent accidentally writing it to file.
nowrite can be used to put vim into view-only mode, like pager utilities ...
If you are working on a file that is not in the current working directory, and you want to save it under a new name in that directory, you can use the following:
execute 'saveas' expand('%:h') . "/new-file-name"
The execute command allows you to use an argument to saveas that is not a literal string. expand('%:h') gets the relative path of the ...
:wa and :wqa will write all changed buffers; from :help :wqa:
:wqa[ll] [++opt] :wqa :wqall :xa :xall
:xa[ll] Write all changed buffers and exit Vim. If there are buffers
without a file name, which are readonly or which cannot be
written for another reason, Vim will not quit.
Since your ...
Although an async alternative would be better, this one is pretty neat. The problem as comments pointed out was the quotes.
augroup renderRmd | au!
autocmd BufWritePost *.Rmd call Render()
function! Render() abort
:tabnew | te Rscript -e "rmarkdown::render(<afile>:p:S)"
This works with :w and ...
You can have your autocmds check what the &filetype is when making a decision. For something as short as checking that it's different from 'help' you might be able to go with a one-liner (use | to separate commands), for something more complex go with a separate :function (to help keep your sanity!)
For your specific case: