How to remove/sort file types in the File -> new and right-click New dialog ?

Answered

 I get a bunch of file types that I do not use (typescript, coffescript etc) and the one I want is at the bottom.

 
 
3
12 comments

Hi there,

>How to remove/sort file types in the File -> new

Not possible at the moment

 

>right-click New dialog

What do you mean by "right click"?

Do you want to bring it via keyboard shortcut or what?

 

>and the one I want is at the bottom.

Just start typing while menu is visible/active -- Speed Search (in place filtering) works there as well.

 

0

Thank you for the reply.

Judging from the age of those tickets it looks like this will never be implemented. 

 

 

> What do you mean by "right click"?

I mean right-click in the project tree and select "New". No keyboard involved.

 

 
 
0

>I mean right-click in the project tree and select "New". No keyboard involved.

That depends on your OS and Keymap used.

But have a look at "File | New..." -- it will list your current shortcut there. Quite likely it will be "Alt + Insert"

NOTE: It is context-dependant action (e.g. works in Project View, Navigation bar etc). If you invoke it while in Editor -- you will see " Code | Generate..." instead (once again -- depends on Keymap/shortcut assigned).

0

Thanks,

probably I was not clear: I know the shortcut is alt+insert but I want to be able to also limit the choice of files appearing when using the mouse.

 
0

I see. Sorry for misunderstanding. Usually people asking other way around -- use keyboard only and leave the mouse on a side.

AFAIK it's not possible to put specific File Template into some custom place... and list of file templates is not customisable (unless you disable some of the plugins that provide some of these templates).

0

BTW -- what kind of template you wish to make "more accessible" -- custom one or bundled (provided by plugin).

Apparently bundled ones are now listed as individual entries .. so they can get custom shortuct or added to the context menu (e.g. "Plugins | JavaScript Support | JavaScript File" for that specific entry)

1

Awesome!

That does it. Thanks a lot.

 
0

This is great, however, I have come from DataGrip to PyCharm (my work is 70% SQL and 30% Python) and I want to add SQL file as an option from this context menu (in DataGrip it's obviously the top one by default).  I can't find any existing action for "create SQL file" - tried searching for a "SQL File" action to add to this context menu and can't find one anywhere.  Is there some way to steal the necessary bits from the DataGrip template, maybe? 

0

@Nick

Please clarify your requirements.

I'm not using (and have not used in the past) DataGrip .. so not sure what "create SQL file" action does exactly.

  • Do you want just add an entry that just creates .sql file? Well, you can create custom File Template and it will appear in the "New..." menu.
  • Or you want to add it in a specific place there? I do not see any actions or bundled template for crating SQL file in PhpStorm 2018.1.6 so don't think it's possible.
0

In DataGrip's file menu (and in the project pane context menu), the first thing in the "New" list is "SQL File".  OK, I can easily click "New File" and give it a SQL extension, but most of my new files are .sql, so it would be nice to be able to add it to the context menu in PyCharm, but there is no Action in PyCharm called "SQL File" as there is in DataGrip.  Doesn't seem to be any way to create it.

0

So ... create new File Template for .sql extension. Have you tried it? It will not be first item in the list ... but it will be there.

But yes -- there is no bundled "SQL File" template entry; most likely because SQL files are not that often created as compared to Python files... especially in a Python IDE.

1

Andriy I'm so sorry - pretty straightforward.  I had got hung up on expecting there to be an action for it - spent ages trawling through the IDE prefs directories to try to find them from DataGrip.  D'oh.

0

Please sign in to leave a comment.