[NeoVim] The world is now Fennel

This commit is contained in:
2022-08-24 01:59:24 +02:00
parent 3941e53268
commit 623b7fb584
6 changed files with 96 additions and 151 deletions

View File

@@ -0,0 +1,21 @@
(local M {})
(local module_name "map_utils")
(local fn_store [])
(fn register_fn [new_fn]
(do (table.insert fn_store new_fn)
(length fn_store)))
(fn M.apply_function [id]
((. fn_store id)))
(fn M.apply_expr [id]
(vim.api.nvim_replace_termcodes ((. fn_store id)) true true true))
(fn M.lua_fn [lfn]
(string.format "<cmd>lua require('%s').apply_function(%s)<CR>" module_name (register_fn lfn)))
(fn M.lua_expr [lfn]
(string.format "v:lua.require'%s'.apply_expr(%s)" module_name (register_fn lfn)))
M