New file keyboard shortcuts

Issue #236 resolved
Matt Addy created an issue

It might be due to my lack of knowledge of IntelliJ in general, but I can't figure out how to create a new source file using my keyboard.

Using OS X:

  • When no files are currently opened, then Cmd + N does nothing.
  • When a .page file is opened, Cmd + N opens a "Generate" dialog with an option for XML tag. From here, it doesn't seem possible to create any type of file.
  • When a .cls file is opened, Cmd + N opens a "New" dialog with "Apex class" as an option. From here, it doesn't seem possible to create a Visualforce page or component, trigger, etc.

Long story short, I'm wondering if you have any suggestions on how to reliably create a Visualforce page or apex class using a keyboard shortcut from any state of the current IDE.

Thanks Scott.

Comments (6)

  1. Scott Wells repo owner

    Matt, you can use Ctrl+Alt+Insert on Windows to open the New... popup. I'm not 100% sure what the key binding is on Mac, but my guess is that it might be Cmd+Opt+Insert or similar. However, right now this will only show the Illuminated Cloud file options when the current context is for Illuminated Cloud. For example, if the src directory is selected in the Project view, you'll be presented with options for Apex class, Apex trigger, Visualforce page, VF component, and static resource. If the pages directory is selected, you'll only be presented with the option for Visualforce page. If you're in the editor and the current tab is a page, you'll be presented with the VF page option; similar with Apex classes. While not perfect, this keyboard workflow will get you there:

    1. Cmd+1 - Open the Project view
    2. Cursor to the src directory
    3. Cmd+Opt+Insert (assuming my guess is correct) and choose, e.g., Visualforce Page

    Let me know whether that helps at all.

  2. Matt Addy Account Deactivated reporter

    Thanks Scott. The current workflow is what I started using after posting this issue:

    1. Cmd + Up Arrow: Put "cursor" into the navigation view
    2. Left/Right Arrow: To navigate to the 'src' folder
    3. Down/Up Arrow: To navigate to one of 'classes', 'components', 'pages', etc
    4. Cmd + N: New file

    I agree this isn't ideal but it works and I've gotten used to it. Not sure if its possible but it would be awesome if we could create some sort of key binding that allows us to create any type of file. If you feel this is not possible or not something you would consider as an enhancement, feel free to resolve this issue.

    Thanks again Scott.

  3. Scott Wells repo owner

    Let me chew on it. As much as possible I prefer to leverage the existing IntelliJ keys to make the experience seamless with the other languages in the IDE. What might make the most sense is to allow the New File functionality to be less restrictive about the current context. As a result, just initiating that action would present you with the option to create IC file types, and if there's an ambiguity about where to create them due to multiple IC modules in the project, I'd also include a module selector in the action. That would make this one keystroke plus module selection only when the context of the operation would be ambiguous. I'll keep this open as the enhancement request for that behavior.

  4. Matt Addy Account Deactivated reporter

    Thanks Scott. Of course, I would consider this of the lowest priority.

  5. Scott Wells repo owner

    I'm going to go ahead and resolve this unless it's still a big impediment to workflow. If so, please let me know and I'll prioritize it in the backlog.

  6. Log in to comment