mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Only format C, CPP and Rust code
This commit is contained in:
parent
efcda5cf6f
commit
074a53a664
@ -54,6 +54,13 @@ api.nvim_create_autocmd({ "BufWritePre" }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
|
pattern = {"*.c", "*.cc", "*.cpp", "*.h", "*.rs", "*.py"},
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format { asnyc = false }
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Automatically reload the file if it is changed outside of Nvim, see https://unix.stackexchange.com/a/383044/221410.
|
-- Automatically reload the file if it is changed outside of Nvim, see https://unix.stackexchange.com/a/383044/221410.
|
||||||
-- It seems that `checktime` does not work in command line. We need to check if we are in command
|
-- It seems that `checktime` does not work in command line. We need to check if we are in command
|
||||||
-- line before executing this command, see also https://vi.stackexchange.com/a/20397/15292 .
|
-- line before executing this command, see also https://vi.stackexchange.com/a/20397/15292 .
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user