Тёмный

how to toggle neovim's autoformat on save 

Dan Kelley
Подписаться 88
Просмотров 66
50% 1

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

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Neovim and Git: SOLVED
8:03
Просмотров 68 тыс.
Why Neovim nerds are so obsessed with the terminal
6:44
Using R to overview NetCDF files
13:33
Просмотров 3
LazyVim: Linting and Formatting
9:26
Просмотров 44 тыс.
Vim in 100 Seconds
11:53
Просмотров 1,1 млн
Vim Run Any Code with Same Key! Macros Explained
10:52
Просмотров 3,5 тыс.
Rethinking Neovim as a Tool For Writers
8:48
Просмотров 18 тыс.
98% Cloud Cost Saved By Writing Our Own Database
21:45
Просмотров 375 тыс.