11# ⚙️ API
22
3- Following are list of APIs that are exported from the plugin. These can be used to setup [ custom keybinding] ( #usage ) or to make your own custom comment function. All API functions can take ` vmode ` (defined below) and a optional [ ` cfg ` ] ( ../README.md#config ) argument which can be used to override the [ default configuration] ( ../README.md#config )
3+ Following are list of APIs that are exported from the plugin. These can be used to setup [ custom keybinding] ( #usage ) or to make your own custom comment function. All API functions can take ` opmode ` (defined below) and a optional [ ` cfg ` ] ( ../README.md#config ) argument which can be used to override the [ default configuration] ( ../README.md#config )
44
55``` lua
6- --- @alias VMode ' " line" ' | ' " char" ' | ' "v" ' | ' "V" ' Vim Mode . Read ` :h map-operator`
6+ --- @alias OpMode ' line' | ' char' | ' v ' | ' V ' Vim operator-mode motions . Read ` :h map-operator`
77```
88
99### Core
@@ -14,41 +14,41 @@ These APIs powers the [basic-mappings](../README.md#basic-mappings).
1414-- ######### LINEWISE #########--
1515
1616--- Toggle linewise-comment on the current line
17- --- @param cfg ? Config
17+ --- @param cfg ? CommentConfig
1818require (' Comment.api' ).toggle_current_linewise (cfg )
1919
2020--- (Operator-Pending) Toggle linewise-comment on the current line
21- --- @param vmode VMode
22- --- @param cfg ? Config
23- require (' Comment.api' ).toggle_current_linewise_op (vmode , cfg )
21+ --- @param opmode OpMode
22+ --- @param cfg ? CommentConfig
23+ require (' Comment.api' ).toggle_current_linewise_op (opmode , cfg )
2424
2525--- (Operator-Pending) Toggle linewise-comment over multiple lines
26- --- @param vmode VMode
27- --- @param cfg ? Config
28- require (' Comment.api' ).toggle_linewise_op (vmode , cfg )
26+ --- @param opmode OpMode
27+ --- @param cfg ? CommentConfig
28+ require (' Comment.api' ).toggle_linewise_op (opmode , cfg )
2929
3030--- Toggle linewise-comment over multiple lines using `vim.v.count`
31- --- @param cfg ? Config
31+ --- @param cfg ? CommentConfig
3232require (' Comment.api' ).toggle_linewise_count (cfg )
3333
3434-- ######### BLOCKWISE #########--
3535
3636--- Toggle blockwise comment on the current line
37- --- @param cfg ? Config
37+ --- @param cfg ? CommentConfig
3838require (' Comment.api' ).toggle_current_blockwise (cfg )
3939
4040--- (Operator-Pending) Toggle blockwise comment on the current line
41- --- @param vmode VMode
42- --- @param cfg ? Config
43- require (' Comment.api' ).toggle_current_blockwise_op (vmode , cfg )
41+ --- @param opmode OpMode
42+ --- @param cfg ? CommentConfig
43+ require (' Comment.api' ).toggle_current_blockwise_op (opmode , cfg )
4444
4545--- (Operator-Pending) Toggle blockwise-comment over multiple lines
46- --- @param vmode VMode
47- --- @param cfg ? Config
48- require (' Comment.api' ).toggle_blockwise_op (vmode , cfg )
46+ --- @param opmode OpMode
47+ --- @param cfg ? CommentConfig
48+ require (' Comment.api' ).toggle_blockwise_op (opmode , cfg )
4949
5050--- Toggle blockwise-comment over multiple lines using `vim.v.count`
51- --- @param cfg ? Config
51+ --- @param cfg ? CommentConfig
5252require (' Comment.api' ).toggle_blockwise_count (cfg )
5353```
5454
@@ -60,29 +60,29 @@ These APIs powers the [extra-mappings](../README.md#extra-mappings) and also pro
6060-- ######### LINEWISE #########--
6161
6262--- Insert a linewise-comment below
63- --- @param cfg ? Config
63+ --- @param cfg ? CommentConfig
6464require (' Comment.api' ).insert_linewise_below (cfg )
6565
6666--- Insert a linewise-comment above
67- --- @param cfg ? Config
67+ --- @param cfg ? CommentConfig
6868require (' Comment.api' ).insert_linewise_above (cfg )
6969
7070--- Insert a linewise-comment at the end-of-line
71- --- @param cfg ? Config
71+ --- @param cfg ? CommentConfig
7272require (' Comment.api' ).insert_linewise_eol (cfg )
7373
7474-- ######### BLOCKWISE #########--
7575
7676--- Insert a blockwise-comment below
77- --- @param cfg ? Config
77+ --- @param cfg ? CommentConfig
7878require (' Comment.api' ).insert_blockwise_below (cfg )
7979
8080--- Insert a blockwise-comment above
81- --- @param cfg ? Config
81+ --- @param cfg ? CommentConfig
8282require (' Comment.api' ).insert_blockwise_above (cfg )
8383
8484--- Insert a blockwise-comment at the end-of-line
85- --- @param cfg ? Config
85+ --- @param cfg ? CommentConfig
8686require (' Comment.api' ).insert_blockwise_eol (cfg )
8787```
8888
@@ -94,52 +94,52 @@ These APIs powers the [extended-mappings](../README.md#extended-mappings).
9494-- ######### LINEWISE #########--
9595
9696--- Comment current line using linewise-comment
97- --- @param cfg ? Config
97+ --- @param cfg ? CommentConfig
9898require (' Comment.api' ).comment_current_linewise (cfg )
9999
100100--- (Operator-Pending) Comment current line using linewise-comment
101- --- @param vmode VMode
102- --- @param cfg ? Config
103- require (' Comment.api' ).comment_current_linewise_op (vmode , cfg )
101+ --- @param opmode OpMode
102+ --- @param cfg ? CommentConfig
103+ require (' Comment.api' ).comment_current_linewise_op (opmode , cfg )
104104
105105--- (Operator-Pending) Comment multiple line using linewise-comment
106- --- @param vmode VMode
107- --- @param cfg ? Config
108- require (' Comment.api' ).comment_linewise_op (vmode , cfg )
106+ --- @param opmode OpMode
107+ --- @param cfg ? CommentConfig
108+ require (' Comment.api' ).comment_linewise_op (opmode , cfg )
109109
110110--- Uncomment current line using linewise-comment
111- --- @param cfg ? Config
111+ --- @param cfg ? CommentConfig
112112require (' Comment.api' ).uncomment_current_linewise (cfg )
113113
114114--- (Operator-Pending) Uncomment current line using linewise-comment
115- --- @param vmode VMode
116- --- @param cfg ? Config
117- require (' Comment.api' ).uncomment_current_linewise_op (vmode , cfg )
115+ --- @param opmode OpMode
116+ --- @param cfg ? CommentConfig
117+ require (' Comment.api' ).uncomment_current_linewise_op (opmode , cfg )
118118
119119--- (Operator-Pending) Uncomment multiple line using linewise-comment
120- --- @param vmode VMode
121- --- @param cfg ? Config
122- require (' Comment.api' ).uncomment_linewise_op (vmode , cfg )
120+ --- @param opmode OpMode
121+ --- @param cfg ? CommentConfig
122+ require (' Comment.api' ).uncomment_linewise_op (opmode , cfg )
123123
124124-- ######### BLOCKWISE #########--
125125
126126--- Comment current line using linewise-comment
127- --- @param cfg ? Config
127+ --- @param cfg ? CommentConfig
128128require (' Comment.api' ).comment_current_blockwise (cfg )
129129
130130--- (Operator-Pending) Comment current line using blockwise-comment
131- --- @param vmode VMode
132- --- @param cfg ? Config
133- require (' Comment.api' ).comment_current_blockwise_op (vmode , cfg )
131+ --- @param opmode OpMode
132+ --- @param cfg ? CommentConfig
133+ require (' Comment.api' ).comment_current_blockwise_op (opmode , cfg )
134134
135135--- Uncomment current line using blockwise-comment
136- --- @param cfg ? Config
136+ --- @param cfg ? CommentConfig
137137require (' Comment.api' ).uncomment_current_blockwise (cfg )
138138
139139--- (Operator-Pending) Uncomment current line using blockwise-comment
140- --- @param vmode VMode
141- --- @param cfg ? Config
142- require (' Comment.api' ).uncomment_current_blockwise_op (vmode , cfg )
140+ --- @param opmode OpMode
141+ --- @param cfg ? CommentConfig
142+ require (' Comment.api' ).uncomment_current_blockwise_op (opmode , cfg )
143143```
144144
145145### Additional
0 commit comments