Sublime Forum

Subl should support the +linenumber syntax

#1

Tools like less prepend filename with +linenumber to tell the EDITOR to scroll to a given line. Would be nice if subl supported it.
Currently pressing v in less opens a window with 2 tabs: one new file tab with a linenumber and another with a file.

0 Likes

#2

You can already do this using :, eg: subl file.txt:3:5 opens the file at like 3 column 5.

0 Likes

#3

Thanks, that definitely allows a workaround.

But I think this particular use case, i.e. being compatible with this kind of EDITOR invocation, would be nice to be supported out of the box.

0 Likes

#4

I wouldn’t say it is a workaround, it’s just the way it is done in Sublime. Every editor does it differently, some happen to do it the same, but there is no universal approach. I personally prefer Sublime to not change their approach. There is absolutely no advantage to be gained by changing the syntax. A matter of fact, VSCode, arguably the most popular editor (which took a heavy amount of inspiration from Sublime) copied Sublime’s line number syntax:

  -g --goto <file:line[:character]> Open a file at the path on the specified line and character position.
1 Like

#5

I call it a workaround because instead of specifying EDITOR once I need to repeat myself and override tool-specific env variables to fix arguments format. With respect to my example I am forced to override LESSEDIT.

0 Likes