<p><strong>Emacs</strong>:  <code>C-U (79) #</code> &raquo; a pretty 79 character length divider</p>

<p><strong>VIM</strong>:  <code>79-i-#</code> &raquo; see above</p>

<p><strong><a href="http://macromates.com/" rel="nofollow noreferrer">Textmate</a></strong>: ????</p>

<p>Or is it just assumed that we'll make a Ruby call or have a snippet somewhere?</p>

[{'answer_id': 64975, 'author': 'pjbeardsley', 'author_id': 6812, 'author_profile': 'https://Stackoverflow.com/users/6812', 'pm_score': 2, 'selected': False, 'text': '<p>I would create a bundle command to do this.</p>\n\n<p>You can take editor selection as input to your script, then replace it with the result of execution.  This command, for example, will take a selected number and print the character \'#\' that number of times.</p>\n\n<pre><code>python -c "print \'#\' * $TM_SELECTED_TEXT"\n</code></pre>\n\n<p>Of course this example doesn\'t allow you to specify the character, but it gives you an idea of what\'s possible.</p>\n'}, {'answer_id': 91221, 'author': 'Matt', 'author_id': 15368, 'author_profile': 'https://Stackoverflow.com/users/15368', 'pm_score': 1, 'selected': False, 'text': '<p>By taking the</p>\n\n<pre><code>python -c "print \'#\' * $TM_SELECTED_TEXT"\n</code></pre>\n\n<p>a step further, you can duplicate the examples you gave in the question. </p>\n\n<p>Just make a snippet, called divider or something, set the <code>tab trigger</code> field to something appropriate <code>\'--\'</code> for example, then enter something like:</p>\n\n<pre><code>`python -c "print \'_\' * $TM_COLUMNS"`\n</code></pre>\n\n<p>Then when you type <code>--⇥</code> (dash dash tab), you should get a divider of the correct width. </p>\n\n<p>True, you\'ve lost some of the terseness that you get from vim, but this is far easier to reuse, and you only have to type it once. You can also use whatever language you like.</p>\n'}, {'answer_id': 1676726, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Inspired by the other answers. Make a snippet with the following:</p>\n\n<pre><code>`python -c "print \':\'.join(\'$TM_SELECTED_TEXT\'.split(\':\')[:-1]) * int(\'$TM_SELECTED_TEXT\'.split(\':\')[-1])"`\n</code></pre>\n\n<p>and optionally assign a key sequence to it, e.g. CTRL-SHIFT-R</p>\n\n<p>If you type <code>-x:4</code>, select it, and call the snippet (by it\'s shortcut for example), you\'ll get "-x-x-x-x".</p>\n\n<p>You can also use <code>::4</code> to obtain "::::".</p>\n\n<p>The string you repeat is enclosed in single quotes, so to repeat \', you have to use \\\'.</p>\n'}]
['https://Stackoverflow.com/questions/64387', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']