diff options
Diffstat (limited to 'fnl/nvrc')
-rw-r--r-- | fnl/nvrc/macro/pack.fnl | 43 | ||||
-rw-r--r-- | fnl/nvrc/pack.fnl | 30 |
2 files changed, 22 insertions, 51 deletions
diff --git a/fnl/nvrc/macro/pack.fnl b/fnl/nvrc/macro/pack.fnl index 7f76a0d..074723e 100644 --- a/fnl/nvrc/macro/pack.fnl +++ b/fnl/nvrc/macro/pack.fnl @@ -7,16 +7,14 @@ (fn tbl? [x] (= :table (type x))) -(local {: format} string) (local {: insert} table) (global nvrc/pack []) -(global nvrc/rock []) (lambda pack [identifier ?options] "Returns a mixed table with the identifier as the first sequential element and options as hash-table items. - See https://github.com/wbthomason/packer.nvim for information about the + See https://github.com/folke/lazy.nvim for information about the options." (assert-compile (str? identifier) "expected string for identifier" identifier) (assert-compile (or (nil? ?options) (tbl? ?options)) @@ -24,8 +22,8 @@ (let [options (or ?options {}) options (collect [k v (pairs options)] (if - (= k :req) (values :config (format "require('nvrc.packs.%s')" v)) - (= k :init) (values :config (format "require('%s').setup({})" v)) + (= k :req) (values :config `#(require (string.format "nvrc.packs.%s" ,v))) + (= k :init) (values :config `#((. (require ,v) :setup) {})) (values k v)))] (doto options (tset 1 identifier)))) @@ -33,47 +31,20 @@ (lambda pack! [identifier ?options] "Declares a plugin with its options. This is a mixed table saved on the global compile-time variable nvrc/pack. - See https://github.com/wbthomason/packer.nvim for information about the + See https://github.com/folke/lazy.nvim for information about the options." (assert-compile (str? identifier) "expected string for identifier" identifier) (assert-compile (or (nil? ?options) (tbl? ?options)) "expected table for options" ?options) (insert nvrc/pack (pack identifier ?options))) -(lambda rock [identifier ?options] - "Returns a mixed table with the identifier as the first sequential element - and options as hash-table items. - See https://github.com/wbthomason/packer.nvim for information about the - options." - (assert-compile (str? identifier) "expected string for identifier" identifier) - (assert-compile (or (nil? ?options) (tbl? ?options)) - "expected table for options" ?options) - (let [options (or ?options {})] - (doto options - (tset 1 identifier)))) - -(lambda rock! [identifier ?options] - "Declares a plugin with its options. - This is a mixed table saved on the global compile-time variable nvrc/rock. - See https://github.com/wbthomason/packer.nvim for information about the - options." - (assert-compile (str? identifier) "expected string for identifier" identifier) - (assert-compile (or (nil? ?options) (tbl? ?options)) - "expected table for options" ?options) - (insert nvrc/rock (rock identifier ?options))) - (lambda unpack! [] "Initializes the plugin manager with the previously declared plugins and their options." - (let [packs (icollect [_ v (ipairs nvrc/pack)] - `(use ,v)) - rocks (icollect [_ v (ipairs nvrc/rock)] - `(use_rocks ,v))] - `((. (require :packer) :startup) #(do - ,(unpack (icollect [_ v (ipairs packs) :into rocks] v)))))) + (let [packs [(unpack (icollect [_ v (ipairs nvrc/pack)] + v))]] + `((. (require :lazy) :setup) ,packs))) {: pack : pack! - : rock - : rock! : unpack!} diff --git a/fnl/nvrc/pack.fnl b/fnl/nvrc/pack.fnl index f0c2104..15481b3 100644 --- a/fnl/nvrc/pack.fnl +++ b/fnl/nvrc/pack.fnl @@ -1,26 +1,24 @@ (import-macros {: pack : pack! : unpack!} :nvrc.macro.pack) (import-macros {: setv!} :nvrc.macro.set) -(pack! :wbthomason/packer.nvim) +(pack! :folke/lazy.nvim) (pack! :rktjmp/hotpot.nvim) -(pack! :nanotech/jellybeans.vim {:config "require('nvrc.colors').apply('jellybeans')"}) +(pack! :nanotech/jellybeans.vim {:config #((. (require :nvrc.colors) :apply) :jellybeans)}) (pack! :kvrohit/rasmus.nvim) (pack! :nvim-treesitter/nvim-treesitter {:req :treesitter - :requires [(pack :nvim-treesitter/nvim-treesitter-refactor {:after :nvim-treesitter}) - (pack :nvim-treesitter/nvim-treesitter-textobjects {:after :nvim-treesitter})]}) + :dependencies [(pack :nvim-treesitter/nvim-treesitter-refactor) + (pack :nvim-treesitter/nvim-treesitter-textobjects)]}) (pack! :antoinemadec/FixCursorHold.nvim) (pack! :justinmk/vim-dirvish) (pack! :neovim/nvim-lspconfig {:req :lspconfig - :requires [(pack :hrsh7th/cmp-nvim-lsp {:after :nvim-cmp}) - (pack :j-hui/fidget.nvim {:req :fidget :after :nvim-lspconfig :branch :legacy}) ; FIXME: Compatibility during rewrite - (pack :hrsh7th/cmp-nvim-lsp-signature-help {:after :cmp-nvim-lsp})]}) -(pack! :simrat39/rust-tools.nvim {:req :rust :ft :rust :requires [(pack :nvim-lua/plenary.nvim)]}) -(pack! :p00f/clangd_extensions.nvim {:req :clangd :ft [:c :cpp :objc :objcpp] :module :clangd_extensions}) -(pack! :mfussenegger/nvim-dap {:req :dap :requires [(pack :nvim-lua/plenary.nvim)]}) -(pack! :rcarriga/nvim-dap-ui {:init :dapui :requires [(pack :mfussenegger/nvim-dap)]}) + :dependencies [(pack :j-hui/fidget.nvim {:req :fidget :branch :legacy})]}) +(pack! :simrat39/rust-tools.nvim {:req :rust :ft :rust :dependencies [(pack :nvim-lua/plenary.nvim)]}) +(pack! :p00f/clangd_extensions.nvim {:req :clangd :ft [:c :cpp :objc :objcpp]}) +(pack! :mfussenegger/nvim-dap {:req :dap :dependencies [(pack :nvim-lua/plenary.nvim) + (pack :rcarriga/nvim-dap-ui {:init :dapui})]}) (pack! :gpanders/editorconfig.nvim) (pack! :stefandtw/quickfix-reflector.vim {:ft :qf}) (pack! :tpope/vim-fugitive) @@ -28,10 +26,12 @@ (pack! :tpope/vim-sleuth) (pack! :hrsh7th/nvim-cmp {:req :cmp :event :BufEnter - :requires [(pack :L3MON4D3/LuaSnip {:module :luasnip}) - (pack :lukas-reineke/cmp-under-comparator {:module :cmp-under-comparator})]}) -(pack! :numToStr/Comment.nvim {:module :Comment :init :Comment}) -(pack! :ibhagwan/fzf-lua {:req :fzf :module :fzf-lua}) + :dependencies [(pack :L3MON4D3/LuaSnip) + (pack :lukas-reineke/cmp-under-comparator) + (pack :hrsh7th/cmp-nvim-lsp {:after :nvim-cmp}) + (pack :hrsh7th/cmp-nvim-lsp-signature-help)]}) +(pack! :numToStr/Comment.nvim {:init :Comment}) +(pack! :ibhagwan/fzf-lua {:req :fzf}) (pack! :ggandor/leap.nvim {:req :leap}) (pack! :windwp/nvim-autopairs {:req :autopairs}) |