简体   繁体   中英

eclipse: make 'down' key go to end of line IF its the last line

simple eclipse question: is there a way i can make the 'down' key move to the end of the line (like the 'end' key binding) IF im editing the last line of the file (so it continues to behave like before, if its not the last line of the file)?

pretty much like visual studio works, move up and down lines if its not the last line, but acts like 'end' if its the last line. thanks.

Not with the eclipse as it is currently distributed: a command like "Line Down", associated to the key, will always move down the lines, not jump at the end of one.

You would need to define your own keyboard shortcut , like the one describe in this Eclipse wiki entry , associated to your own key-binding configuration . It would be similar to:

   <extension
         point="org.eclipse.ui.bindings">
      <key
            commandId="org.eclipse.ui.examples.contributions.view.edit"
            contextId="org.eclipse.ui.examples.contributions.view.context"
            sequence="ARROW_DOWN"
            schemeId="org.eclipse.ui.examples.contributions.scheme">
      </key>
   </extension>

See also the help page .

then you would run your patched version of eclipse, with the relevant action taken when ARROW_DOWN is pressed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM