From 8ad2f8c9afb308e7a8a1133f578e3352442f770a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 24 Sep 2023 01:12:42 +0200 Subject: Restructure plugin configs --- fnl/plugins/editor/autopairs.fnl | 36 ++++++++++---------- fnl/plugins/editor/better-escape.fnl | 12 +++---- fnl/plugins/editor/bufdel.fnl | 6 ++-- fnl/plugins/editor/cmp.fnl | 25 +++++++------- fnl/plugins/editor/colorizer.fnl | 7 ++-- fnl/plugins/editor/colorscheme.fnl | 14 ++++---- fnl/plugins/editor/comment.fnl | 55 +++++++++++++++--------------- fnl/plugins/editor/dadbod.fnl | 15 ++++---- fnl/plugins/editor/diffview.fnl | 16 +++++---- fnl/plugins/editor/easyread.fnl | 6 ++-- fnl/plugins/editor/harpoon.fnl | 14 ++++---- fnl/plugins/editor/leap.fnl | 17 +++++----- fnl/plugins/editor/lualine.fnl | 7 ++-- fnl/plugins/editor/minibar.fnl | 58 +++++++++++++++---------------- fnl/plugins/editor/neo-tree.fnl | 9 ++--- fnl/plugins/editor/neogit.fnl | 11 +++--- fnl/plugins/editor/orgmode.fnl | 16 ++++----- fnl/plugins/editor/persistence.fnl | 22 ++++++------ fnl/plugins/editor/spectre.fnl | 11 +++--- fnl/plugins/editor/telescope.fnl | 66 +++++++++++++++++++----------------- fnl/plugins/editor/toggleterm.fnl | 10 +++--- fnl/plugins/editor/trouble.fnl | 11 +++--- fnl/plugins/editor/vim-slash.fnl | 8 ++--- fnl/plugins/editor/window-picker.fnl | 22 ++++++------ fnl/plugins/editor/zen.fnl | 23 +++++++------ 25 files changed, 248 insertions(+), 249 deletions(-) (limited to 'fnl/plugins') diff --git a/fnl/plugins/editor/autopairs.fnl b/fnl/plugins/editor/autopairs.fnl index d1aabf6..36e8ba5 100644 --- a/fnl/plugins/editor/autopairs.fnl +++ b/fnl/plugins/editor/autopairs.fnl @@ -1,20 +1,20 @@ ;; Autopairs for brackets and quote symbols. -{1 :windwp/nvim-autopairs - :event :InsertEnter - :opts {:check_ts true - :ts_config {:lua [:string :source] - :javascript [:string :template_string] - :java false} - :disable_filetype [:TelescopePrompt :spectre_panel] - :fast_warp {:map : - :chars ["{" "[" "(" "\"" "'"] - :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") - :check_comma true - :highlight :PmenuSel - :highlight_grey :LineNr - :offset 0 - :end_key "$" - :keys :qwertyuiopzxcvbnmasdfghjkl - :highlight :PmenuSel - :highlight_grey :LineNr}}} +(local opts {:check_ts true + :ts_config {:lua [:string :source] + :javascript [:string :template_string] + :java false} + :disable_filetype [:TelescopePrompt :spectre_panel] + :fast_warp {:map : + :chars ["{" "[" "(" "\"" "'"] + :pattern (string.gsub "[%'%\"%)%>%]%)%}%,]" "%s+" "") + :check_comma true + :highlight :PmenuSel + :highlight_grey :LineNr + :offset 0 + :end_key "$" + :keys :qwertyuiopzxcvbnmasdfghjkl + :highlight :PmenuSel + :highlight_grey :LineNr}}) + +{1 :windwp/nvim-autopairs :event :InsertEnter : opts} diff --git a/fnl/plugins/editor/better-escape.fnl b/fnl/plugins/editor/better-escape.fnl index cde61bc..5bd9b0c 100644 --- a/fnl/plugins/editor/better-escape.fnl +++ b/fnl/plugins/editor/better-escape.fnl @@ -1,8 +1,8 @@ ;; Better escape without nasty delay. -{1 :max397574/better-escape.nvim - :event :BufReadPost - :opts {:mapping [:kk :jj] - :timeout vim.o.timeoutlen - :clear_empty_lines false - :keys :}} +(local opts {:mapping [:kk :jj] + :timeout vim.o.timeoutlen + :clear_empty_lines false + :keys :}) + +{1 :max397574/better-escape.nvim :event :BufReadPost : opts} diff --git a/fnl/plugins/editor/bufdel.fnl b/fnl/plugins/editor/bufdel.fnl index ad40db3..e14287e 100644 --- a/fnl/plugins/editor/bufdel.fnl +++ b/fnl/plugins/editor/bufdel.fnl @@ -1,5 +1,5 @@ ;; Delete buffers. -{1 :ojroques/nvim-bufdel - :cmd :BufDel - :keys [{1 : 2 :BufDel :desc "Close Buffer"}]} +(local keys [{1 : 2 :BufDel :desc "Close Buffer"}]) + +{1 :ojroques/nvim-bufdel :cmd :BufDel : keys} diff --git a/fnl/plugins/editor/cmp.fnl b/fnl/plugins/editor/cmp.fnl index c0ad52a..f3d2906 100644 --- a/fnl/plugins/editor/cmp.fnl +++ b/fnl/plugins/editor/cmp.fnl @@ -1,5 +1,16 @@ ;; Configuration for completion plugin. +(local dependencies [:hrsh7th/cmp-buffer + :onsails/lspkind-nvim + :hrsh7th/cmp-nvim-lsp + :hrsh7th/cmp-cmdline + :petertriho/cmp-git + :L3MON4D3/LuaSnip + :rafamadriz/friendly-snippets + :hrsh7th/cmp-path + :saadparwaiz1/cmp_luasnip + :f3fora/cmp-spell]) + (fn config [] (let [cmp (require :cmp) lspkind (require :lspkind) @@ -52,16 +63,4 @@ :select false} :experimental {:ghost_text false :native_menu false}}))) -{1 :hrsh7th/nvim-cmp - :dependencies [:hrsh7th/cmp-buffer - :onsails/lspkind-nvim - :hrsh7th/cmp-nvim-lsp - :hrsh7th/cmp-cmdline - :petertriho/cmp-git - :L3MON4D3/LuaSnip - :rafamadriz/friendly-snippets - :hrsh7th/cmp-path - :saadparwaiz1/cmp_luasnip - :f3fora/cmp-spell] - :event :InsertEnter - : config} +{1 :hrsh7th/nvim-cmp : dependencies :event :InsertEnter : config} diff --git a/fnl/plugins/editor/colorizer.fnl b/fnl/plugins/editor/colorizer.fnl index 67f05dd..a61b3e5 100644 --- a/fnl/plugins/editor/colorizer.fnl +++ b/fnl/plugins/editor/colorizer.fnl @@ -1,6 +1,5 @@ ;; Display colors of hex numbers. -{1 :norcalli/nvim-colorizer.lua - :cmd :ColorizerToggle - :config true - :keys [{1 :h 2 :ColorizerToggle :desc :Colorizer}]} +(local keys [{1 :h 2 :ColorizerToggle :desc :Colorizer}]) + +{1 :norcalli/nvim-colorizer.lua :cmd :ColorizerToggle :config true : keys} diff --git a/fnl/plugins/editor/colorscheme.fnl b/fnl/plugins/editor/colorscheme.fnl index 146c62f..d3e62cb 100644 --- a/fnl/plugins/editor/colorscheme.fnl +++ b/fnl/plugins/editor/colorscheme.fnl @@ -1,8 +1,10 @@ ;; Load neovim colorscheme. -{1 :aktersnurra/no-clown-fiesta.nvim - :opts {:styles {:type {:bold true} :lsp {:underline false}}} - :config (lambda [_ opts] - (let [plugin (require :no-clown-fiesta)] - (plugin.setup opts) - (plugin.load)))} +(local opts {:styles {:type {:bold true} :lsp {:underline false}}}) + +(lambda config [_ opts] + (let [plugin (require :no-clown-fiesta)] + (plugin.setup opts) + (plugin.load))) + +{1 :aktersnurra/no-clown-fiesta.nvim : opts : config} diff --git a/fnl/plugins/editor/comment.fnl b/fnl/plugins/editor/comment.fnl index f15e61f..66abb33 100644 --- a/fnl/plugins/editor/comment.fnl +++ b/fnl/plugins/editor/comment.fnl @@ -1,36 +1,35 @@ ;; Language aware commenting. +(local opts {:toggler {;; Line-comment toggle keymap + :line :mcc + ;; Block-comment toggle keymap + :block :mbc} + ;; LHS of operator-pending mappings in NORMAL and VISUAL mode + :opleader {;; Line-comment keymap + :line :mc + ;; Block-comment keymap + :block :mb} + ;; LHS of extra mappings + :extra {;; Add comment on the line above + :above :mcO + ;; Add comment on the line below + :below :mco + ;; Add comment at the end of line + :eol :mcA}}) + (local user-cmds [[:CommentNormal - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise.current))) - {:nargs 0}] - [:CommentVisual - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise (vim.fn.visualmode)))) - {:nargs 0}]]) + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise.current))) + {:nargs 0}] + [:CommentVisual + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise (vim.fn.visualmode)))) + {:nargs 0}]]) (fn init [] (let [cmds (require :util.cmds)] (cmds.create-user-cmds user-cmds))) -{1 :numToStr/Comment.nvim - :event :BufReadPost - : inti - :opts {:toggler {;; Line-comment toggle keymap - :line :mcc - ;; Block-comment toggle keymap - :block :mbc} - ;; LHS of operator-pending mappings in NORMAL and VISUAL mode - :opleader {;; Line-comment keymap - :line :mc - ;; Block-comment keymap - :block :mb} - ;; LHS of extra mappings - :extra {;; Add comment on the line above - :above :mcO - ;; Add comment on the line below - :below :mco - ;; Add comment at the end of line - :eol :mcA}}} +{1 :numToStr/Comment.nvim :event :BufReadPost : inti : opts} diff --git a/fnl/plugins/editor/dadbod.fnl b/fnl/plugins/editor/dadbod.fnl index 40220ec..c5ca5ec 100644 --- a/fnl/plugins/editor/dadbod.fnl +++ b/fnl/plugins/editor/dadbod.fnl @@ -1,5 +1,11 @@ ;; Plugins for interacting with databases. +(local dependencies [{1 :tpope/vim-dadbod :lazy true} + {1 :tpope/vim-dotenv :lazy true} + {1 :kristijanhusak/vim-dadbod-completion + :ft [:sql :plsql] + :lazy true}]) + (local keys [{1 :dn 2 :DBUIToggle :mode :n @@ -14,11 +20,4 @@ (set vim.g.db_ui_winwidth 40) (set vim.g.db_ui_notification_width 39)) -{1 :kristijanhusak/vim-dadbod-ui - :dependencies [{1 :tpope/vim-dadbod :lazy true} - {1 :tpope/vim-dotenv :lazy true} - {1 :kristijanhusak/vim-dadbod-completion - :ft [:sql :plsql] - :lazy true}] - : keys - : init} +{1 :kristijanhusak/vim-dadbod-ui : dependencies : keys : init} diff --git a/fnl/plugins/editor/diffview.fnl b/fnl/plugins/editor/diffview.fnl index 4468d96..f041ab6 100644 --- a/fnl/plugins/editor/diffview.fnl +++ b/fnl/plugins/editor/diffview.fnl @@ -1,9 +1,7 @@ ;; Inspect commits. -{1 :sindrets/diffview.nvim - :cmd [:DiffviewFileHistory :DiffviewOpen] - :config true - :keys [{1 :is +(local keys + [{1 :is 2 :DiffviewFileHistory :desc "Repository history" :nowait true} @@ -19,5 +17,11 @@ :desc "Line history"} {1 :ip 2 "'<,'>DiffviewFileHistory --follow" - :desc "Range history" :mode :v} - {1 :ic 2 :DiffviewClose :desc "Close diffview"}]} + :desc "Range history" + :mode :v} + {1 :ic 2 :DiffviewClose :desc "Close diffview"}]) + +{1 :sindrets/diffview.nvim + :cmd [:DiffviewFileHistory :DiffviewOpen] + :config true + : keys} diff --git a/fnl/plugins/editor/easyread.fnl b/fnl/plugins/editor/easyread.fnl index c456726..2652203 100644 --- a/fnl/plugins/editor/easyread.fnl +++ b/fnl/plugins/editor/easyread.fnl @@ -1,5 +1,5 @@ ;; Bionic like reading. -{1 :JellyApple102/easyread.nvim - :keys [{1 "," 2 :EasyreadToggle :desc :Easyread}] - :config true} +(local keys [{1 "," 2 :EasyreadToggle :desc :Easyread}]) + +{1 :JellyApple102/easyread.nvim : keys :config true} diff --git a/fnl/plugins/editor/harpoon.fnl b/fnl/plugins/editor/harpoon.fnl index 8a9818f..0791f98 100644 --- a/fnl/plugins/editor/harpoon.fnl +++ b/fnl/plugins/editor/harpoon.fnl @@ -45,11 +45,9 @@ {}) {:menu {:width (- (vim.api.nvim_win_get_width 0) 4)}}) -{1 :ThePrimeagen/harpoon - :event :BufReadPost - : init - :keys [{1 :ma 2 :HarpoonAdd :desc :Harpoon} - {1 :mr 2 :HarpoonUI :desc "Harpoon UI"} - {1 :ms 2 :HarpoonPrev :desc "Harpoon Prev"} - {1 :mt 2 :HarpoonNext :desc "Harpoon Next"}] - : config} +(local keys [{1 :ma 2 :HarpoonAdd :desc :Harpoon} + {1 :mr 2 :HarpoonUI :desc "Harpoon UI"} + {1 :ms 2 :HarpoonPrev :desc "Harpoon Prev"} + {1 :mt 2 :HarpoonNext :desc "Harpoon Next"}]) + +{1 :ThePrimeagen/harpoon :event :BufReadPost : init : keys : config} diff --git a/fnl/plugins/editor/leap.fnl b/fnl/plugins/editor/leap.fnl index f6d820e..0ea27fd 100644 --- a/fnl/plugins/editor/leap.fnl +++ b/fnl/plugins/editor/leap.fnl @@ -1,16 +1,15 @@ ;; Leap through text. +(local dependencies {1 :ggandor/flit.nvim + :event :BufReadPost + :opts {:keys {:f :f :F :F :t :t :T :T} + :labeled_modes :v + :multiline true + :opts {}}}) + (fn config [] (let [leap (require :leap)] (leap.setup {}) (leap.set_default_keymaps))) -{1 :ggandor/leap.nvim - :dependencies {1 :ggandor/flit.nvim - :event :BufReadPost - :opts {:keys {:f :f :F :F :t :t :T :T} - :labeled_modes :v - :multiline true - :opts {}}} - :event :BufReadPost - : config} +{1 :ggandor/leap.nvim : dependencies :event :BufReadPost : config} diff --git a/fnl/plugins/editor/lualine.fnl b/fnl/plugins/editor/lualine.fnl index 80adf55..06d7fde 100644 --- a/fnl/plugins/editor/lualine.fnl +++ b/fnl/plugins/editor/lualine.fnl @@ -85,7 +85,6 @@ :lualine_z [:location :progress]} :extensions []}) -{1 :nvim-lualine/lualine.nvim - :event :BufReadPost - : opts - :dependencies [:nvim-tree/nvim-web-devicons :arkav/lualine-lsp-progress]} +(local dependencies [:nvim-tree/nvim-web-devicons :arkav/lualine-lsp-progress]) + +{1 :nvim-lualine/lualine.nvim :event :BufReadPost : opts : dependencies} diff --git a/fnl/plugins/editor/minibar.fnl b/fnl/plugins/editor/minibar.fnl index ed80330..d25489c 100644 --- a/fnl/plugins/editor/minibar.fnl +++ b/fnl/plugins/editor/minibar.fnl @@ -1,31 +1,31 @@ ;; Show the filename in the top left corner. -{1 :aktersnurra/minibar.nvim - :event :BufReadPre - :opts {:ignore-filetypes [:help - :harpoon - :startify - :dashboard - :lir - :alpha - :packer - :neogitstatus - :Trouble - :lazy - :netrw - :Outline - :neo-tree - :neo-tree-popup - :NeogitStatus - :NeogitCommitMessage - :NeogitNotification - :NeogitCommitView - :spectre_panel - ""] - :events [:CursorMoved - :TermOpen - :DirChanged - :BufWinEnter - :BufFilePost - :InsertEnter - :BufWritePost]}} +(local opts {:ignore-filetypes [:help + :harpoon + :startify + :dashboard + :lir + :alpha + :packer + :neogitstatus + :Trouble + :lazy + :netrw + :Outline + :neo-tree + :neo-tree-popup + :NeogitStatus + :NeogitCommitMessage + :NeogitNotification + :NeogitCommitView + :spectre_panel + ""] + :events [:CursorMoved + :TermOpen + :DirChanged + :BufWinEnter + :BufFilePost + :InsertEnter + :BufWritePost]}) + +{1 :aktersnurra/minibar.nvim :event :BufReadPre : opts} diff --git a/fnl/plugins/editor/neo-tree.fnl b/fnl/plugins/editor/neo-tree.fnl index 5cef558..99b552c 100644 --- a/fnl/plugins/editor/neo-tree.fnl +++ b/fnl/plugins/editor/neo-tree.fnl @@ -1,5 +1,9 @@ ;; File manager. +(local dependencies [:nvim-lua/plenary.nvim + :nvim-tree/nvim-web-devicons + :MunifTanjim/nui.nvim]) + (local cursorline (require :util.cursorline)) (fn init [] @@ -42,11 +46,8 @@ {1 :nvim-neo-tree/neo-tree.nvim :keys [{1 "-" 2 "Neotree filesystem reveal" :desc "Open Neotree"}] - ; :event :VeryLazy :cmd :Neotree : init : deactivate : opts - :dependencies [:nvim-lua/plenary.nvim - :nvim-tree/nvim-web-devicons - :MunifTanjim/nui.nvim]} + : dependencies} diff --git a/fnl/plugins/editor/neogit.fnl b/fnl/plugins/editor/neogit.fnl index 5a3c5e3..a84c9dd 100644 --- a/fnl/plugins/editor/neogit.fnl +++ b/fnl/plugins/editor/neogit.fnl @@ -1,5 +1,9 @@ ;; Git ui. +(local dependencies [:nvim-lua/plenary.nvim]) + +(local keys [{1 :gm 2 :Neogit :desc :Neogit}]) + (local auto-cmds [[:FileType {:pattern [:NeogitStatus :NeogitCommitMessage @@ -13,9 +17,4 @@ (local opts {:integrations {:diffview true :telescope true}}) -{1 :TimUntersberger/neogit - :cmd :Neogit - : opts - : init - :dependencies [:nvim-lua/plenary.nvim] - :keys [{1 :gm 2 :Neogit :desc :Neogit}]} +{1 :TimUntersberger/neogit :cmd :Neogit : opts : init : dependencies : keys} diff --git a/fnl/plugins/editor/orgmode.fnl b/fnl/plugins/editor/orgmode.fnl index 5324b8d..954e7d4 100644 --- a/fnl/plugins/editor/orgmode.fnl +++ b/fnl/plugins/editor/orgmode.fnl @@ -1,5 +1,11 @@ ;; Orgmode for nvim. +(local keys [{1 :ga 2 :OrgAgendaPrompt :desc "Open agenda prompt"} + {1 :gc 2 :OrgCapturePrompt :desc "Open capture prompt"} + {1 :gm + 2 "Telescope orgmode search_headings theme=dropdown" + :desc "Search headings"}]) + (local user-cmds [[:OrgAgendaPrompt (lambda [] (let [orgmode (require :orgmode)] @@ -40,12 +46,4 @@ (orgmode.setup_ts_grammar) (orgmode.setup opts))) -{1 :nvim-orgmode/orgmode - : config - : init - :event :BufReadPost - :keys [{1 :ga 2 :OrgAgendaPrompt :desc "Open agenda prompt"} - {1 :gc 2 :OrgCapturePrompt :desc "Open capture prompt"} - {1 :gm - 2 "Telescope orgmode search_headings theme=dropdown" - :desc "Search headings"}]} +{1 :nvim-orgmode/orgmode : config : init :event :BufReadPost : keys} diff --git a/fnl/plugins/editor/persistence.fnl b/fnl/plugins/editor/persistence.fnl index 492ef0d..f1e1ecf 100644 --- a/fnl/plugins/editor/persistence.fnl +++ b/fnl/plugins/editor/persistence.fnl @@ -1,5 +1,13 @@ ;; Session manager. +(local keys [{1 :sn 2 :RestoreSession :desc "Restore session"} + {1 :se + 2 :RestoreLastSession + :desc "Restore last session"} + {1 :si + 2 :IgnoreSession + :desc "Ignore current session"}]) + (local user-cmds [[:RestoreSession (lambda [] (let [persistence (require :persistence)] @@ -20,14 +28,6 @@ (let [cmds (require :util.cmds)] (cmds.create-user-cmds user-cmds))) -{1 :folke/persistence.nvim - :event :VeryLazy - : init - :keys [{1 :sn 2 :RestoreSession :desc "Restore session"} - {1 :se - 2 :RestoreLastSession - :desc "Restore last session"} - {1 :si - 2 :IgnoreSession - :desc "Ignore current session"}] - :opts {:options [:buffers :curdir :tabpages :winsize :help]}} +(local opts {:options [:buffers :curdir :tabpages :winsize :help]}) + +{1 :folke/persistence.nvim :event :VeryLazy : init : keys : opts} diff --git a/fnl/plugins/editor/spectre.fnl b/fnl/plugins/editor/spectre.fnl index 81cc77c..c7307f8 100644 --- a/fnl/plugins/editor/spectre.fnl +++ b/fnl/plugins/editor/spectre.fnl @@ -78,10 +78,9 @@ :is_open_target_win true :is_insert_mode false}) -{1 :windwp/nvim-spectre - :event :BufReadPost - : init - :keys [{1 :rn 2 :ReplaceInBuf :desc "Replace in Buffer"} +(local keys + [{1 :rn 2 :ReplaceInBuf :desc "Replace in Buffer"} {1 :re 2 :Replace :desc :Replace} - {1 :ri 2 :ReplaceWord :desc "Replace Word"}] - : opts} + {1 :ri 2 :ReplaceWord :desc "Replace Word"}]) + +{1 :windwp/nvim-spectre :event :BufReadPost : init : keys : opts} diff --git a/fnl/plugins/editor/telescope.fnl b/fnl/plugins/editor/telescope.fnl index 83cb4a1..720c69c 100644 --- a/fnl/plugins/editor/telescope.fnl +++ b/fnl/plugins/editor/telescope.fnl @@ -1,5 +1,34 @@ ;; Telescope a highly extendable fuzzy finder over lists. +(local dependencies [:nvim-lua/popup.nvim + :nvim-telescope/telescope-frecency.nvim + {1 :nvim-telescope/telescope-fzf-native.nvim :build :make} + :tami5/sqlite.lua + {1 :ahmedkhalf/project.nvim + :event :VeryLazy + :opts {:active true + :on_config_done nil + :manual_mode false + :detection_methods [:patterns] + :patterns [:git + :_darcs + :.hg + :.bzr + :.svn + :Makefile + :package.json] + :show_hidden false + :silent_chdir true + :ignore_lsp {} + :datapath (vim.fn.stdpath :data)} + :config (lambda [_ opts] + (let [project (require :project_nvim)] + (project.setup opts)))} + :nvim-lua/plenary.nvim + :nvim-telescope/telescope-fzf-native.nvim + :nvim-telescope/telescope-frecency.nvim + :joaomsa/telescope-orgmode.nvim]) + (local extensions [:fzf :frecency :orgmode :projects :git_worktree :harpoon]) (fn load-extensions [telescope] @@ -13,10 +42,10 @@ ((. telescope builtin) ((. themes theme) opts)))) (local user-cmds [[:FindFiles - (lambda [] - (telescope-builtin :find_files - {:theme :get_dropdown :previewer false})) - {:nargs 0}]]) + (lambda [] + (telescope-builtin :find_files + {:theme :get_dropdown :previewer false})) + {:nargs 0}]]) (fn init [] (let [cmds (require :util.cmds)] @@ -158,32 +187,5 @@ :cmd :Telescope : init : config - :dependencies [:nvim-lua/popup.nvim - :nvim-telescope/telescope-frecency.nvim - {1 :nvim-telescope/telescope-fzf-native.nvim :build :make} - :tami5/sqlite.lua - {1 :ahmedkhalf/project.nvim - :event :VeryLazy - :opts {:active true - :on_config_done nil - :manual_mode false - :detection_methods [:patterns] - :patterns [:git - :_darcs - :.hg - :.bzr - :.svn - :Makefile - :package.json] - :show_hidden false - :silent_chdir true - :ignore_lsp {} - :datapath (vim.fn.stdpath :data)} - :config (lambda [_ opts] - (let [project (require :project_nvim)] - (project.setup opts)))} - :nvim-lua/plenary.nvim - :nvim-telescope/telescope-fzf-native.nvim - :nvim-telescope/telescope-frecency.nvim - :joaomsa/telescope-orgmode.nvim] + : dependencies : keys} diff --git a/fnl/plugins/editor/toggleterm.fnl b/fnl/plugins/editor/toggleterm.fnl index 9c2c5dc..edfb9dc 100644 --- a/fnl/plugins/editor/toggleterm.fnl +++ b/fnl/plugins/editor/toggleterm.fnl @@ -1,5 +1,9 @@ ;; Terminal inside nvim. +(local keys [{1 :t 2 :ToggleTerm :desc :Terminal}]) + +(local opts {:size 24 :shade_terminals false}) + (local auto-cmds [[:TermOpen {:pattern "term://*toggleterm#*" :callback (fn [] @@ -19,8 +23,4 @@ (let [cmds (require :util.cmds)] (cmds.create-auto-cmds auto-cmds))) -{1 :akinsho/toggleterm.nvim - :cmd :ToggleTerm - : init - :keys [{1 :t 2 :ToggleTerm :desc :Terminal}] - :opts {:size 24 :shade_terminals false}} +{1 :akinsho/toggleterm.nvim :cmd :ToggleTerm : init : keys : opts} diff --git a/fnl/plugins/editor/trouble.fnl b/fnl/plugins/editor/trouble.fnl index f0996fd..b9a4e3c 100644 --- a/fnl/plugins/editor/trouble.fnl +++ b/fnl/plugins/editor/trouble.fnl @@ -1,5 +1,9 @@ ;; Pretty diagnostics. +(local keys [{1 :jt + 2 "TroubleToggle workspace_diagnostics" + :desc :Trouble}]) + (local opts {:position :bottom ; position of the list can be: bottom, top, left, right :height 10 @@ -70,9 +74,4 @@ ;; for the given modes, automatically jump if there is only a single result :use_diagnostic_signs true}) -{1 :folke/trouble.nvim - :cmd [:TroubleToggle :Trouble] - : opts - :keys [{1 :jt - 2 "TroubleToggle workspace_diagnostics" - :desc :Trouble}]} +{1 :folke/trouble.nvim :cmd [:TroubleToggle :Trouble] : opts : keys} diff --git a/fnl/plugins/editor/vim-slash.fnl b/fnl/plugins/editor/vim-slash.fnl index 6f50ae4..e638d73 100644 --- a/fnl/plugins/editor/vim-slash.fnl +++ b/fnl/plugins/editor/vim-slash.fnl @@ -1,6 +1,6 @@ ;; Provides a set of mappings for enhancing in-buffer search experience. -{1 :junegunn/vim-slash - :event :BufReadPost - :config (fn [] - (vim.cmd "noremap (slash-after) zz"))} +(fn config [] + (vim.cmd "noremap (slash-after) zz")) + +{1 :junegunn/vim-slash :event :BufReadPost : config} diff --git a/fnl/plugins/editor/window-picker.fnl b/fnl/plugins/editor/window-picker.fnl index 2820409..2d4b335 100644 --- a/fnl/plugins/editor/window-picker.fnl +++ b/fnl/plugins/editor/window-picker.fnl @@ -1,19 +1,19 @@ ;; Trim whitespaces on save. +(local opts {:other_win_hl_color "#171717" + :fg_color "#E1E1E1" + :selection_chars :MNEIOARSTG}) + (fn pick-window [opts] (let [window-picker (require :window-picker)] (let [win (window-picker.pick_window)] (if (not= win nil) (vim.api.nvim_set_current_win win))))) -{1 :s1n7ax/nvim-window-picker - :event :BufReadPost - :opts {:other_win_hl_color "#171717" - :fg_color "#E1E1E1" - :selection_chars :MNEIOARSTG} - :config (lambda [_ opts] - (let [window-picker (require :window-picker)] - (window-picker.setup opts) - (vim.keymap.set :n : - (fn [] - (pick-window)) {})))} +(lambda config [_ opts] + (let [window-picker (require :window-picker)] + (window-picker.setup opts) + (vim.keymap.set :n : (fn [] + (pick-window)) {}))) + +{1 :s1n7ax/nvim-window-picker :event :BufReadPost : opts : config} diff --git a/fnl/plugins/editor/zen.fnl b/fnl/plugins/editor/zen.fnl index 4462a3d..d3f83cd 100644 --- a/fnl/plugins/editor/zen.fnl +++ b/fnl/plugins/editor/zen.fnl @@ -1,12 +1,15 @@ ;; Zen mode. -{1 :folke/zen-mode.nvim - :cmd :ZenMode - :keys [{1 :/ 2 :ZenMode :desc "Zen Mode"}] - :opts {:window {:backdrop 1 - :height 1 - :width 120 - :options {:signcolumn :no :number false :relativenumber false}} - :plugins {:gitsigns {:enabled false} - :tmux {:enabled true} - :twilight {:enabled true}}}} +(local opts {:window {:backdrop 1 + :height 1 + :width 120 + :options {:signcolumn :no + :number false + :relativenumber false}} + :plugins {:gitsigns {:enabled false} + :tmux {:enabled true} + :twilight {:enabled true}}}) + +(local keys [{1 :/ 2 :ZenMode :desc "Zen Mode"}]) + +{1 :folke/zen-mode.nvim :cmd :ZenMode : keys : opts} -- cgit v1.2.3-70-g09d2