From e4da06e19c072322573c916fa6bdda8827a59e6c Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 8 Jan 2023 20:05:49 +0100 Subject: Refactor with opts --- fnl/config/better-escape.fnl | 2 +- fnl/config/cmd.fnl | 93 -------------------------------------------- fnl/config/comment.fnl | 2 +- fnl/config/flit.fnl | 2 +- fnl/config/gitsigns.fnl | 2 +- fnl/config/lualine.fnl | 2 +- fnl/config/minibar.fnl | 2 +- fnl/config/persistence.fnl | 2 +- fnl/config/spectre.fnl | 2 +- fnl/config/toggleterm.fnl | 2 +- fnl/config/trim.fnl | 2 +- fnl/config/trouble.fnl | 2 +- fnl/config/user-cmd.fnl | 93 ++++++++++++++++++++++++++++++++++++++++++++ fnl/config/zen.fnl | 2 +- 14 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 fnl/config/cmd.fnl create mode 100644 fnl/config/user-cmd.fnl (limited to 'fnl/config') diff --git a/fnl/config/better-escape.fnl b/fnl/config/better-escape.fnl index f262784..d4379a0 100644 --- a/fnl/config/better-escape.fnl +++ b/fnl/config/better-escape.fnl @@ -5,4 +5,4 @@ :clear_empty_lines false :keys :}) -{1 :max397574/better-escape.nvim :event :BufReadPost :config opts} +{1 :max397574/better-escape.nvim :event :BufReadPost :opts opts} diff --git a/fnl/config/cmd.fnl b/fnl/config/cmd.fnl deleted file mode 100644 index 1ae9b58..0000000 --- a/fnl/config/cmd.fnl +++ /dev/null @@ -1,93 +0,0 @@ -;; Commands for plugins. -(module config.cmd {autoload {nvim aniseed.nvim util config.util}}) - -(nvim.create_user_command :OrgAgendaPrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :agenda.prompt))) - {:nargs 0}) - -(nvim.create_user_command :OrgCapturePrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :capture.prompt))) - {:nargs 0}) - -(nvim.create_user_command :CommentNormal - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise.current))) - {:nargs 0}) - -(nvim.create_user_command :CommentVisual - (lambda [] - (let [comment-api (require :Comment.api)] - (comment-api.toggle.linewise (vim.fn.visualmode)))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonAdd - (lambda [] - (let [harpoon (require :harpoon.mark)] - (harpoon.add_file))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonNext - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_next))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonPrev - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_prev))) - {:nargs 0}) - -(nvim.create_user_command :HarpoonUI - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.toggle_quick_menu))) - {:nargs 0}) - -(nvim.create_user_command :Replace - (lambda [] - (let [spectre (require :spectre)] - (spectre.open))) - {:nargs 0}) - -(nvim.create_user_command :ReplaceWord - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_visual {:select_word true}))) - {:nargs 0}) - -(nvim.create_user_command :ReplaceInBuf - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_file_search))) - {:nargs 0}) - -(nvim.create_user_command :RestoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load))) - {:nargs 0}) - -(nvim.create_user_command :RestoreLastSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load {:last true}))) - {:nargs 0}) - -(nvim.create_user_command :IgnoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.stop))) - {:nargs 0}) - -(nvim.create_user_command :FindFiles - (lambda [] - (util.telescope-builtin :find_files - {:theme :get_dropdown - :previewer false})) - {:nargs 0}) diff --git a/fnl/config/comment.fnl b/fnl/config/comment.fnl index 29b7871..07bfc6d 100644 --- a/fnl/config/comment.fnl +++ b/fnl/config/comment.fnl @@ -17,4 +17,4 @@ ;; Add comment at the end of line :eol :mcA}}) -{1 :numToStr/Comment.nvim :event :BufReadPost :config opts} +{1 :numToStr/Comment.nvim :event :BufReadPost :opts opts} diff --git a/fnl/config/flit.fnl b/fnl/config/flit.fnl index 536c505..8c408aa 100644 --- a/fnl/config/flit.fnl +++ b/fnl/config/flit.fnl @@ -5,4 +5,4 @@ :multiline true :opts {}}) -{1 :ggandor/flit.nvim :event :BufReadPost :config opts} +{1 :ggandor/flit.nvim :event :BufReadPost :opts opts} diff --git a/fnl/config/gitsigns.fnl b/fnl/config/gitsigns.fnl index 7b7ed95..d4bd72b 100644 --- a/fnl/config/gitsigns.fnl +++ b/fnl/config/gitsigns.fnl @@ -45,4 +45,4 @@ :col 1} :yadm {:enable false}}) -{1 :lewis6991/gitsigns.nvim :event :BufReadPost :config opts} +{1 :lewis6991/gitsigns.nvim :event :BufReadPost :opts opts} diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 34f735c..be326f5 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -83,5 +83,5 @@ {1 :nvim-lualine/lualine.nvim :event :VeryLazy - :config opts + :opts opts :dependencies [:kyazdani42/nvim-web-devicons :arkav/lualine-lsp-progress]} diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl index 9e49c7f..03882cb 100644 --- a/fnl/config/minibar.fnl +++ b/fnl/config/minibar.fnl @@ -29,4 +29,4 @@ {1 :aktersnurra/minibar.nvim :event :BufReadPre - :config opts} + :opts opts} diff --git a/fnl/config/persistence.fnl b/fnl/config/persistence.fnl index e1368f1..0238897 100644 --- a/fnl/config/persistence.fnl +++ b/fnl/config/persistence.fnl @@ -2,4 +2,4 @@ (local opts {:options [:buffers :curdir :tabpages :winsize :help]}) -{1 :folke/persistence.nvim :event :VeryLazy :config opts} +{1 :folke/persistence.nvim :event :VeryLazy :opts opts} diff --git a/fnl/config/spectre.fnl b/fnl/config/spectre.fnl index c662935..067a817 100644 --- a/fnl/config/spectre.fnl +++ b/fnl/config/spectre.fnl @@ -59,4 +59,4 @@ :is_open_target_win true :is_insert_mode false}) -{1 :windwp/nvim-spectre :event :BufReadPost :config opts} +{1 :windwp/nvim-spectre :event :BufReadPost :opts opts} diff --git a/fnl/config/toggleterm.fnl b/fnl/config/toggleterm.fnl index 3c8aa39..ed7dd5c 100644 --- a/fnl/config/toggleterm.fnl +++ b/fnl/config/toggleterm.fnl @@ -2,4 +2,4 @@ (local opts {:size 16 :shade_terminals false}) -{1 :akinsho/toggleterm.nvim :cmd :ToggleTerm :config opts} +{1 :akinsho/toggleterm.nvim :cmd :ToggleTerm :opts opts} diff --git a/fnl/config/trim.fnl b/fnl/config/trim.fnl index e21b715..af8b5ab 100644 --- a/fnl/config/trim.fnl +++ b/fnl/config/trim.fnl @@ -2,4 +2,4 @@ (local opts {:disable [:python]}) -{1 :cappyzawa/trim.nvim :event :BufFilePre :config opts} +{1 :cappyzawa/trim.nvim :event :BufFilePre :opts opts} diff --git a/fnl/config/trouble.fnl b/fnl/config/trouble.fnl index 988f2ed..a38ed86 100644 --- a/fnl/config/trouble.fnl +++ b/fnl/config/trouble.fnl @@ -78,4 +78,4 @@ ;; enabling this will use the signs defined in your lsp client }) -{1 :folke/trouble.nvim :cmd :TroubleToggle :config opts} +{1 :folke/trouble.nvim :cmd :TroubleToggle :opts opts} diff --git a/fnl/config/user-cmd.fnl b/fnl/config/user-cmd.fnl new file mode 100644 index 0000000..f72d95a --- /dev/null +++ b/fnl/config/user-cmd.fnl @@ -0,0 +1,93 @@ +;; Commands for plugins. +(module config.user-cmd {autoload {nvim aniseed.nvim util config.util}}) + +(nvim.create_user_command :OrgAgendaPrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :agenda.prompt))) + {:nargs 0}) + +(nvim.create_user_command :OrgCapturePrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :capture.prompt))) + {:nargs 0}) + +(nvim.create_user_command :CommentNormal + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise.current))) + {:nargs 0}) + +(nvim.create_user_command :CommentVisual + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise (vim.fn.visualmode)))) + {:nargs 0}) + +(nvim.create_user_command :HarpoonAdd + (lambda [] + (let [harpoon (require :harpoon.mark)] + (harpoon.add_file))) + {:nargs 0}) + +(nvim.create_user_command :HarpoonNext + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_next))) + {:nargs 0}) + +(nvim.create_user_command :HarpoonPrev + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_prev))) + {:nargs 0}) + +(nvim.create_user_command :HarpoonUI + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.toggle_quick_menu))) + {:nargs 0}) + +(nvim.create_user_command :Replace + (lambda [] + (let [spectre (require :spectre)] + (spectre.open))) + {:nargs 0}) + +(nvim.create_user_command :ReplaceWord + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_visual {:select_word true}))) + {:nargs 0}) + +(nvim.create_user_command :ReplaceInBuf + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_file_search))) + {:nargs 0}) + +(nvim.create_user_command :RestoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load))) + {:nargs 0}) + +(nvim.create_user_command :RestoreLastSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load {:last true}))) + {:nargs 0}) + +(nvim.create_user_command :IgnoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.stop))) + {:nargs 0}) + +(nvim.create_user_command :FindFiles + (lambda [] + (util.telescope-builtin :find_files + {:theme :get_dropdown + :previewer false})) + {:nargs 0}) diff --git a/fnl/config/zen.fnl b/fnl/config/zen.fnl index 1a0c94e..1f53708 100644 --- a/fnl/config/zen.fnl +++ b/fnl/config/zen.fnl @@ -10,4 +10,4 @@ :tmux {:enabled true} :twilight {:enabled true}}}) -{1 :folke/zen-mode.nvim :cmd :ZenMode :config opts} +{1 :folke/zen-mode.nvim :cmd :ZenMode :opts opts} -- cgit v1.2.3-70-g09d2