blob: ded75df0afa7d1833fbe20b85aadd2e7f0c677ca (
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
|
;; Language aware commenting.
(local opts {:toggler {;; Line-comment toggle keymap
:line :mpc
;; Block-comment toggle keymap
:block :mbc}
;; LHS of operator-pending mappings in NORMAL and VISUAL mode
:opleader {;; Line-comment keymap
:line :mp
;; Block-comment keymap
:block :mb}
;; LHS of extra mappings
:extra {;; Add comment on the line above
:above :mpO
;; Add comment on the line below
:below :mpo
;; Add comment at the end of line
:eol :mpA}})
(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}]])
(fn init []
(let [cmds (require :util.cmds)]
(cmds.create-user-cmds user-cmds)))
{1 :numToStr/Comment.nvim :event :BufReadPost : inti : opts}
|