Author Topic: How do I turn off new file templates?  (Read 1644 times)

Offline scunliffe

  • Registered User
  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
How do I turn off new file templates?
« on: April 17, 2016, 06:46:14 PM »
I'm not sure how I turned this on, but every time I create a new file (CTRL+N) HippoEDIT "looks" at my current file (a JavaScript file) and creates the new file with a template it got from somewhere.

It is a bit awkward since I didn't necessarily want to create another JavaScript file... however in short I will *NEVER* want this for a JavaScript file but it is extra frustrating because I get code for Microsoft's proprietary JScript language which is something I will never use.

----
Code: Javascript
  1. // JavaScript template using Windows Script Host
  2. var WSHShell = WScript.CreateObject("WScript.Shell");
  3. WSHShell.Popup( "Hello World!" );
----

I'm sure the setting is really obvious somewhere, but I can't seem to find it.  I searched under Tools > Options >"Template" but all I found was code-completion templates. e.g. if I type "for(" it fills in "for(var i=0;i<X;i++){" for me.

Does anyone know where the setting is hiding?


Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2190
  • Karma: +37/-3
    • HippoEDIT
Re: How do I turn off new file templates?
« Reply #1 on: April 18, 2016, 12:14:22 AM »
Hi Stephen,

there is two things:
1) Ctrl+N uses syntax from current file to create new file.
2) New file created with some template content, which is coming from somewhere.

If you do not like issue 1) you can use this XML flag:
http://wiki.hippoedit.com/options/xml/new-file-as-current

If you want to change behaviour 2), check this page for details. In you case, solution may be adopting or deleting the default template for JavaScript (default.js).
http://wiki.hippoedit.com/files/template

Best regards,
Alex.

Offline scunliffe

  • Registered User
  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: How do I turn off new file templates?
« Reply #2 on: April 18, 2016, 03:48:11 PM »
Thanks Alex!

The Templates (#2) was exactly what I was after.  For my JavaScript file it is now just blank.... though I may change that to a self-executing anonymous function instead at some point.

e.g. something like this
Code: Javascript
  1. (function(window, undefined){
  2.   //do stuff
  3. })(window);

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2190
  • Karma: +37/-3
    • HippoEDIT
Re: How do I turn off new file templates?
« Reply #3 on: April 18, 2016, 04:54:46 PM »
Actually, I may change the default template for JS also in standard. And move WSH template to dedicated template (eg wsh.js).
If you will have a good and robust idea for default.js inform me also, I will take for all :)