summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-17 01:36:07 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-04-17 01:36:07 +0200
commit9e654a8936ca3c8efd3f28d1987a599c2f59796d (patch)
tree791add5153a1f946f9d181645a76ba7a343fc9e3
parent54cbb0bee9e3ae4020ea08276f0644a410ee047b (diff)
feat(trim): add plugin
-rw-r--r--fnl/config/init.fnl1
-rw-r--r--fnl/config/trim.fnl13
2 files changed, 14 insertions, 0 deletions
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/"
+ ]
+}))