I just created a TextMate 2 bundle to underline the current line, and this image shows how I created that bundle. The dashed-line will be the same length as the line the cursor is currently on (the current line). I do this a lot when I use TextMate to write notes and even Markdown text, so I wanted a little script/bundle like this.
FWIW, the result of this bundle/command is that I can have the cursor be on a line like “Hello, world,” as shown below, press
[Command][u], and end up with this:
Hello, world ------------