├── README.md └── SublimeDrupal.sh /README.md: -------------------------------------------------------------------------------- 1 | sublime-drupal 2 | ============== 3 | 4 | Sets up Sublime Text editor for Drupal development -------------------------------------------------------------------------------- /SublimeDrupal.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Attempt OS detection to set path 4 | os=`uname`; 5 | phpcs=`which phpcs`; 6 | 7 | # ST2 Packages directory 8 | if [ $os = 'Linux' ] 9 | then 10 | st2Dir=~/".config/sublime-text-2/Packages/" 11 | else 12 | # Assume OSX 13 | st2Dir=~/"Library/Application Support/Sublime Text 2/Packages/" 14 | fi 15 | 16 | # User Packages Directory 17 | st2UserDir="$st2Dir"User/; 18 | 19 | # Default Settings File 20 | st2Settings="$st2UserDir"Preferences.sublime-settings; 21 | 22 | # Navigate to Packages Directory 23 | cd "$st2Dir"; 24 | 25 | # Clone all the plugins! 26 | 27 | # Package Control 28 | git clone https://github.com/wbond/sublime_package_control.git "Package Control"; 29 | 30 | # BracketHighlighter 31 | git clone https://github.com/facelessuser/BracketHighlighter.git BracketHighlighter; 32 | 33 | # DocBlockr 34 | git clone https://github.com/spadgos/sublime-jsdocs.git DocBlockr; 35 | 36 | # LiveCSS 37 | git clone https://github.com/a-sk/livecss.git LiveCSS; 38 | 39 | # GotoDrupalAPI 40 | git clone https://github.com/BrianGilbert/Sublime-Text-2-Goto-Drupal-API.git; 41 | 42 | # Drupal Sublime Snippets 43 | git clone https://github.com/juhasz/drupal_sublime-snippets.git DrupalSublimeSnippets; 44 | 45 | # DrupalCodingStandard Fork 46 | git clone https://github.com/rypit/DrupalCodingStandard.git DrupalCodingStandard; 47 | 48 | # Address pathing issues with DrupalCodingStandard's phpcs path 49 | if [ -d /usr/bin/phpcs ]; then 50 | # Control will enter here if $DIRECTORY exists. 51 | echo "Setting a symlink to phpcs for DrupalCodingStandard..." 52 | sudo ln -s "$phpcs" /usr/bin/phpcs 53 | fi 54 | 55 | # Default Preferences 56 | git clone https://github.com/rypit/drupal-sublime-config.git DrupalSublimeConfig; 57 | 58 | # Back up old settings file 59 | echo "Backing up previous version of Preferences.sublime-settings..." 60 | sudo cp -Lf "$st2Settings" "$st2Settings".bak 61 | 62 | # Link up new settings file 63 | echo "Linking up settings Preferences.sublime-settings..." 64 | ln -fs "$st2Dir"DrupalSublimeConfig/Preferences.sublime-settings "$st2Settings"; 65 | 66 | echo "Done"; 67 | --------------------------------------------------------------------------------