diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:05:37 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-23 22:05:37 +0200 |
commit | d474c779523c512e3bc91bc5ce7bc87cafc6372b (patch) | |
tree | 3c50cc5bf8fb55167150c76171f54590babf7118 /fnl/settings/usercmds.fnl | |
parent | 6dcd88cde5825573a3732e8b18f7d663ca47495b (diff) |
Move user and auto cmds to plugins
Diffstat (limited to 'fnl/settings/usercmds.fnl')
-rw-r--r-- | fnl/settings/usercmds.fnl | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/fnl/settings/usercmds.fnl b/fnl/settings/usercmds.fnl deleted file mode 100644 index 002e1b2..0000000 --- a/fnl/settings/usercmds.fnl +++ /dev/null @@ -1,87 +0,0 @@ -;; Commands for plugins. - -(fn telescope-builtin [builtin opts] - (let [telescope (require :telescope.builtin) - themes (require :telescope.themes) - theme (. opts :theme)] - ((. telescope builtin) ((. themes theme) opts)))) - -(local usercmds [[:OrgAgendaPrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :agenda.prompt))) - {:nargs 0}] - [:OrgCapturePrompt - (lambda [] - (let [orgmode (require :orgmode)] - (orgmode.action :capture.prompt))) - {:nargs 0}] - [: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}] - [:HarpoonAdd - (lambda [] - (let [harpoon (require :harpoon.mark)] - (harpoon.add_file))) - {:nargs 0}] - [:HarpoonNext - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_next))) - {:nargs 0}] - [:HarpoonPrev - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.nav_prev))) - {:nargs 0}] - [:HarpoonUI - (lambda [] - (let [harpoon (require :harpoon.ui)] - (harpoon.toggle_quick_menu))) - {:nargs 0}] - [:Replace - (lambda [] - (let [spectre (require :spectre)] - (spectre.open))) - {:nargs 0}] - [:ReplaceWord - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_visual {:select_word true}))) - {:nargs 0}] - [:ReplaceInBuf - (lambda [] - (let [spectre (require :spectre)] - (spectre.open_file_search))) - {:nargs 0}] - [:RestoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load))) - {:nargs 0}] - [:RestoreLastSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.load {:last true}))) - {:nargs 0}] - [:IgnoreSession - (lambda [] - (let [persistence (require :persistence)] - (persistence.stop))) - {:nargs 0}] - [:FindFiles - (lambda [] - (telescope-builtin :find_files - {:theme :get_dropdown :previewer false})) - {:nargs 0}]]) - -(each [_ usercmd (ipairs usercmds)] - (match usercmd - [event cmd opts] (vim.api.nvim_create_user_command event cmd opts))) |