vim - open file and goto line number using ::
Clash Royale CLAN TAG#URR8PPP
up vote
19
down vote
favorite
Several tools such as grep
, py.test
, etc ... use the pattern <FileName>:<line number>:
to point to errors. For example:
; grep -Hn Common setup.cfg
setup.cfg:11: Common
How can I modify vim and gvim so that I can invoke them like so:
gvim setup.cfg:11:
instead of
gvim setup.cfg +11
I know that I can write a small shell script that would parse things but I wonder if there is an easier way.
vim gvim
add a comment |Â
up vote
19
down vote
favorite
Several tools such as grep
, py.test
, etc ... use the pattern <FileName>:<line number>:
to point to errors. For example:
; grep -Hn Common setup.cfg
setup.cfg:11: Common
How can I modify vim and gvim so that I can invoke them like so:
gvim setup.cfg:11:
instead of
gvim setup.cfg +11
I know that I can write a small shell script that would parse things but I wonder if there is an easier way.
vim gvim
2
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See:help quickfix
for more info.
â Random832
Oct 5 '12 at 12:48
add a comment |Â
up vote
19
down vote
favorite
up vote
19
down vote
favorite
Several tools such as grep
, py.test
, etc ... use the pattern <FileName>:<line number>:
to point to errors. For example:
; grep -Hn Common setup.cfg
setup.cfg:11: Common
How can I modify vim and gvim so that I can invoke them like so:
gvim setup.cfg:11:
instead of
gvim setup.cfg +11
I know that I can write a small shell script that would parse things but I wonder if there is an easier way.
vim gvim
Several tools such as grep
, py.test
, etc ... use the pattern <FileName>:<line number>:
to point to errors. For example:
; grep -Hn Common setup.cfg
setup.cfg:11: Common
How can I modify vim and gvim so that I can invoke them like so:
gvim setup.cfg:11:
instead of
gvim setup.cfg +11
I know that I can write a small shell script that would parse things but I wonder if there is an easier way.
vim gvim
vim gvim
asked Oct 5 '12 at 7:14
Sardathrion
2,41542248
2,41542248
2
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See:help quickfix
for more info.
â Random832
Oct 5 '12 at 12:48
add a comment |Â
2
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See:help quickfix
for more info.
â Random832
Oct 5 '12 at 12:48
2
2
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See
:help quickfix
for more info.â Random832
Oct 5 '12 at 12:48
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See
:help quickfix
for more info.â Random832
Oct 5 '12 at 12:48
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
13
down vote
accepted
You can use the file:line plugin available here, which does exactly what you want...
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
add a comment |Â
up vote
9
down vote
There isn't a way, and I think a script is the only way.
The reason being, what if you had a file called setup.cfg:11 and wanted to edit it?
Here is a quick script that does what you want as a oneliner...
editline() vim $1%%:* +$1##*:;
Sorry this is not accurate: What if you had a file called+11
? You can, of course, use--
for that.
â Sardathrion
Oct 5 '12 at 7:44
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
add a comment |Â
up vote
2
down vote
With Vundle.vim, add this to your .vimrc
:
Plugin 'bogado/file-line'
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
add a comment |Â
up vote
0
down vote
Alternatively you can use below syntax:
$ vim filename +line_num
New contributor
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
13
down vote
accepted
You can use the file:line plugin available here, which does exactly what you want...
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
add a comment |Â
up vote
13
down vote
accepted
You can use the file:line plugin available here, which does exactly what you want...
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
add a comment |Â
up vote
13
down vote
accepted
up vote
13
down vote
accepted
You can use the file:line plugin available here, which does exactly what you want...
You can use the file:line plugin available here, which does exactly what you want...
answered Jun 6 '14 at 16:59
mmigdol
24623
24623
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
add a comment |Â
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
1
1
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
It sure does and with the added bonus that you can use vundle to install it.
â Sardathrion
Jun 25 '15 at 6:53
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
The references file-line plugin has some issues, including brokeness when tab pages are in use. vim-fetch does what file-line does, but better.
â Lekensteyn
Jul 16 '15 at 9:06
add a comment |Â
up vote
9
down vote
There isn't a way, and I think a script is the only way.
The reason being, what if you had a file called setup.cfg:11 and wanted to edit it?
Here is a quick script that does what you want as a oneliner...
editline() vim $1%%:* +$1##*:;
Sorry this is not accurate: What if you had a file called+11
? You can, of course, use--
for that.
â Sardathrion
Oct 5 '12 at 7:44
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
add a comment |Â
up vote
9
down vote
There isn't a way, and I think a script is the only way.
The reason being, what if you had a file called setup.cfg:11 and wanted to edit it?
Here is a quick script that does what you want as a oneliner...
editline() vim $1%%:* +$1##*:;
Sorry this is not accurate: What if you had a file called+11
? You can, of course, use--
for that.
â Sardathrion
Oct 5 '12 at 7:44
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
add a comment |Â
up vote
9
down vote
up vote
9
down vote
There isn't a way, and I think a script is the only way.
The reason being, what if you had a file called setup.cfg:11 and wanted to edit it?
Here is a quick script that does what you want as a oneliner...
editline() vim $1%%:* +$1##*:;
There isn't a way, and I think a script is the only way.
The reason being, what if you had a file called setup.cfg:11 and wanted to edit it?
Here is a quick script that does what you want as a oneliner...
editline() vim $1%%:* +$1##*:;
edited Oct 5 '12 at 7:48
answered Oct 5 '12 at 7:38
Julian
64944
64944
Sorry this is not accurate: What if you had a file called+11
? You can, of course, use--
for that.
â Sardathrion
Oct 5 '12 at 7:44
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
add a comment |Â
Sorry this is not accurate: What if you had a file called+11
? You can, of course, use--
for that.
â Sardathrion
Oct 5 '12 at 7:44
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
Sorry this is not accurate: What if you had a file called
+11
? You can, of course, use --
for that.â Sardathrion
Oct 5 '12 at 7:44
Sorry this is not accurate: What if you had a file called
+11
? You can, of course, use --
for that.â Sardathrion
Oct 5 '12 at 7:44
2
2
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
You can edit a +11 file by saying vim ./+11
â Julian
Oct 5 '12 at 7:47
add a comment |Â
up vote
2
down vote
With Vundle.vim, add this to your .vimrc
:
Plugin 'bogado/file-line'
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
add a comment |Â
up vote
2
down vote
With Vundle.vim, add this to your .vimrc
:
Plugin 'bogado/file-line'
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
add a comment |Â
up vote
2
down vote
up vote
2
down vote
With Vundle.vim, add this to your .vimrc
:
Plugin 'bogado/file-line'
With Vundle.vim, add this to your .vimrc
:
Plugin 'bogado/file-line'
edited Jan 17 at 10:17
answered Oct 12 '16 at 15:56
Dorian
1214
1214
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
add a comment |Â
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
@Sardathrion: Which issues do you have?
â Dorian
Oct 14 '16 at 0:13
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
I moved to neovim and there are lots of issues that mark other modules (or whatever neovim calls them) as incompatible.
â Sardathrion
Oct 14 '16 at 6:50
add a comment |Â
up vote
0
down vote
Alternatively you can use below syntax:
$ vim filename +line_num
New contributor
add a comment |Â
up vote
0
down vote
Alternatively you can use below syntax:
$ vim filename +line_num
New contributor
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Alternatively you can use below syntax:
$ vim filename +line_num
New contributor
Alternatively you can use below syntax:
$ vim filename +line_num
New contributor
New contributor
answered 6 mins ago
shubham tambere
1
1
New contributor
New contributor
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f49996%2fvim-open-file-and-goto-line-number-using-filenameline-nbr%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
This isn't exactly analogous, but vim does have a feature to load the output from grep or (for example) compiler errors from make, and navigate between them. See
:help quickfix
for more info.â Random832
Oct 5 '12 at 12:48