summaryrefslogtreecommitdiff
path: root/fnl/plugins
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-24 01:12:42 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-24 01:12:42 +0200
commit8ad2f8c9afb308e7a8a1133f578e3352442f770a (patch)
treea7a05ed7c472f186d6380dd918e2318d6d951330 /fnl/plugins
parentfd69ec549594d53b9503212d93a9a44f10eef478 (diff)
Restructure plugin configs
Diffstat (limited to 'fnl/plugins')
-rw-r--r--fnl/plugins/editor/autopairs.fnl36
-rw-r--r--fnl/plugins/editor/better-escape.fnl12
-rw-r--r--fnl/plugins/editor/bufdel.fnl6
-rw-r--r--fnl/plugins/editor/cmp.fnl25
-rw-r--r--fnl/plugins/editor/colorizer.fnl7
-rw-r--r--fnl/plugins/editor/colorscheme.fnl14
-rw-r--r--fnl/plugins/editor/comment.fnl55
-rw-r--r--fnl/plugins/editor/dadbod.fnl15
-rw-r--r--fnl/plugins/editor/diffview.fnl16
-rw-r--r--fnl/plugins/editor/easyread.fnl6
-rw-r--r--fnl/plugins/editor/harpoon.fnl14
-rw-r--r--fnl/plugins/editor/leap.fnl17
-rw-r--r--fnl/plugins/editor/lualine.fnl7
-rw-r--r--fnl/plugins/editor/minibar.fnl58
-rw-r--r--fnl/plugins/editor/neo-tree.fnl9
-rw-r--r--fnl/plugins/editor/neogit.fnl11
-rw-r--r--fnl/plugins/editor/orgmode.fnl16
-rw-r--r--fnl/plugins/editor/persistence.fnl22
-rw-r--r--fnl/plugins/editor/spectre.fnl11
-rw-r--r--fnl/plugins/editor/telescope.fnl66
-rw-r--r--fnl/plugins/editor/toggleterm.fnl10
-rw-r--r--fnl/plugins/editor/trouble.fnl11
-rw-r--r--fnl/plugins/editor/vim-slash.fnl8
-rw-r--r--fnl/plugins/editor/window-picker.fnl22
-rw-r--r--fnl/plugins/editor/zen.fnl23
25 files changed, 248 insertions, 249 deletions
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 :<M-e>
- :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 :<M-e>
+ :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 :<Esc>}}
+(local opts {:mapping [:kk :jj]
+ :timeout vim.o.timeoutlen
+ :clear_empty_lines false
+ :keys :<Esc>})
+
+{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 :<leader><BS> 2 :<cmd>BufDel<CR> :desc "Close Buffer"}]}
+(local keys [{1 :<leader><BS> 2 :<cmd>BufDel<CR> :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 :<leader>h 2 :<cmd>ColorizerToggle<cr> :desc :Colorizer}]}
+(local keys [{1 :<leader>h 2 :<cmd>ColorizerToggle<cr> :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 :<leader>dn
2 :<cmd>DBUIToggle<cr>
: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 :<leader>is
+(local keys
+ [{1 :<leader>is
2 :<cmd>DiffviewFileHistory<cr>
:desc "Repository history"
:nowait true}
@@ -19,5 +17,11 @@
:desc "Line history"}
{1 :<leader>ip
2 "<esc><cmd>'<,'>DiffviewFileHistory --follow<CR>"
- :desc "Range history" :mode :v}
- {1 :<leader>ic 2 :<cmd>DiffviewClose<cr> :desc "Close diffview"}]}
+ :desc "Range history"
+ :mode :v}
+ {1 :<leader>ic 2 :<cmd>DiffviewClose<cr> :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 "<leader>," 2 :<cmd>EasyreadToggle<cr> :desc :Easyread}]
- :config true}
+(local keys [{1 "<leader>," 2 :<cmd>EasyreadToggle<cr> :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 :<cmd>HarpoonAdd<cr> :desc :Harpoon}
- {1 :mr 2 :<cmd>HarpoonUI<cr> :desc "Harpoon UI"}
- {1 :ms 2 :<cmd>HarpoonPrev<cr> :desc "Harpoon Prev"}
- {1 :mt 2 :<cmd>HarpoonNext<cr> :desc "Harpoon Next"}]
- : config}
+(local keys [{1 :ma 2 :<cmd>HarpoonAdd<cr> :desc :Harpoon}
+ {1 :mr 2 :<cmd>HarpoonUI<cr> :desc "Harpoon UI"}
+ {1 :ms 2 :<cmd>HarpoonPrev<cr> :desc "Harpoon Prev"}
+ {1 :mt 2 :<cmd>HarpoonNext<cr> :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 "<cmd>Neotree filesystem reveal<cr>" :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 :<leader>gm 2 :<cmd>Neogit<cr> :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 :<leader>gm 2 :<cmd>Neogit<cr> :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 :<cmd>OrgAgendaPrompt<cr> :desc "Open agenda prompt"}
+ {1 :gc 2 :<cmd>OrgCapturePrompt<cr> :desc "Open capture prompt"}
+ {1 :gm
+ 2 "<cmd>Telescope orgmode search_headings theme=dropdown<cr>"
+ :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 :<cmd>OrgAgendaPrompt<cr> :desc "Open agenda prompt"}
- {1 :gc 2 :<cmd>OrgCapturePrompt<cr> :desc "Open capture prompt"}
- {1 :gm
- 2 "<cmd>Telescope orgmode search_headings theme=dropdown<cr>"
- :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 :<leader>sn 2 :<cmd>RestoreSession<cr> :desc "Restore session"}
+ {1 :<leader>se
+ 2 :<cmd>RestoreLastSession<cr>
+ :desc "Restore last session"}
+ {1 :<leader>si
+ 2 :<cmd>IgnoreSession<cr>
+ :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 :<leader>sn 2 :<cmd>RestoreSession<cr> :desc "Restore session"}
- {1 :<leader>se
- 2 :<cmd>RestoreLastSession<cr>
- :desc "Restore last session"}
- {1 :<leader>si
- 2 :<cmd>IgnoreSession<cr>
- :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 :<leader>rn 2 :<cmd>ReplaceInBuf<cr> :desc "Replace in Buffer"}
+(local keys
+ [{1 :<leader>rn 2 :<cmd>ReplaceInBuf<cr> :desc "Replace in Buffer"}
{1 :<leader>re 2 :<cmd>Replace<cr> :desc :Replace}
- {1 :<leader>ri 2 :<cmd>ReplaceWord<cr> :desc "Replace Word"}]
- : opts}
+ {1 :<leader>ri 2 :<cmd>ReplaceWord<cr> :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 :<leader>t 2 :<cmd>ToggleTerm<cr> :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 :<leader>t 2 :<cmd>ToggleTerm<cr> :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 :<leader>jt
+ 2 "<cmd>TroubleToggle workspace_diagnostics<cr>"
+ :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 :<leader>jt
- 2 "<cmd>TroubleToggle workspace_diagnostics<cr>"
- :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 <plug>(slash-after) zz"))}
+(fn config []
+ (vim.cmd "noremap <plug>(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 :<C-s>
- (fn []
- (pick-window)) {})))}
+(lambda config [_ opts]
+ (let [window-picker (require :window-picker)]
+ (window-picker.setup opts)
+ (vim.keymap.set :n :<C-s> (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 :<leader>/ 2 :<cmd>ZenMode<cr> :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 :<leader>/ 2 :<cmd>ZenMode<cr> :desc "Zen Mode"}])
+
+{1 :folke/zen-mode.nvim :cmd :ZenMode : keys : opts}