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

Offline scunliffe

  • Registered User
  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
How do I turn off new file templates?
« on: April 17, 2016, 05: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: 2162
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: How do I turn off new file templates?
« Reply #1 on: April 17, 2016, 11:14:22 pm »
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: 15
  • Karma: +0/-0
    • View Profile
Re: How do I turn off new file templates?
« Reply #2 on: April 18, 2016, 02: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: 2162
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: How do I turn off new file templates?
« Reply #3 on: April 18, 2016, 03: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 :)

 

Related Topics

  Subject / Started by Replies Last post
XML Code templates

Started by JJK « 1 2 » Bug reports

16 Replies
5122 Views
Last post December 04, 2008, 01:42:33 pm
by JJK
2 Replies
1624 Views
Last post December 11, 2008, 12:01:06 pm
by alex
3 Replies
1820 Views
Last post March 02, 2009, 01:51:51 am
by alex
4 Replies
2067 Views
Last post March 04, 2009, 05:25:29 pm
by alex
6 Replies
3315 Views
Last post November 12, 2009, 03:37:48 pm
by Stefan