diff --git a/lua/settings/init.lua b/lua/settings/init.lua index 3624e80..bc74e49 100755 --- a/lua/settings/init.lua +++ b/lua/settings/init.lua @@ -9,6 +9,7 @@ local cmd = vim.cmd -- Execute Vim commands local exec = vim.api.nvim_exec -- Execute Vimscript local g = vim.g -- Global variables local opt = vim.opt -- Set options (global/buffer/windows-scoped) +local o = vim.o ----------------------------------------------------------- -- General @@ -100,3 +101,14 @@ local disabled_built_ins = { for _, plugin in pairs(disabled_built_ins) do vim.g["loaded_" .. plugin] = 1 end + +--[[ +Deletes all trailing whitespaces in a file if it's not binary nor a diff. +]]-- +function _G.trim_trailing_whitespaces() + if not o.binary and o.filetype ~= 'diff' then + local current_view = fn.winsaveview() + cmd([[keeppatterns %s/\s\+$//e]]) + fn.winrestview(current_view) + end +end diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index 73b1db1..b89df36 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -150,3 +150,9 @@ AppCues appcues Skuad Skuid +COO +Nergis +pdf +FiveTran +BigQuery +COO diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 4a4b4fe..482ed96 100644 Binary files a/spell/en.utf-8.add.spl and b/spell/en.utf-8.add.spl differ