dandxy89 / dotfiles

0 stars 0 forks source link

Remove trailing white space #1

Closed dandxy89 closed 1 year ago

dandxy89 commented 1 year ago

'''-- Removes trailing whitespaces if the file is not a binary nor a diff. function _G.trim_trailing_whitespaces() if not vim.o.binary and vim.o.filetype ~= 'diff' then local current_view = vim.fn.winsaveview() vim.cmd([[keeppatterns %s/\s+$//e]]) vim.fn.winrestview(current_view) end end'''