Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am doing web development and most of my work is in the following:

php
ruby
Rails (the framework)
CakePHP (the framework)
javascript
AngularJS (the framework)
jQuery (the js library)
html
css

I realized I have basically the following 3 scenarios in my development work:

1) for CakePHP

  • use tabs for indentation
  • indentation width is 4 spaces

2) for php development

  • use spaces for indentation
  • indentation width is 4 spaces

3) for everything else

  • use spaces for indentation
  • indentation width is 2 spaces

I think what I want to do is set my user defaults to the 3rd one and have individual project settings.

I know how to set User settings in sublime 3.

Please advise.

share|improve this question

1 Answer 1

in your User settings, use

  "tab_size": 2,
  "translate_tabs_to_spaces": true,

in your CakePHP project settings, use

  "tab_size": 4,
  "translate_tabs_to_spaces": false,

in your everyday php project settings, use

  "tab_size": 4,
  "translate_tabs_to_spaces": true,

Project settings require you to save a project and the file generated is a JSON file usually named as project-name.sublime-project

share|improve this answer
    
You can also create a file called PHP.sublime-settings in your Sublime User package folder and put general PHP settings there. –  bungeshea Nov 30 '13 at 7:42
    
@bungeshea How do I change from default settings to this general PHP settings? –  Kim Stacks Nov 30 '13 at 15:23
    
Sublime Text will automatically use the PHP settings when you open up a file with a PHP file extension, or mark a file as PHP through Set Syntax: PHP from the Command Palette –  bungeshea Nov 30 '13 at 21:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.