From f318452070d42e51231f7880a5d0eaa93d978a1e Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 11 Jan 2023 00:41:17 +0100 Subject: Rip aniseed, hail hotpot --- fnl/settings/usercmds.fnl | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 fnl/settings/usercmds.fnl (limited to 'fnl/settings/usercmds.fnl') diff --git a/fnl/settings/usercmds.fnl b/fnl/settings/usercmds.fnl new file mode 100644 index 0000000..da842cc --- /dev/null +++ b/fnl/settings/usercmds.fnl @@ -0,0 +1,98 @@ +;; Commands for plugins. + +(vim.api.nvim_create_user_command :OrgAgendaPrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :agenda.prompt))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :OrgCapturePrompt + (lambda [] + (let [orgmode (require :orgmode)] + (orgmode.action :capture.prompt))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :CommentNormal + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise.current))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :CommentVisual + (lambda [] + (let [comment-api (require :Comment.api)] + (comment-api.toggle.linewise (vim.fn.visualmode)))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonAdd + (lambda [] + (let [harpoon (require :harpoon.mark)] + (harpoon.add_file))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonNext + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_next))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonPrev + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.nav_prev))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :HarpoonUI + (lambda [] + (let [harpoon (require :harpoon.ui)] + (harpoon.toggle_quick_menu))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :Replace + (lambda [] + (let [spectre (require :spectre)] + (spectre.open))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :ReplaceWord + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_visual {:select_word true}))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :ReplaceInBuf + (lambda [] + (let [spectre (require :spectre)] + (spectre.open_file_search))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :RestoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :RestoreLastSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.load {:last true}))) + {:nargs 0}) + +(vim.api.nvim_create_user_command :IgnoreSession + (lambda [] + (let [persistence (require :persistence)] + (persistence.stop))) + {:nargs 0}) + +(fn telescope-builtin [builtin opts] + (let [telescope (require :telescope.builtin) + themes (require :telescope.themes) + theme (. opts :theme)] + ((. telescope builtin) ((. themes theme) opts)))) + +(vim.api.nvim_create_user_command :FindFiles + (lambda [] + (telescope-builtin :find_files + {:theme :get_dropdown + :previewer false})) + {:nargs 0}) -- cgit v1.2.3-70-g09d2