Sublime Text Setting for PHP

Learn how to optimize Sublime Text for PHP development with this easy-to-follow guide and example.

Sublime Text Setting for PHP

Sublime Text is a great code editor for a variety of programming languages, including PHP. Sublime Text comes with a set of default settings, which may not be ideal for PHP development. To ensure the best coding experience, the settings should be tweaked to suit the coding language.

The following settings are recommended for PHP coding in Sublime Text:


// Indentation
"tab_size": 2,
"translate_tabs_to_spaces": true,

// Trim Trailing Whitespace
"trim_trailing_white_space_on_save": true,

// Disable Word Wrap
"word_wrap": false,

// Enable Auto Indent
"auto_indent": true,

// Show Whitespace
"draw_white_space": "all",

// Set Syntax Highlighting
"syntax": "Packages/PHP/PHP.sublime-syntax",

// Set File Encoding
"default_encoding": "UTF-8",

// Set File Type
"default_line_ending": "unix",

// Set Matching Brackets
"match_brackets": true,

// Set Caret Style
"caret_style": "smooth",

// Set Font
"font_face": "Source Code Pro",
"font_size": 14

These settings will help ensure that your code is properly indented, that trailing whitespace is trimmed, that auto indentation is enabled, and that the syntax highlighting is set to PHP. Additionally, these settings will set the default encoding, file type, and font for the Sublime Text editor.

By tweaking these settings, you can easily customize your Sublime Text editor to suit your specific needs when coding in PHP. With these settings, you can ensure that the coding process is as efficient and comfortable as possible.

Answers (0)