In neovim (at least in lazyvim, as I have it set up) when I type :w to write a file, it autoformats it. I've just learned how to turn that behaviour of for a file: type SPACE-u-f. That's what I show here, with some R code.
If you want to turn off autoformatting on save as a default, put the following into your ~/.config/nvim/lua/config/autocmds.lua file:
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "r" },
callback = function()
vim.b.autoformat = false
end,
})
16 июл 2024