Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 128785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:41:27+00:00 2026-05-11T05:41:27+00:00

I often need to enter text (consisting of repeated characters) like this: ———————————— TODO

  • 0

I often need to enter text (consisting of repeated characters) like this:

------------------------------------  TODO ------------------------------------ 

In emacs, I can do a

C-u 60 -  

that’s a Ctrl+U followed by a ’60’ followed by a ‘-‘, which makes entering a repeated sequence of characters easy.

Is there any way to do something like this in TextMate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:41:27+00:00Added an answer on May 11, 2026 at 5:41 am

    In TextMate, open the Bundle Editor and select the language you’d like to do this in. (If you’d like to have this functionality in all languages, use the Source bundle) Click the plus symbol at the bottom left, and choose ‘New Command.’ Chose ‘Nothing’ for the Save field and ‘Selected Text or Line’ for the two input fields. Then paste this into the Commands field:

    #!/usr/bin/python import sys commandLine = raw_input('') tmArgs = commandLine.split() numberOfArgs = len(tmArgs) for i in range(eval(tmArgs[0])):     for j in range(1, numberOfArgs):         sys.stdout.write(tmArgs[j]) 

    You can then choose a keyboard shortcut to activate this with in the Activation field. The way it works is very similar to that emacs command: type the number of characters you want followed by the character. Then select both of them (this step is unnecessary if they’re the only text on the line) and press the shortcut key. My script allows you to specify multiple characters to print, delimited by spaces. So if you typed

    10 - = 

    and hit the shortcut key, you’d get

    -=-=-=-=-=-=-=-=-=-= 

    Edit: After thinking about it…here’s another version. This one will print the string after the number. So for example

    6 -= (space) 

    prints

    -= -= -= -= -= -=  

    Here’s that version:

    #!/usr/bin/python import sys import string commandLine = raw_input('') timesToPrint = eval(commandLine.split()[0]) firstSpace = string.find(commandLine, ' ') for i in range(timesToPrint):         sys.stdout.write(commandLine[firstSpace + 1:]) 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often need to design a dialog in Delphi/C++Builder that allows various properties of
I often need to list items with various-sized images on the left and text
I have two scripts that often need to be run with the same parameter:
I often need this kind of function, for example, for understand the direction of
I'm working on an application that does reporting-type things, and I often need to
I often need to match a tuple of values that should have the same
When we do development/QA we often need to pretend that current date/time is something
In SQL statements, we often need to create a list of question marks that
You often need View in View. For example, a client that has many phone
I use emacs for development and very often need to move to the start

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.