Vim: Jump to line and change from another line?
up vote
0
down vote
favorite
I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d
.
As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d
(delete), you should also be able to use c
(change) or y
(yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c
then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.
I am aware i could just :95
and then cc
, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d
Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?
vim
add a comment |
up vote
0
down vote
favorite
I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d
.
As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d
(delete), you should also be able to use c
(change) or y
(yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c
then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.
I am aware i could just :95
and then cc
, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d
Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?
vim
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d
.
As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d
(delete), you should also be able to use c
(change) or y
(yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c
then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.
I am aware i could just :95
and then cc
, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d
Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?
vim
I know from the question "Vim: Can you delete a specific line number from another line" that you delete a specific line by using :95d
.
As far as I understand Vim, then it should be possible to use verbs in any combination, e.g. where you can use d
(delete), you should also be able to use c
(change) or y
(yank). This does not seem to be the case with the jump-to-line motion. If I do a :95c
then I would expect it to go to line 95 and change that line. This does not happen. Vim just stares at me, waiting for my next input.
I am aware i could just :95
and then cc
, but since Vim is all about productivity and as few keystrokes as possible, I was hoping for a command similar to :95d
Is there any way to jump to a specific line and change it, in one command and without macros/binds (I'm trying to keep my install as clean as possible)?
vim
vim
asked yesterday
Esben Boye-Jacobsen
731414
731414
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.
For delete, there's not much difference between :95d<CR>
and 95Gdd
(both five keys, one of them shifted). For change, the :change
command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single .
on a separate line), as :help :change
explains.
If that's weird for you, then by all means use 95Gcc
, or :95norm! cc<CR>
if you insist on going through command-line mode.
1
Agreed, use95G
instead of:95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.
For delete, there's not much difference between :95d<CR>
and 95Gdd
(both five keys, one of them shifted). For change, the :change
command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single .
on a separate line), as :help :change
explains.
If that's weird for you, then by all means use 95Gcc
, or :95norm! cc<CR>
if you insist on going through command-line mode.
1
Agreed, use95G
instead of:95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
add a comment |
up vote
3
down vote
accepted
If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.
For delete, there's not much difference between :95d<CR>
and 95Gdd
(both five keys, one of them shifted). For change, the :change
command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single .
on a separate line), as :help :change
explains.
If that's weird for you, then by all means use 95Gcc
, or :95norm! cc<CR>
if you insist on going through command-line mode.
1
Agreed, use95G
instead of:95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.
For delete, there's not much difference between :95d<CR>
and 95Gdd
(both five keys, one of them shifted). For change, the :change
command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single .
on a separate line), as :help :change
explains.
If that's weird for you, then by all means use 95Gcc
, or :95norm! cc<CR>
if you insist on going through command-line mode.
If you go through command-line mode, you'll have to live with the peculiarities of the used Ex command.
For delete, there's not much difference between :95d<CR>
and 95Gdd
(both five keys, one of them shifted). For change, the :change
command does not go into interactive editing, as you expect, but instead asks for the replacement text on the command-line (concluded by entering a single .
on a separate line), as :help :change
explains.
If that's weird for you, then by all means use 95Gcc
, or :95norm! cc<CR>
if you insist on going through command-line mode.
answered yesterday
Ingo Karkat
128k14141193
128k14141193
1
Agreed, use95G
instead of:95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
add a comment |
1
Agreed, use95G
instead of:95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
1
1
Agreed, use
95G
instead of :95
– Conner
21 hours ago
Agreed, use
95G
instead of :95
– Conner
21 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
6 hours ago
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372201%2fvim-jump-to-line-and-change-from-another-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown