diff options
Diffstat (limited to 'fnl/config/util.fnl')
-rw-r--r-- | fnl/config/util.fnl | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/fnl/config/util.fnl b/fnl/config/util.fnl index 7665a57..dbd635f 100644 --- a/fnl/config/util.fnl +++ b/fnl/config/util.fnl @@ -1,25 +1,14 @@ ;; Utility functions. (module util {autoload {a aniseed.core nvim aniseed.nvim}}) -(defn prequire [name] - (let [(ok? plugin) (pcall require name)] - (if ok? - plugin - (vim.notify (.. "Could not load config: " plugin) - vim.log.levels.WARN)))) - -(defn setup [plugin config] - (let [plugin (prequire plugin)] - (plugin.setup config))) - (defn telescope-ext [ext fun opts] - (let [telescope (prequire :telescope) - themes (prequire :telescope.themes) + (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 (prequire :telescope.builtin) - themes (prequire :telescope.themes) + (let [telescope (require :telescope.builtin) + themes (require :telescope.themes) theme (. opts :theme)] ((. telescope builtin) ((. themes theme) opts)))) |