Skip to content

Instantly share code, notes, and snippets.

@Tom32i
Last active January 4, 2019 09:40
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Tom32i/7910200 to your computer and use it in GitHub Desktop.
Save Tom32i/7910200 to your computer and use it in GitHub Desktop.
Sublime Text 3 Base configuration

Sublime Text 3 Base configuration

Should probably work fine on Sublime Text 2 ;)

Installation:

List of packages:

PackageControl

Alignment
Babel
DocBlockr
DotEnv
GitGutter
PHP Namespace
PHP-Twig
Phpcs
Sass
TrailingSpaces
Unicode Character Highlighter

Enable Sublime in CLI:

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

Configuration

Acces to the following configuration file through Sublime Text > Préférences menu.

Settings - User

Use spaces indentation (instead of tabs):

"translate_tabs_to_spaces": true

Slightly highlight the current line:

"highlight_line": true

Display modified files in color (instead of appending an *):

"highlight_modified_tabs": true

Key Bindings - User

  • Tab will indent the selected line(s) and Shift+Tab will unindent them.
  • On a PHP class, alt+i will generate the namespace of the class (calculated from the directory)
  • On a PHP class, alt+u will generate an "use" statement for the class (calculated from the directory)
  • [FR Azerty keyboard only] On mac, "cmd + )" will indent, "cmd + (" will unindent.

Package Settings > DocBlockr

Before a method declaration, "/**" + tab will generate the following doc comment:

/**
 * [execute description]
 *
 * @param InputInterface $input
 * @param OutputInterface $output
 *
 * @return [type]
 */
protected function execute(InputInterface $input, OutputInterface $output)
{
    return $object;
}

Package Settings > Trailing Spaces

Will trim trailing space automatically on fiel save.

[
{ "keys": ["super+)"], "command": "indent" },
{ "keys": ["super+("], "command": "unindent" }
]
{
"jsdocs_align_tags": "no",
"jsdocs_param_description": false,
"jsdocs_return_description": false,
"jsdocs_spacer_between_sections": true
}
{
"trailing_spaces_trim_on_save": true
}
{
"ensure_newline_at_eof_on_save": true,
"font_size": 16,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment