dots-of-war/files/.config/nvim/fnl/macros.fnl

50 lines
832 B
Text
Raw Normal View History

2021-04-02 17:54:14 +00:00
{:augroup
(fn [name ...]
`(do
(nvim.ex.augroup ,(tostring name))
(nvim.ex.autocmd_)
,...
(nvim.ex.augroup :END)))
:autocmd
(fn [...]
`(nvim.ex.autocmd ,...))
:_:
(fn [name ...]
`((. nvim.ex ,(tostring name)) ,...))
:viml->fn
(fn [name]
2021-05-01 13:20:02 +00:00
`(.. "lua require('" *module-name* "')['" ,(tostring name) "']()"))
:dbg-call
(fn [x ...]
`(do
(a.println ,...)
(,x ,...)))
:pkg
(fn [name mappings ...]
2021-05-08 18:18:22 +00:00
;(if (~= nil (. packer_plugins `,(tostring name)))
(if true
2021-05-06 17:35:35 +00:00
`(let ,mappings ,...)
2021-05-08 17:31:04 +00:00
(print (.. "plugin disabled " `,(tostring name)))))
:each-pair
(fn [args ...]
(let [[l# r# d#] args]
`(let [data# ,d#]
(for [i# 1 (a.count data#) 2]
(let [,l# (. data# i#)
,r# (. data# (+ i# 1))]
,...)))))}
2021-05-01 13:20:02 +00:00