From 7425eda3e544fcb1ce81a09c5ff49d839e58ac94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Tue, 6 Aug 2024 14:11:59 +0200 Subject: 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. --- dot_config/nvim/lua/toast/core.lua | 10 +++++++++- dot_config/nvim/lua/toast/nvim.lua | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 dot_config/nvim/lua/toast/nvim.lua (limited to 'dot_config/nvim/lua/toast') diff --git a/dot_config/nvim/lua/toast/core.lua b/dot_config/nvim/lua/toast/core.lua index b2a2e95..6daae14 100644 --- a/dot_config/nvim/lua/toast/core.lua +++ b/dot_config/nvim/lua/toast/core.lua @@ -17,6 +17,14 @@ end local function number_3f(n) return ("number" == type(n)) end +local function every_3f(pred, xs) + local pass = true + for _, x in ipairs(xs) do + if not pass then break end + pass = pred(x) + end + return pass +end local function drop(n, xs) local out = {} for i, v in ipairs(xs) do @@ -115,4 +123,4 @@ local function map(f, xs) end return out end -return {dec = dec, inc = inc, ["empty?"] = empty_3f, ["nil?"] = nil_3f, ["number?"] = number_3f, drop = drop, first = first, last = last, group = group, assoc = assoc, map = map} +return {dec = dec, inc = inc, ["empty?"] = empty_3f, ["nil?"] = nil_3f, ["number?"] = number_3f, ["every?"] = every_3f, drop = drop, first = first, last = last, group = group, assoc = assoc, map = map} diff --git a/dot_config/nvim/lua/toast/nvim.lua b/dot_config/nvim/lua/toast/nvim.lua new file mode 100644 index 0000000..a46b92a --- /dev/null +++ b/dot_config/nvim/lua/toast/nvim.lua @@ -0,0 +1,11 @@ +-- [nfnl] Compiled from fnl/toast/nvim.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("toast.core") +local every_3f = _local_1_["every?"] +local function executable_3f(...) + local paths = {...} + local function _2_(_241) + return (0 ~= vim.fn.executable(_241)) + end + return every_3f(_2_, paths) +end +return {["executable?"] = executable_3f} -- cgit v1.2.3