summaryrefslogtreecommitdiff
path: root/fnl/config/util.fnl
blob: e2800a699a88b312bc0c5ae082d7f31500226378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
;; Utility functions.
(module util {autoload {a aniseed.core nvim aniseed.nvim}})

(defn telescope-ext [ext fun opts]
      (let [telescope (require :telescope)
            themes (require :telescope.themes)
            theme (. opts :theme)]
        ((. (. (. telescope :extensions) ext) fun) ((. themes theme) opts))))

(defn telescope-builtin [builtin opts]
      (let [telescope (require :telescope.builtin)
            themes (require :telescope.themes)
            theme (. opts :theme)]
        ((. telescope builtin) ((. themes theme) opts))))

(defn load [plugins]
  (let [configs []]
    (each [_ plugin (pairs plugins)]
      (table.insert configs (require plugin)))
    configs))