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 9153559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:17:30+00:00 2026-06-17T12:17:30+00:00

What is the option in the Key Bindings file that I would use to

  • 0

What is the option in the Key Bindings file that I would use to set up a keyboard shortcut for the menu item

View -> Indentation -> Convert Indentation To Spaces

I’ve tried the following, but can’t figure out how to trigger the option I see in the above mentioned menu

{ "keys": ["super+t"], "command": "convert_to_tabs" },
{ "keys": ["shift+super+t"], "command": "convert_to_spaces" },
  • 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. Editorial Team
    Editorial Team
    2026-06-17T12:17:31+00:00Added an answer on June 17, 2026 at 12:17 pm

    Simple Version

    Convert spaces to tabs (from Eric Muyser):

    { "keys": ["ctrl+shift+x"], "command": "unexpand_tabs", "args": { "set_translate_tabs": false } }
    

    Convert tabs to spaces (from mVChr):

    { "keys": ["ctrl+shift+y"], "command": "expand_tabs", "args": { "set_translate_tabs": true } }
    

    Original Answer Below


    You could do it with one command each (expand_tabs and unexpand_tabs), but it would also be a good idea to toggle “Indent Using Spaces”. Here is a macro that I saw somewhere (I forget where.)

    Macro Version

    Tabs -> Spaces

    Save as “convert_tabs_to_spaces.sublime-macro” inside of your “Packages/User” folder

    [
      {
        "args":
        {
          "set_translate_tabs": true
        },
        "command": "expand_tabs"
      }
    ]
    

    Add this to your keybindings file:

        { "keys": ["ctrl+shift+x"], "command": "run_macro_file", "args": {"file": "Packages/User/convert_tabs_to_spaces.sublime-macro"} },
    

    Spaces -> Tabs

    Similar file name and keybinding

    [
      {
        "args":
        {
          "set_translate_tabs": false
        },
        "command": "unexpand_tabs"
      }
    ]
    

    I used this until I saw that you could left click the indentation setting in the Status Bar and change it from there.

    Edit:

    Plugin Version

    adapted from here

    “convert_tabs_to_spaces.py”

    import sublime, sublime_plugin
    
    class ConvertTabsToSpaces(sublime_plugin.TextCommand):
        def run(self, edit):
            self.view.run_command('expand_tabs', {"set_translate_tabs": True})
    

    .

    keybinding: { "keys": ["ctrl+shift+x"], "command": "convert_tabs_to_spaces"},

    “convert_spaces_to_tabs.py”

    import sublime, sublime_plugin
    
    class ConvertSpacesToTabs(sublime_plugin.TextCommand):
        def run(self, edit):
            self.view.run_command('unexpand_tabs', {"set_translate_tabs": False})
    

    .

    keybinding: { "keys": ["ctrl+shift+y"], "command": "convert_spaces_to_tabs"},

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any way to configure Carbon Emacs to use the Option key as a Meta
Which option is better from Best practices point of view and from performance point
Is there any option to tell gs to convert strokes to fills? Something similar
I'd like to use a keycode with modifiers in my .emacs file. However my
I'm writing a javascript that is supposed to attach a context menu to an
If I deployed a Community plugin and set up a key-binding in CodeRush, how
Looking for a way to fix the option key not working with PHP Storm
Possible Duplicate: What IDE to use for Python? Are there any Python editors that
I've read through the Java tutorial on key bindings as well as half a
ActiveRecord's has_many and belongs_to methods both take a :foreign_key option. If I need to

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.