Plugin stuff

This commit is contained in:
Norm Rasmussen
2022-12-14 17:07:00 -05:00
parent 040fa14a20
commit fd11b9c22b
3 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -150,3 +150,9 @@ AppCues
appcues
Skuad
Skuid
COO
Nergis
pdf
FiveTran
BigQuery
COO

Binary file not shown.