summaryrefslogtreecommitdiff
path: root/fnl/config/cmd.fnl
blob: 1971260dcab45ec99f35eb61ec9ec76a3b6fb501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;; Commands for plugins.
(module config.cmd {autoload {nvim aniseed.nvim util config.util}})

(nvim.create_user_command :OrgAgendaPrompt
                          (lambda []
                            (let [orgmode (util.prequire :orgmode)]
                              (orgmode.action :agenda.prompt)))
                          {:nargs 0})

(nvim.create_user_command :OrgCapturePrompt
                          (lambda []
                            (let [orgmode (util.prequire :orgmode)]
                              (orgmode.action :capture.prompt)))
                          {:nargs 0})

(nvim.create_user_command :CommentNormal
                          (lambda []
                            (let [comment-api (util.prequire :Comment.api)]
                              (comment-api.toggle.linewise.current)))
                          {:nargs 0})

(nvim.create_user_command :CommentVisual
                          (lambda []
                            (let [comment-api (util.prequire :Comment.api)]
                              (comment-api.toggle.linewise (vim.fn.visualmode))))
                          {:nargs 0})

(nvim.create_user_command :HarpoonAdd
                          (lambda []
                            (let [harpoon (util.prequire :harpoon.mark)]
                              (harpoon.add_file)))
                          {:nargs 0})

(nvim.create_user_command :HarpoonNext
                          (lambda []
                            (let [harpoon (util.prequire :harpoon.ui)]
                              (harpoon.nav_next)))
                          {:nargs 0})

(nvim.create_user_command :HarpoonPrev
                          (lambda []
                            (let [harpoon (util.prequire :harpoon.ui)]
                              (harpoon.nav_prev)))
                          {:nargs 0})

(nvim.create_user_command :HarpoonUI
                          (lambda []
                            (let [harpoon (util.prequire :harpoon.ui)]
                              (harpoon.toggle_quick_menu)))
                          {:nargs 0})

(nvim.create_user_command :Replace
                          (lambda []
                            (let [spectre (util.prequire :spectre)]
                              (spectre.open)))
                          {:nargs 0})

(nvim.create_user_command :ReplaceWord
                          (lambda []
                            (let [spectre (util.prequire :spectre)]
                              (spectre.open_visual {:select_word true})))
                          {:nargs 0})

(nvim.create_user_command :ReplaceInBuf
                          (lambda []
                            (let [spectre (util.prequire :spectre)]
                              (spectre.open_file_search)))
                          {:nargs 0})