sponsor Vim development Vim logo Vim Book Ad

cscomment.vim : Automates creation of /// comments for C# methods

 script karma  Rating 22/12, Downloaded by 2331  Comments, bugs, improvements  Vim wiki

created by
Aaron Jensen
 
script type
utility
 
description
This script will generate the /// comment blocks for csharp for methods and constructors.  Simply place the cursor anywhere on the first line of the function prototype and hit <c-t>.  It also works on properties, constructors and classes.

Adds summary, remarks, params (for all the params in the function), value (if its a property), and returns (if the function returns something.)

While in comment mode you can tab and shift-tab through the tags, and return and backspace work as they should (enter inserts /// on the new line and backspace erases /// in one bs)

You can get back into comment mode by hitting <c-t> on an existing doc comment.

Questions, comments, concerns, bugs, ideas, etc, drop me an email.
 
install details
Just drop the script in your plugin directory.  You can modify it to change the map.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cscomment.vim 1.3b 2002-11-20 6.0 Aaron Jensen -Interfaces are no longer treated as properties
-Formal ref params are now handled properly
-Fixed backspace so it works on the last character.
cscomment.vim 1.3a 2002-11-20 6.0 Aaron Jensen -Fixed bug with insert point reworking
-Finished backspace support, it now backspaces the /// in one backspace

Anyone have a suggestion for restoring key mappings (like when to call the restore function... and autocmd or something?  <esc> seems too unreliable.
cscomment.vim 1.3 2002-11-20 6.0 Aaron Jensen -Fixed bug with things not getting unmapped properly (Note that things will not get unmapped if esc isn't hit to leave insert mode, I'll tackle that tomorrow)
-Made it so properties now get a value tag
-Reworked the way the insert point is found after a tab/s-tab
-All tags now start out on one line per tag
cscomment.vim 1.2 2002-11-19 6.0 Aaron Jensen -Commenter now allows you to edit your comments and will reshape them as necessary (add params, remove them, etc.) Just press <c-t> on an existing /// comment or a function with a /// comment.
-Now restores previous imappings
-Cleaned up a bit
If it deletes any tags you don't want it to, let me know. The only top level tags it remembers are remarks, summary, param, and returns.
cscomment.vim 1.1 2002-11-12 6.0 Aaron Jensen <cr> now adds a new line with ///, useful for long summaries.  <tab> and <s-tab> iterate through summary, params, and return tags so you can fill everything in quickly.
cscomment.vim 1.0 2002-11-12 6.0 Aaron Jensen Initial upload
ip used for rating: 18.220.154.41

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github