How about this:
- Create your CEWP (saved as .dwp)
- Edit it as you like
- Export the web part
- Create a SharePoint Project in VS
- Create a Module
- Add the dwp file
Module (CustomCEWP):
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomCEWP" List="113" Url="_catalogs/wp">
<File Path="CustomCEWP\CustomCEWP.dwp" Url="CustomCEWP.dwp" Type="GhostableInLibrary">
<Property Name="Group" Value="My Web Parts" />
</File>
</Module>
</Elements>
CustomCEWP.dwp:
<?xml version="1.0" encoding="utf-8"?>
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title>Custom Content Editor</Title>
<FrameType>Default</FrameType>
<IsIncluded>true</IsIncluded>
<FrameState>Normal</FrameState>
<AllowRemove>true</AllowRemove>
<AllowZoneChange>true</AllowZoneChange>
<AllowMinimize>true</AllowMinimize>
<AllowConnect>true</AllowConnect>
<AllowEdit>true</AllowEdit>
<AllowHide>true</AllowHide>
<IsVisible>true</IsVisible>
<HelpMode>Modeless</HelpMode>
<Dir>Default</Dir>
<MissingAssembly>Cannot import this Web Part.</MissingAssembly>
<PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
<ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
<Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[ <script>console.log('oh, hai');</script>]]></Content>
<PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
</WebPart>