Skip to main content
7 events
when toggle format what by license comment
Sep 23, 2015 at 18:26 comment added tokoyami @ideasman42 You'd have to make a function instead and check if the current line starts with a comment and then depending on that call either of the :s commands shown in the excerpt in the answer. The check itself would be something like getline('.') =~ "^" . escape(b:comment_leader, '\/'). If it's true uncomment, otherwise comment. This is not tested and should serve only as an example.
Sep 23, 2015 at 5:18 comment added ideasman42 While I like this approach, Is there a way to make it toggle comments?
Feb 3, 2015 at 21:35 comment added wchargin Note: this only supports linewise comments. For example, ANSI C does not recognize // (only /* */).
Feb 3, 2015 at 20:33 comment added gaveen An additional plugin suggestion: NERD Commenter - vim.org/scripts/script.php?script_id=1218
Feb 3, 2015 at 20:25 history edited tokoyami CC BY-SA 3.0
added 1 character in body
Feb 3, 2015 at 20:23 review First posts
Feb 3, 2015 at 23:55
Feb 3, 2015 at 20:14 history answered tokoyami CC BY-SA 3.0