From 909150606eab44979eb9595145796f5bcb067955 Mon Sep 17 00:00:00 2001 From: tobdob Date: Tue, 18 Oct 2022 10:56:36 +0200 Subject: [PATCH] add boolean config options for common patterns (#14) --- README.md | 16 ++++++---------- lua/trim/config.lua | 8 ++++---- lua/trim/init.lua | 13 +++++++++++++ lua/trim/trimmer.lua | 2 +- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d77a1f4..801adad 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,10 @@ Plug 'cappyzawa/trim.nvim' -- default config local config = { disable = {}, - patterns = { - [[%s/\s\+$//e]], -- remove unwanted spaces - [[%s/\($\n\s*\)\+\%$//]], -- trim last line - [[%s/\%^\n\+//]], -- trim first line - [[%s/\(\n\n\)\n\+/\1/]], -- replace multiple blank lines with a single line - }, + patterns = {}, + trim_trailing = true, + trim_last_line = true, + trim_first_line = true, } ``` @@ -37,11 +35,9 @@ lua <