#!/bin/bash # set the contexts on every template that hasn't one yet VER="12.0" FILEPHP=~/.netbeans/$VER/config/Editors/text/x-php5/CodeTemplates/org-netbeans-modules-editor-settings-CustomCodeTemplates.xml FILEJS=~/.netbeans/$VER/config/Editors/text/javascript/CodeTemplates/org-netbeans-modules-editor-settings-CustomCodeTemplates.xml FILEHTM=~/.netbeans/$VER/config/Editors/text/html/CodeTemplates/org-netbeans-modules-editor-settings-CustomCodeTemplates.xml FILECSS=~/.netbeans/$VER/config/Editors/text/css/CodeTemplates/org-netbeans-modules-editor-settings-CustomCodeTemplates.xml sed -i -e 's/ contexts="php-code"//gI' $FILEPHP sed -i -e 's/xml:space="preserve">/xml:space="preserve" contexts="php-code">/gI' $FILEPHP #"JavaScript-Code" must be written this way, not my bad! :-) sed -i -e 's/ contexts="JavaScript-Code"//gI' $FILEJS sed -i -e 's/xml:space="preserve">/xml:space="preserve" contexts="JavaScript-Code">/gI' $FILEJS sed -i -e 's/ contexts="html-code"//gI' $FILEHTM sed -i -e 's/xml:space="preserve">/xml:space="preserve" contexts="html-code">/gI' $FILEHTM sed -i -e 's/ contexts="css-code"//gI' $FILECSS sed -i -e 's/xml:space="preserve">/xml:space="preserve" contexts="css-code">/gI' $FILECSS