diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-24 01:12:42 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-09-24 01:12:42 +0200 |
commit | 8ad2f8c9afb308e7a8a1133f578e3352442f770a (patch) | |
tree | a7a05ed7c472f186d6380dd918e2318d6d951330 /fnl/plugins/editor/comment.fnl | |
parent | fd69ec549594d53b9503212d93a9a44f10eef478 (diff) |
Restructure plugin configs
Diffstat (limited to 'fnl/plugins/editor/comment.fnl')
-rw-r--r-- | fnl/plugins/editor/comment.fnl | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/fnl/plugins/editor/comment.fnl b/fnl/plugins/editor/comment.fnl index f15e61f..66abb33 100644 --- a/fnl/plugins/editor/comment.fnl +++ b/fnl/plugins/editor/comment.fnl @@ -1,36 +1,35 @@ ;; Language aware commenting. +(local opts {:toggler {;; Line-comment toggle keymap + :line :mcc + ;; Block-comment toggle keymap + :block :mbc} + ;; LHS of operator-pending mappings in NORMAL and VISUAL mode + :opleader {;; Line-comment keymap + :line :mc + ;; Block-comment keymap + :block :mb} + ;; LHS of extra mappings + :extra {;; Add comment on the line above + :above :mcO + ;; Add comment on the line below + :below :mco + ;; Add comment at the end of line + :eol :mcA}}) + (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}]]) + (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 - :block :mbc} - ;; LHS of operator-pending mappings in NORMAL and VISUAL mode - :opleader {;; Line-comment keymap - :line :mc - ;; Block-comment keymap - :block :mb} - ;; LHS of extra mappings - :extra {;; Add comment on the line above - :above :mcO - ;; Add comment on the line below - :below :mco - ;; Add comment at the end of line - :eol :mcA}}} +{1 :numToStr/Comment.nvim :event :BufReadPost : inti : opts} |