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 Nov 19 at 10:01
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, use95Ginstead of:95
– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
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, use95Ginstead of:95
– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
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, use95Ginstead of:95
– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
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 Nov 19 at 10:24
Ingo Karkat
129k14141193
129k14141193
1
Agreed, use95Ginstead of:95
– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
add a comment |
1
Agreed, use95Ginstead of:95
– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
1
1
Agreed, use
95G instead of :95– Conner
Nov 19 at 16:46
Agreed, use
95G instead of :95– Conner
Nov 19 at 16:46
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
Ok, that makes sense - Thanks for your answer!
– Esben Boye-Jacobsen
Nov 20 at 8:07
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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