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
-
I can not understand what you mean by syntax,but keyboard shortcut CTRL+L will open a popup and you can enter line number there.Adisesha– Adisesha2010年02月19日 11:03:59 +00:00Commented Feb 19, 2010 at 11:03
-
@Adi: CTRL+L would work only when "Editing Text", i.e if the file is already opened...VonC– VonC2010年02月19日 11:58:12 +00:00Commented Feb 19, 2010 at 11:58
-
@Von He mentioned 'I can open a file in eclipse', I guess he already know how to open.Adisesha– Adisesha2010年02月19日 12:39:47 +00:00Commented Feb 19, 2010 at 12:39
-
3@Adi: I interpreted it as: "how to open file (not yet opened) directly to a specified line.VonC– VonC2010年02月19日 13:18:38 +00:00Commented Feb 19, 2010 at 13:18
7 Answers 7
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, ...)
Eclipse open
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.
5 Comments
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
Comments
Only tested on MARS:
Preferences> Keys> "Open from Clipboard"
Assign key binding.
- Copy i.e. log entry in format Main.java:1
- Press chosen key binding
- voilà
In latest Version [Oxygen] key was ctrl+shift+v
1 Comment
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)
Comments
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 :/)
Comments
Try
eclipse.exe file.txt:22
for newer versions of eclipse, and
eclipse.exe file.txt+178
for older ones.
Comments
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)