diff options
| author | 2024-07-24 19:19:26 +0200 | |
|---|---|---|
| committer | 2024-07-24 19:19:26 +0200 | |
| commit | 01586921b3d5f2ac1ccf8196d3ad9b4b3ddd31f3 (patch) | |
| tree | d740ac5e8943e48ee4132efc4633051d6cdf1d48 /dot_config/nvim/lua/toast | |
| parent | nvim: ignore lazy-lock.json (diff) | |
nvim: rewrite config in fennel
One file isn't done, and there's also the question of ftplugin and co.
One step at a time though, eh?
Diffstat (limited to 'dot_config/nvim/lua/toast')
| -rw-r--r-- | dot_config/nvim/lua/toast/core.lua | 63 | ||||
| -rw-r--r-- | dot_config/nvim/lua/toast/table.lua | 16 |
2 files changed, 79 insertions, 0 deletions
diff --git a/dot_config/nvim/lua/toast/core.lua b/dot_config/nvim/lua/toast/core.lua new file mode 100644 index 0000000..c666faa --- /dev/null +++ b/dot_config/nvim/lua/toast/core.lua @@ -0,0 +1,63 @@ +-- [nfnl] Compiled from fnl/toast/core.fnl by https://github.com/Olical/nfnl, do not edit. +local _local_1_ = require("toast.table") +local insert = _local_1_["insert"] +local function dec(n) + return (n - 1) +end +local function inc(n) + return (n + 1) +end +local function drop(n, xs) + local out = {} + for i, v in ipairs(xs) do + if (i > n) then + insert(out, v) + else + end + end + return out +end +local function first(xs) + return xs[1] +end +local function last(xs) + return xs[#xs] +end +local function group(n, xs) + local ll + local function _3_(_241) + return #last(_241) + end + ll = _3_ + local donext + local function _4_(_241) + return (ll(_241) == n) + end + donext = _4_ + local out = {{}} + for _, v in ipairs(xs) do + if donext(out) then + insert(out, {}) + else + end + insert(last(out), v) + out = out + end + return out +end +local function map(f, xs) + local out = {} + for _, v in ipairs(xs) do + local mapped = f(v) + local function _6_() + if (0 == select("#", mapped)) then + return nil + else + return mapped + end + end + out = insert(out, _6_()) + end + return out +end +return {dec = dec, inc = inc, drop = drop, group = group, first = first, last = last} diff --git a/dot_config/nvim/lua/toast/table.lua b/dot_config/nvim/lua/toast/table.lua new file mode 100644 index 0000000..b2633a2 --- /dev/null +++ b/dot_config/nvim/lua/toast/table.lua @@ -0,0 +1,16 @@ +-- [nfnl] Compiled from fnl/toast/table.fnl by https://github.com/Olical/nfnl, do not edit. +local function from_pairs(t, _3fmut) + local out = (_3fmut or {}) + for _, _1_ in ipairs(t) do + local _each_2_ = _1_ + local k = _each_2_[1] + local v = _each_2_[2] + out[k] = v + end + return out +end +local function insert(t, ...) + table.insert(t, ...) + return t +end +return {["from-pairs"] = from_pairs, insert = insert} |
