[NeoVim] The world is now Fennel
This commit is contained in:
21
.config/nvim/fnl/map_utils.fnl
Normal file
21
.config/nvim/fnl/map_utils.fnl
Normal 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
|
||||
Reference in New Issue
Block a user