mirror of
https://github.com/gyoder/dots.git
synced 2026-02-27 17:03:45 +00:00
nvim: fixed remove whitespace function
This commit is contained in:
parent
4cc1030d21
commit
b7f3af1172
1 changed files with 7 additions and 3 deletions
|
|
@ -32,9 +32,13 @@ require("standard-lint")
|
||||||
|
|
||||||
vim.cmd("source ~/.vim/settings.vim")
|
vim.cmd("source ~/.vim/settings.vim")
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = { "*" },
|
pattern = "*",
|
||||||
command = [[%s/\s\+$//e]],
|
callback = function()
|
||||||
|
local save = vim.fn.winsaveview()
|
||||||
|
vim.cmd([[%s/\s\+$//e]])
|
||||||
|
vim.fn.winrestview(save)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue