What is the name of the keyboard shortcut &/or method in an IDE which allows me to jump past automatically generated </endtags>?

左心房为你撑大大i 提交于 2019-12-11 05:10:41

问题


This question relates to a prior question which was answered for all practical purposes with a fellow telling me I simply needed to press the "End" key to skip the cursor to the end of the line. But a second respondee told me of other IDE's abilities to this (his words): "In some IDE, pressing the tab key will move your cursor to the next placeholders in the currently auto replaced element, and if there is no more placeholders, brings you past the end of the auto replaced text."

What is this ability called?

I'll show an example very quickly, if you or I were writing some code in Aptana or RubyMine (my two favorite IDE's)...

  <table summary="Subject detail view">
    <tr>
      <th>Name*</th>**
    </tr>
  </table>

We'd eventually run into the location(*), where the single asterisk is. We would reach this point and be forced to either use our mouse to click past the auto-generated </endtag>, or our keyboard arrows, or, most recently, the "End" key which would skip our cursor to the end of the line.

But can't I just do this with tab like my friend told me? In order to be able to do this I need to know what this keyboard shortcut is called. I need a searchable keyword. Any additional feedback about keyboard/IDE shortcuts etc would also be appreciated.


回答1:


RubyMine (and IntelliJ IDEA platform it's based on) doesn't have this feature yet. There is an open feature request in the YouTrack issue tracker:

  • IDEA-74666 Add Eclipse Style Paren/Bracket/Quote Completiton



回答2:


I have figured out the king of all answers for this question, which is my own.

Create your own macro. It is stupid how easy this is to do (with Komodo Edit, at least).

To do this in Komodo Edit, for example, first set yourself up so your cursor is a position where you need the custom command, whatever that might be.

So, let's say your at the end of an xml tag with your cursor where this ("|") symbol is

<xmltag>blahblah|</xmltag>

Now the < /endtag> has been generated automatically, just to make sure you know that.

Now, go to Tools, Macros, Start Recording. Click it. relax, you can do this as many times as you like...it only records keystrokes, by the way, so do this only with your keyboard. To skip to the end of the tag without the arrow keys, use the 'End' key. And I don't mean to insult your intelligence, but in case you didn't know this, you need to use the End key and not the arrows because future tags could be any length.

OK so do this:

<xmltag>blahblah</xmltag>
|

So you're there. Good, now go to Tools, Macros, and stop the recording.

Next, click on tools, macros, and save the macro.

Then, go to your macro library (same tools submenu) and you should see in the toolbox the file which you named which contains your macro.

Right click it, Properties, Key Bindings tab, then set your custom command in the 'new' form. Apply. OK. You're done.

Test it out, and pat yourself on the back, you just learned something really, really, really useful.

Btw, here's another one I've created.

<!-- | -->

That is a macro command as well. Obviously, you could create an entire form with a simple macro command.



来源:https://stackoverflow.com/questions/10662034/what-is-the-name-of-the-keyboard-shortcut-or-method-in-an-ide-which-allows-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!