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/trim.fnl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 fnl/config/trim.fnl (limited to 'fnl/config/trim.fnl') 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