summaryrefslogtreecommitdiff
path: root/fnl/plugins/editor/comment.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:05:37 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2023-09-23 22:05:37 +0200
commitd474c779523c512e3bc91bc5ce7bc87cafc6372b (patch)
tree3c50cc5bf8fb55167150c76171f54590babf7118 /fnl/plugins/editor/comment.fnl
parent6dcd88cde5825573a3732e8b18f7d663ca47495b (diff)
Move user and auto cmds to plugins
Diffstat (limited to 'fnl/plugins/editor/comment.fnl')
-rw-r--r--fnl/plugins/editor/comment.fnl16
1 files changed, 16 insertions, 0 deletions
diff --git a/fnl/plugins/editor/comment.fnl b/fnl/plugins/editor/comment.fnl
index 63401a0..f15e61f 100644
--- a/fnl/plugins/editor/comment.fnl
+++ b/fnl/plugins/editor/comment.fnl
@@ -1,7 +1,23 @@
;; Language aware commenting.
+(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 {:toggler {;; Line-comment toggle keymap
:line :mcc
;; Block-comment toggle keymap