From 9e654a8936ca3c8efd3f28d1987a599c2f59796d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 17 Apr 2022 01:36:07 +0200 Subject: feat(trim): add plugin --- fnl/config/init.fnl | 1 + fnl/config/trim.fnl | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 fnl/config/trim.fnl (limited to 'fnl/config') diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 3ccff7d..7299f0b 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -20,4 +20,5 @@ _ config.treesitter _ config.which-key _ config.zen + _ config.trim _ config.lsp}}) diff --git a/fnl/config/trim.fnl b/fnl/config/trim.fnl new file mode 100644 index 0000000..156241f --- /dev/null +++ b/fnl/config/trim.fnl @@ -0,0 +1,13 @@ +;; Trim whitespaces on save. +(module config.trim {autoload {util util}}) + +(let [trim (util.load-plugin :trim)] + (trim.setup { + :disable [] + :patterns [ + "%s/\s\+$//e" + "%s/\($\n\s*\)\+\%$//" + "%s/\%^\n\+//" + "%s/\(\n\n\)\n\+/\1/" + ] +})) -- cgit v1.2.3-70-g09d2