this repo has no description
at master 548 B view raw
1(fn compile-heurestic [spec] 2 (let [wrap #(if (= (type $1) :table) $1 [$1])] 3 (table.concat (icollect [_ v (ipairs (wrap spec))] (table.concat (wrap v) "&")) "|"))) 4 5(fn projection [guards spec] 6 ; Guard for empty variable 7 (let [heurestic (compile-heurestic guards)] 8 (when (= vim.g.projectionist_heuristics nil) (set vim.g.projectionist_heuristics {})) 9 {heurestic spec})) 10 11(fn template [name] 12 (let [[name] (vim.api.nvim_get_runtime_file (.. "templates/" name ".tpl") false)] 13 (vim.fn.readfile name))) 14 15{: projection : template}