Reputation: 41070
I can open a file in exclipse, but is there any syntax to jump to a specific line?
VI can do this by
vi -c LINE filename
Upvotes: 18
Views: 17140
Reputation: 194
Try
eclipse.exe file.txt:22
for newer versions of eclipse, and
eclipse.exe file.txt+178
for older ones.
Upvotes: 2
Reputation: 1590
Hmm. For me it works on Windows as simple as
eclipse.exe path\filename.ext:42
(I was actually looking for a consistent solution across IDEs.
Pycharm offers pycharm.exe path:number
as well but it does not seem to work :/)
Upvotes: 3
Reputation: 131
Only tested on MARS:
Preferences > Keys > "Open from Clipboard"
Assign key binding.
In latest Version [Oxygen] key was ctrl+shift+v
Upvotes: 10
Reputation: 1
Continuing from @raho's response, the complete menu path is: Window -> Preferences -> General -> Keys
This won't work on c++ as far as I can tell.
(I'm using Oxygen 4.7.1a)
Upvotes: 0
Reputation: 1314
Finally fixed!!
On Windows:
eclipsec.exe -name Eclipse --launcher.openFile %USERPROFILE%\workspace\MyClass.java:50
On Linux/Mac:
eclipse -name Eclipse --launcher.openFile ~/workspace/MyClass.java:50
Upvotes: 13
Reputation: 1326782
Not exactly the right answer, but for Java file, you can use the package explorer, or the outline view, useful to select a group of lines) and open the file to the line matching a Java element (class, method, variable, ...)
Once the file is already opened, CTRL+L is the way to go to a line of the currently edited file, as Adi mentions in the comment.
Upvotes: 44
Reputation: 597234
CTRL+SHIFT+R (Open Resource) or CTRL+SHIFT+T (Open Type, for classes only)
Type the name / the start of the name / the first letters of a camel case name
CTRL+L (Go to line)
Upvotes: 8