diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-12-21 00:38:05 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-12-21 00:38:05 +0100 |
commit | ff83f6d332c93c6f5124dfd7ba08bcebab2099e3 (patch) | |
tree | 13fdb3e7036a5df414a453d0840d1a6689f603d0 /fnl | |
parent | 3a04ae4dff27c859f223885109ae7dfa581d56cc (diff) |
Replace packer with lazy
Diffstat (limited to 'fnl')
-rw-r--r-- | fnl/config/autocmd.fnl | 4 | ||||
-rw-r--r-- | fnl/config/packer.fnl | 7 | ||||
-rw-r--r-- | fnl/config/which-key.fnl | 25 | ||||
-rw-r--r-- | fnl/init.fnl | 9 | ||||
-rw-r--r-- | fnl/plugins.fnl | 325 |
5 files changed, 170 insertions, 200 deletions
diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index b76d68e..63b8474 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -2,7 +2,7 @@ (module config.autocmd {autoload {nvim aniseed.nvim env aniseed.env a aniseed.core - : packer}}) + : lazy}}) (defn create-autocmd [event opts] (nvim.create_autocmd event opts)) @@ -49,7 +49,7 @@ {:pattern :plugins.fnl :callback (lambda [] (env.init nvim.g.aniseed#env) - (packer.sync))}) + (lazy.sync))}) (create-autocmd :FileType {:pattern :netrw diff --git a/fnl/config/packer.fnl b/fnl/config/packer.fnl deleted file mode 100644 index f4f44cc..0000000 --- a/fnl/config/packer.fnl +++ /dev/null @@ -1,7 +0,0 @@ -;; Load packer config -(module config.packer {autoload {util config.util}}) - -(let [packer (util.prequire :packer) - packer-util (require :packer.util)] - (packer.init {:display {:open_fn (fn [] - (packer-util.float {:border :rounded}))}})) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index a3b4469..ce5a9cc 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -64,8 +64,7 @@ :b ["<cmd>Telescope git_branches theme=dropdown<cr>" "Checkout branch"] :c ["<cmd>Telescope colorscheme theme=dropdown<cr>" :Colorscheme] - :f ["<cmd>Telescope find_files theme=dropdown<cr>" - "Find files"] + :f ["<cmd>Telescope find_files theme=dropdown<cr>" "Find files"] :t ["<cmd>Telescope live_grep theme=dropdown<cr>" "Find text"] :s [:<cmd>SearchSession<cr> "Find Session"] :S ["<cmd>Telescope grep_string theme=dropdown<cr>" "Find String"] @@ -112,12 +111,16 @@ :S ["<cmd>Telescope lsp_dynamic_workspace_symbols<cr>" "Workspace Symbols"]}) -(def- packer {:name :Packer - :c [:<cmd>PackerCompile<cr> :Compile] - :i [:<cmd>PackerInstall<cr> :Install] - :s [:<cmd>PackerSync<cr> :Sync] - :S [:<cmd>PackerStatus<cr> :Status] - :u [:<cmd>PackerUpdate<cr> :Update]}) +(def- lazy {:name :Lazy + :C ["<cmd>Lazy check<cr>" :Check] + :c ["<cmd>Lazy clean<cr>" :Clean] + :d ["<cmd>Lazy debug<cr>" :Debug] + :h ["<cmd>Lazy home<cr>" :Home] + :i ["<cmd>Lazy install<cr>" :Install] + :l ["<cmd>Lazy log<cr>" :Log] + :p ["<cmd>Lazy profile<cr>" :Profile] + :s ["<cmd>Lazy sync<cr>" :Sync] + :u ["<cmd>Lazy update<cr>" :Update]}) (def- replace {:name :Replace :r [:<cmd>Replace<cr> :Replace] @@ -135,6 +138,7 @@ (def- nmappings {:a ["<cmd>Telescope lsp_document_symbols theme=dropdown<cr>" "Document Symbols"] + :T treesitter :c [:<cmd>Bdelete!<CR> "Close Buffer"] :d diagnostics :f find @@ -142,12 +146,11 @@ :h [:<cmd>ColorizerToggle<cr> :Colorizer] :l lsp :n [:<cmd>CommentNormal<CR> :Comment] - :p packer :r replace - :u [:<cmd>UndotreeToggle<cr> :Undotree] :s [switch-window "Switch window"] :t [:<cmd>ToggleTerm<cr> :Terminal] - :T treesitter + :u [:<cmd>UndotreeToggle<cr> :Undotree] + :y lazy :z [:<cmd>ZenMode<cr> "Zen Mode"]}) (def- vopts {:mode :v diff --git a/fnl/init.fnl b/fnl/init.fnl index d28a351..76c3de9 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -1,8 +1,7 @@ ;; Load plugins with packer. (module init - {autoload {: plugins : packer} - require [settings config.autocmd config.cmd config.packer]}) + {autoload {: plugins } + require [settings config.autocmd config.cmd]}) -(packer.startup (fn [use] - (each [_ plugin (pairs plugins.all)] - (use plugin)))) +(let [lazy (require :lazy)] + (lazy.setup plugins.all)) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 9ae7c01..22ac59f 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -1,50 +1,51 @@ ;; List of plugins. (module plugins) -(def color [{1 :aktersnurra/no-clown-fiesta.nvim - :config (fn [] - (require :config.colorscheme))} - {1 :norcalli/nvim-colorizer.lua - :cmd :ColorizerToggle - :config (fn [] - (require :config.colorizer))} - {1 :nvim-treesitter/nvim-treesitter - :config (fn [] - (require :config.treesitter)) - :run ":TSUpdate"}]) - -(def completions {1 :hrsh7th/nvim-cmp - :requires [{1 :hrsh7th/cmp-buffer} - {1 :onsails/lspkind-nvim} - {1 :hrsh7th/cmp-nvim-lsp} - {1 :hrsh7th/cmp-cmdline} - {1 :L3MON4D3/LuaSnip} - {1 :hrsh7th/cmp-path} - {1 :saadparwaiz1/cmp_luasnip} - {1 :f3fora/cmp-spell}] - :event :InsertEnter - :config (fn [] - (require :config.cmp))}) - -(def core [{1 :Olical/aniseed} - {1 :lewis6991/impatient.nvim} - {1 :wbthomason/packer.nvim}]) - -(def git [{1 :sindrets/diffview.nvim +(def all [;; Color related plugins + {1 :aktersnurra/no-clown-fiesta.nvim + :config (fn [] + (require :config.colorscheme))} + {1 :norcalli/nvim-colorizer.lua + :cmd :ColorizerToggle + :config (fn [] + (require :config.colorizer))} + {1 :nvim-treesitter/nvim-treesitter + :config (fn [] + (require :config.treesitter)) + :run ":TSUpdate"} + ;; Completions + {1 :hrsh7th/nvim-cmp + :dependencies [{1 :hrsh7th/cmp-buffer} + {1 :onsails/lspkind-nvim} + {1 :hrsh7th/cmp-nvim-lsp} + {1 :hrsh7th/cmp-cmdline} + {1 :L3MON4D3/LuaSnip} + {1 :hrsh7th/cmp-path} + {1 :saadparwaiz1/cmp_luasnip} + {1 :f3fora/cmp-spell}] + :event :InsertEnter + :config (fn [] + (require :config.cmp))} + {1 :rafamadriz/friendly-snippets :event :InsertEnter} + ;; ;; Core plugins + {1 :Olical/aniseed} + {1 :folke/lazy.nvim} + ;; Git plugins + {1 :sindrets/diffview.nvim :cmd [:DiffviewFileHistory :DiffviewOpen] :config (fn [] (require :config.diffview))} {1 :TimUntersberger/neogit :cmd :Neogit - :requires [:nvim-lua/plenary.nvim] + :dependencies [:nvim-lua/plenary.nvim] :config (fn [] (require :config.neogit))} {1 :lewis6991/gitsigns.nvim :event :BufRead :config (fn [] - (require :config.gitsigns))}]) - -(def lsp [{1 :williamboman/mason.nvim + (require :config.gitsigns))} + ;; LSP + {1 :williamboman/mason.nvim :event :BufReadPre :config (fn [] (require :config.lsp.mason))} @@ -52,8 +53,8 @@ {1 :jayp0521/mason-null-ls.nvim :after :mason.nvim :event :BufReadPre - :requires [:jose-elias-alvarez/null-ls.nvim - :williamboman/mason.nvim] + :dependencies [:jose-elias-alvarez/null-ls.nvim + :williamboman/mason.nvim] :config (fn [] (require :config.lsp.null-ls) (require :config.lsp.mason-null-ls))} @@ -64,146 +65,120 @@ (require :config.lsp.mason-lspconfig) (let [handlers (require :config.lsp.handlers)] (handlers.setup))) - :requires [:neovim/nvim-lspconfig :williamboman/mason.nvim] + :dependencies [:neovim/nvim-lspconfig :williamboman/mason.nvim] :after :mason.nvim} {1 :folke/trouble.nvim :cmd :TroubleToggle :config (fn [] - (require :config.trouble))}]) - -(def misc [{1 :nvim-orgmode/orgmode - :event :BufWinEnter - :config (fn [] - (require :config.orgmode))} - {1 :moll/vim-bbye :event :BufRead} - {1 :akinsho/toggleterm.nvim - :cmd :ToggleTerm - :config (fn [] - (require :config.toggleterm))} - {1 :dstein64/vim-startuptime :cmd :StartupTime}]) - -(def search [{1 :nvim-telescope/telescope-fzf-native.nvim :run :make} - {1 :nvim-telescope/telescope-frecency.nvim - :requires :tami5/sqlite.lua} - {1 :nvim-telescope/telescope.nvim - :event :VimEnter - :config (fn [] - (require :config.telescope)) - :requires [:nvim-lua/popup.nvim - :nvim-lua/plenary.nvim - :nvim-telescope/telescope-fzf-native.nvim - :nvim-telescope/telescope-frecency.nvim]} - {1 :tamago324/lir.nvim - :config (fn [] - (require :config.lir)) - :requires [:kyazdani42/nvim-web-devicons]} - {1 :ggandor/leap.nvim - :event :BufWinEnter - :config (fn [] - (require :config.leap))} - {1 :ggandor/flit.nvim - :event :BufWinEnter - :config (fn [] - (require :config.flit))} - {1 :ahmedkhalf/project.nvim - :event :BufWinEnter - :requires :nvim-telescope/telescope.nvim - :config (fn [] - (require :config.project))} - {1 :windwp/nvim-spectre - ;; :cmd [:Replace :ReplaceWord :ReplaceInBuf] - :event :BufWinEnter - :config (fn [] - (require :config.spectre))} - {1 :junegunn/vim-slash - :event :BufWinEnter - :config (fn [] - (require :config.vim-slash))} - {1 :ThePrimeagen/harpoon - :event :BufWinEnter - ;; :cmd [:HapoonAdd :HapoonNext :HapoonPrev :HarpoonUI] - :requires :nvim-telescope/telescope.nvim - :config (fn [] - (require :config.harpoon))}]) - -(def session {1 :rmagatti/auto-session - :event :VimEnter - :after :telescope.nvim - :requires [:rmagatti/session-lens :nvim-telescope/telescope.nvim] - :config (fn [] - (require :config.auto-session))}) - -(def snippets [:rafamadriz/friendly-snippets]) - -(def text [{1 :numToStr/Comment.nvim - :event :BufWinEnter - ;; :cmd [:CommentNormal :CommentVisual] - :config (fn [] - (require :config.comment))} - {1 :JoosepAlviste/nvim-ts-context-commentstring :event :BufReadPost} - {1 :kylechui/nvim-surround - :event :InsertEnter - :config (fn [] - (require :config.surround))} - {1 :gbprod/stay-in-place.nvim - :event :InsertEnter - :config (fn [] - (require :config.stay-in-place))} - {1 :cappyzawa/trim.nvim - :event :BufFilePre - :config (fn [] - (require :config.trim))} - {1 :max397574/better-escape.nvim - :event :BufWinEnter - :config (fn [] - (require :config.better-escape))} - {1 :windwp/nvim-autopairs - :event :InsertEnter - :config (fn [] - (require :config.autopairs))} - {1 :mbbill/undotree :cmd :UndotreeToggle}]) - -(def ui [{1 :nvim-lualine/lualine.nvim - :event :BufReadPre - :config (fn [] - (require :config.lualine)) - :requires [:kyazdani42/nvim-web-devicons :arkav/lualine-lsp-progress]} - {1 :aktersnurra/minibar.nvim - :event :BufRead - :config (fn [] - (require :config.minibar))} - {1 :folke/zen-mode.nvim - :cmd :ZenMode - :config (fn [] - (require :config.zen))} - {1 :kevinhwang91/nvim-bqf - :event :BufWinEnter - :config (fn [] - (require :config.bqf))} - {1 :s1n7ax/nvim-window-picker - :event :WinNew - :config (fn [] - (require :config.window-picker))} - {1 :luukvbaal/stabilize.nvim - :event :BufWinEnter - :config (fn [] - (require :config.stabilize))} - {1 :goolord/alpha-nvim - :config (fn [] - (require :config.alpha))} - {1 :folke/which-key.nvim - :event :BufWinEnter - :config (fn [] - (require :config.which-key))}]) - -(def all {: color - : completions - : core - : git - : lsp - : misc - : search - : session - : snippets - : text - : ui}) + (require :config.trouble))} + ;; Misc plugins + {1 :nvim-orgmode/orgmode + :event :BufWinEnter + :config (fn [] + (require :config.orgmode))} + {1 :moll/vim-bbye :event :BufRead} + {1 :akinsho/toggleterm.nvim + :cmd :ToggleTerm + :config (fn [] + (require :config.toggleterm))} + {1 :dstein64/vim-startuptime :cmd :StartupTime} + ;; Search plugins + {1 :nvim-telescope/telescope-fzf-native.nvim :build :make} + {1 :nvim-telescope/telescope-frecency.nvim + :dependencies :tami5/sqlite.lua} + {1 :nvim-telescope/telescope.nvim + :config (fn [] + (require :config.telescope)) + :dependencies [:nvim-lua/popup.nvim + :nvim-lua/plenary.nvim + :nvim-telescope/telescope-fzf-native.nvim + :nvim-telescope/telescope-frecency.nvim]} + {1 :tamago324/lir.nvim + :config (fn [] + (require :config.lir)) + :dependencies [:kyazdani42/nvim-web-devicons]} + {1 :ggandor/leap.nvim + :event :VeryLazy + :config (fn [] + (require :config.leap))} + {1 :ggandor/flit.nvim + :event :VeryLazy + :config (fn [] + (require :config.flit))} + {1 :ahmedkhalf/project.nvim + :event :VeryLazy + :dependencies :nvim-telescope/telescope.nvim + :config (fn [] + (require :config.project))} + {1 :windwp/nvim-spectre + :event :VeryLazy + :config (fn [] + (require :config.spectre))} + {1 :junegunn/vim-slash + :event :BufWinEnter + :config (fn [] + (require :config.vim-slash))} + {1 :ThePrimeagen/harpoon + :event :VeryLazy + :dependencies :nvim-telescope/telescope.nvim + :config (fn [] + (require :config.harpoon))} + ;; Session plugins + {1 :rmagatti/auto-session + :dependencies [:rmagatti/session-lens + :nvim-telescope/telescope.nvim] + :config (fn [] + (require :config.auto-session))} + ;; Text manipulation + {1 :numToStr/Comment.nvim + :cmd [:CommentNormal :CommentVisual] + :config (fn [] + (require :config.comment))} + {1 :JoosepAlviste/nvim-ts-context-commentstring :event :BufReadPost} + {1 :kylechui/nvim-surround + :event :InsertEnter + :config (fn [] + (require :config.surround))} + {1 :gbprod/stay-in-place.nvim + :event :InsertEnter + :config (fn [] + (require :config.stay-in-place))} + {1 :cappyzawa/trim.nvim + :event :BufFilePre + :config (fn [] + (require :config.trim))} + {1 :max397574/better-escape.nvim + :event :VeryLazy + :config (fn [] + (require :config.better-escape))} + {1 :windwp/nvim-autopairs + :event :InsertEnter + :config (fn [] + (require :config.autopairs))} + {1 :mbbill/undotree :cmd :UndotreeToggle} + {1 :nvim-lualine/lualine.nvim + :config (fn [] + (require :config.lualine)) + :dependencies [:kyazdani42/nvim-web-devicons + :arkav/lualine-lsp-progress]} + {1 :aktersnurra/minibar.nvim + :config (fn [] + (require :config.minibar))} + {1 :folke/zen-mode.nvim + :cmd :ZenMode + :config (fn [] + (require :config.zen))} + {1 :kevinhwang91/nvim-bqf + :event :VeryLazy + :config (fn [] + (require :config.bqf))} + {1 :s1n7ax/nvim-window-picker + :event :VeryLazy + :config (fn [] + (require :config.window-picker))} + {1 :goolord/alpha-nvim + :config (fn [] + (require :config.alpha))} + {1 :folke/which-key.nvim + :config (fn [] + (require :config.which-key))}]) |