Skip to content

Instantly share code, notes, and snippets.

@zaherg
Forked from Tom32i/Key Bindings - User.json
Created December 19, 2013 16:28
Show Gist options
  • Save zaherg/8042068 to your computer and use it in GitHub Desktop.
Save zaherg/8042068 to your computer and use it in GitHub Desktop.
{
"jsdocs_align_tags": "no",
"jsdocs_param_description": false,
"jsdocs_return_description": false,
"jsdocs_spacer_between_sections": true
}
{
"trailing_spaces_trim_on_save": true
}
{
"font_size": 14,
"translate_tabs_to_spaces": true,
"highlight_line": true,
"highlight_modified_tabs": true
}

Sublime Text 3 Base configuration

Should probably work fine on Sublime Text 2 ;)

Installation:

List of packages:

PackageControl
Alignment
DocBlockr
GitGutter
PHP-Twig
TrailingSpaces
PHP Code Sniffer
PHP Namespace
Less

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)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment