Ubuntu: How to go to a specific line number in gedit, using guake?



Question:

I use guake which let me directly open a file if I ctrl+click on it. I have the need to open a file AND directly go to the specific line shown on screen.

How can I set guake to make it work? I tried writing this

gedit %(file_path):s%(line_number)s  

in guake settings, but that doesn't work.

Can you help me, please?


Solution:1

If you have a look at man gedit, it says the syntax is this:

gedit [OPTION...] [FILE...] [+LINE[:COLUMN]]  

I don't know how exactly your Guake settings need to be formatted (I'm especially confused by the two "s"), but the command which gets finally run should look like this to e.g. open FILE at line 42:

gedit /PATH/TO/FILE +42  


Solution:2

Gedit uses Vim/less-like line number support. See man gedit:

gedit [OPTION...] [FILE...] [+LINE[:COLUMN]]  

So, you probably need:

gedit %(file_path)s +%(line_number)s  

(Not sure what the s is, I'm not familiar with guake config, so I retained it.)


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »