summaryrefslogtreecommitdiff
path: root/dot_config/nvim/fnl/toast
diff options
context:
space:
mode:
authorChloƩ Vulquin <code@toast.bunkerlabs.net>2024-08-06 14:11:59 +0200
committerChloƩ Vulquin <code@toast.bunkerlabs.net>2024-08-06 14:11:59 +0200
commit7425eda3e544fcb1ce81a09c5ff49d839e58ac94 (patch)
treee74368e016160f5c7aa5b532b46c9190e21fc32e /dot_config/nvim/fnl/toast
parentnvim: expand .lua gitattributes, mark as non-diffable (diff)
nvim: rework lsp module
There's still some improvements to be made, but this is cleaner. We lose global caps defaults, but those made no sense to begin with. We do also lose caps overrides, I'll add them back in if I need them. In the process, we gain `every?` and `executable?`. There's also a misc comp print vim.inspect to vim.print change.
Diffstat (limited to '')
-rw-r--r--dot_config/nvim/fnl/toast/core.fnl8
-rw-r--r--dot_config/nvim/fnl/toast/nvim.fnl7
2 files changed, 15 insertions, 0 deletions
diff --git a/dot_config/nvim/fnl/toast/core.fnl b/dot_config/nvim/fnl/toast/core.fnl
index 2a426d1..82b0c40 100644
--- a/dot_config/nvim/fnl/toast/core.fnl
+++ b/dot_config/nvim/fnl/toast/core.fnl
@@ -19,6 +19,13 @@
"Returns true if the argument is a number."
(= :number (type n)))
+(fn every? [pred xs]
+ "Returns true if (pred x) is logical true for every x in xs, else false."
+ (accumulate [pass true
+ _ x (ipairs xs)
+ &until (not pass)]
+ (pred x)))
+
; sequences
(fn drop [n xs]
"Returns a table of all but the first n elements in xs."
@@ -81,6 +88,7 @@
: empty?
: nil?
: number?
+ : every?
; sequences
: drop
: first
diff --git a/dot_config/nvim/fnl/toast/nvim.fnl b/dot_config/nvim/fnl/toast/nvim.fnl
new file mode 100644
index 0000000..fddc0e7
--- /dev/null
+++ b/dot_config/nvim/fnl/toast/nvim.fnl
@@ -0,0 +1,7 @@
+(local {: every?} (require :toast.core))
+
+(fn executable? [& paths]
+ "Check if every argument specified is an executable that neovim can resolve."
+ (every? #(not= 0 (vim.fn.executable $)) paths))
+
+{: executable?}