delete line in vi
Clash Royale CLAN TAG#URR8PPP
How can I delete a line in VI?
Here what I am doing right now:
- Open up the terminal alt + ctrl + t
vi a.txt
- I move my cursor to the line which I wan to delete, then what key-combination is should use to delete line in vi editor?
ubuntu terminal vim vi
add a comment |
How can I delete a line in VI?
Here what I am doing right now:
- Open up the terminal alt + ctrl + t
vi a.txt
- I move my cursor to the line which I wan to delete, then what key-combination is should use to delete line in vi editor?
ubuntu terminal vim vi
5
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
2
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00
add a comment |
How can I delete a line in VI?
Here what I am doing right now:
- Open up the terminal alt + ctrl + t
vi a.txt
- I move my cursor to the line which I wan to delete, then what key-combination is should use to delete line in vi editor?
ubuntu terminal vim vi
How can I delete a line in VI?
Here what I am doing right now:
- Open up the terminal alt + ctrl + t
vi a.txt
- I move my cursor to the line which I wan to delete, then what key-combination is should use to delete line in vi editor?
ubuntu terminal vim vi
ubuntu terminal vim vi
edited Apr 15 '11 at 12:51
Caleb
51k9149192
51k9149192
asked Apr 15 '11 at 10:45
I-M-JMI-M-JM
826275
826275
5
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
2
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00
add a comment |
5
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
2
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00
5
5
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
2
2
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00
add a comment |
7 Answers
7
active
oldest
votes
Pressing dd
will remove that line (actually it will cut it). So you can paste it via p
.
26
You have to be quick on the draw to get +10 fordd
– Eric Wilson
Apr 15 '11 at 16:59
add a comment |
As others said, it's dd
if you're in normal mode (press ESC) to ensure you are in normal mode, but by default, you will be. You may have found that vi doesn't act as you would expect an editor to act. It's pretty unique, and those unique features make it extremely powerful and fast to work with. If you want to learn more, you can run vimtutor
at the command line, and you'll get a quick (maybe an hour worth of reading/experimenting) tutorial on the basics of how to use it.
Now, you can use an editor with a more familiar interface. Most systems have nano
. You can type nano a.txt
to open your file in nano
. You can even go a step further - there isn't any reason you have to use a terminal-based editor. Since you mentioned using (Ctrl+Alt++T) and this is the default shortcut in Ubuntu and some other Gnome distributions, so I'd be surprised if you didn't have gedit
installed. At the command line, try gedit a.txt
and you'll get a graphical editor.
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
add a comment |
To delete the line under the cursor, use dd
.
The delete command accepts all the normal positional modifiers, so if you are on the beginning of the line below the one you want to delete, you could just dk
to go into delete mode and move up one line, deleting everything the cursor passed.
You can also specify repetition, so 5dd
will delete the line under the cursor five times, effectively deleting the current and following four lines.
8
Ord5d
. I don't know why, but I prefer this. (Fun fact:NdMd
deletes N × M lines)
– Random832
Apr 15 '11 at 19:28
add a comment |
Esc dd
after going to the line you want to delete
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
add a comment |
Make sure you are now in the "Normal" mode, and then press dd
.
The command ndd
will delete n lines from the line which the cursor is on.
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
add a comment |
In visual mode,
shift+v, choose the lines, then d
ctrl+v, choose the columns, then d
please try again. It works.
– Ben
Jul 20 '18 at 7:35
add a comment |
Open the file with commmand vi a.txt
, and then use command dd
. It should work.
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2funix.stackexchange.com%2fquestions%2f11369%2fdelete-line-in-vi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
Pressing dd
will remove that line (actually it will cut it). So you can paste it via p
.
26
You have to be quick on the draw to get +10 fordd
– Eric Wilson
Apr 15 '11 at 16:59
add a comment |
Pressing dd
will remove that line (actually it will cut it). So you can paste it via p
.
26
You have to be quick on the draw to get +10 fordd
– Eric Wilson
Apr 15 '11 at 16:59
add a comment |
Pressing dd
will remove that line (actually it will cut it). So you can paste it via p
.
Pressing dd
will remove that line (actually it will cut it). So you can paste it via p
.
answered Apr 15 '11 at 10:49
GertGert
7,12122934
7,12122934
26
You have to be quick on the draw to get +10 fordd
– Eric Wilson
Apr 15 '11 at 16:59
add a comment |
26
You have to be quick on the draw to get +10 fordd
– Eric Wilson
Apr 15 '11 at 16:59
26
26
You have to be quick on the draw to get +10 for
dd
– Eric Wilson
Apr 15 '11 at 16:59
You have to be quick on the draw to get +10 for
dd
– Eric Wilson
Apr 15 '11 at 16:59
add a comment |
As others said, it's dd
if you're in normal mode (press ESC) to ensure you are in normal mode, but by default, you will be. You may have found that vi doesn't act as you would expect an editor to act. It's pretty unique, and those unique features make it extremely powerful and fast to work with. If you want to learn more, you can run vimtutor
at the command line, and you'll get a quick (maybe an hour worth of reading/experimenting) tutorial on the basics of how to use it.
Now, you can use an editor with a more familiar interface. Most systems have nano
. You can type nano a.txt
to open your file in nano
. You can even go a step further - there isn't any reason you have to use a terminal-based editor. Since you mentioned using (Ctrl+Alt++T) and this is the default shortcut in Ubuntu and some other Gnome distributions, so I'd be surprised if you didn't have gedit
installed. At the command line, try gedit a.txt
and you'll get a graphical editor.
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
add a comment |
As others said, it's dd
if you're in normal mode (press ESC) to ensure you are in normal mode, but by default, you will be. You may have found that vi doesn't act as you would expect an editor to act. It's pretty unique, and those unique features make it extremely powerful and fast to work with. If you want to learn more, you can run vimtutor
at the command line, and you'll get a quick (maybe an hour worth of reading/experimenting) tutorial on the basics of how to use it.
Now, you can use an editor with a more familiar interface. Most systems have nano
. You can type nano a.txt
to open your file in nano
. You can even go a step further - there isn't any reason you have to use a terminal-based editor. Since you mentioned using (Ctrl+Alt++T) and this is the default shortcut in Ubuntu and some other Gnome distributions, so I'd be surprised if you didn't have gedit
installed. At the command line, try gedit a.txt
and you'll get a graphical editor.
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
add a comment |
As others said, it's dd
if you're in normal mode (press ESC) to ensure you are in normal mode, but by default, you will be. You may have found that vi doesn't act as you would expect an editor to act. It's pretty unique, and those unique features make it extremely powerful and fast to work with. If you want to learn more, you can run vimtutor
at the command line, and you'll get a quick (maybe an hour worth of reading/experimenting) tutorial on the basics of how to use it.
Now, you can use an editor with a more familiar interface. Most systems have nano
. You can type nano a.txt
to open your file in nano
. You can even go a step further - there isn't any reason you have to use a terminal-based editor. Since you mentioned using (Ctrl+Alt++T) and this is the default shortcut in Ubuntu and some other Gnome distributions, so I'd be surprised if you didn't have gedit
installed. At the command line, try gedit a.txt
and you'll get a graphical editor.
As others said, it's dd
if you're in normal mode (press ESC) to ensure you are in normal mode, but by default, you will be. You may have found that vi doesn't act as you would expect an editor to act. It's pretty unique, and those unique features make it extremely powerful and fast to work with. If you want to learn more, you can run vimtutor
at the command line, and you'll get a quick (maybe an hour worth of reading/experimenting) tutorial on the basics of how to use it.
Now, you can use an editor with a more familiar interface. Most systems have nano
. You can type nano a.txt
to open your file in nano
. You can even go a step further - there isn't any reason you have to use a terminal-based editor. Since you mentioned using (Ctrl+Alt++T) and this is the default shortcut in Ubuntu and some other Gnome distributions, so I'd be surprised if you didn't have gedit
installed. At the command line, try gedit a.txt
and you'll get a graphical editor.
edited Jun 25 '18 at 17:29
valiano
238111
238111
answered Apr 15 '11 at 12:41
Shawn J. GoffShawn J. Goff
29.8k19111134
29.8k19111134
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
add a comment |
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
A few people need it. If you edit text files regularly, it's worth the time to learn vim. If you don't, and you're just trying to follow some instructions to get something working, then it's probably not worth it unless you just interested in trying different software and learning new things.
– Shawn J. Goff
Apr 15 '11 at 16:36
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
I fired vimtutor at command line, and it opened up a vim, with a temp. file. Have I done any mistake?
– I-M-JM
Apr 16 '11 at 4:21
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
@i-m-jm I don't think you've made a mistake, but your system might have an unusual configuration. It should open a document that begins "Welcome to the VIM Tutor". If you're interested in working through that, you should post another question.
– Shawn J. Goff
Apr 16 '11 at 8:57
add a comment |
To delete the line under the cursor, use dd
.
The delete command accepts all the normal positional modifiers, so if you are on the beginning of the line below the one you want to delete, you could just dk
to go into delete mode and move up one line, deleting everything the cursor passed.
You can also specify repetition, so 5dd
will delete the line under the cursor five times, effectively deleting the current and following four lines.
8
Ord5d
. I don't know why, but I prefer this. (Fun fact:NdMd
deletes N × M lines)
– Random832
Apr 15 '11 at 19:28
add a comment |
To delete the line under the cursor, use dd
.
The delete command accepts all the normal positional modifiers, so if you are on the beginning of the line below the one you want to delete, you could just dk
to go into delete mode and move up one line, deleting everything the cursor passed.
You can also specify repetition, so 5dd
will delete the line under the cursor five times, effectively deleting the current and following four lines.
8
Ord5d
. I don't know why, but I prefer this. (Fun fact:NdMd
deletes N × M lines)
– Random832
Apr 15 '11 at 19:28
add a comment |
To delete the line under the cursor, use dd
.
The delete command accepts all the normal positional modifiers, so if you are on the beginning of the line below the one you want to delete, you could just dk
to go into delete mode and move up one line, deleting everything the cursor passed.
You can also specify repetition, so 5dd
will delete the line under the cursor five times, effectively deleting the current and following four lines.
To delete the line under the cursor, use dd
.
The delete command accepts all the normal positional modifiers, so if you are on the beginning of the line below the one you want to delete, you could just dk
to go into delete mode and move up one line, deleting everything the cursor passed.
You can also specify repetition, so 5dd
will delete the line under the cursor five times, effectively deleting the current and following four lines.
answered Apr 15 '11 at 11:50
CalebCaleb
51k9149192
51k9149192
8
Ord5d
. I don't know why, but I prefer this. (Fun fact:NdMd
deletes N × M lines)
– Random832
Apr 15 '11 at 19:28
add a comment |
8
Ord5d
. I don't know why, but I prefer this. (Fun fact:NdMd
deletes N × M lines)
– Random832
Apr 15 '11 at 19:28
8
8
Or
d5d
. I don't know why, but I prefer this. (Fun fact: NdMd
deletes N × M lines)– Random832
Apr 15 '11 at 19:28
Or
d5d
. I don't know why, but I prefer this. (Fun fact: NdMd
deletes N × M lines)– Random832
Apr 15 '11 at 19:28
add a comment |
Esc dd
after going to the line you want to delete
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
add a comment |
Esc dd
after going to the line you want to delete
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
add a comment |
Esc dd
after going to the line you want to delete
Esc dd
after going to the line you want to delete
answered Jan 14 '14 at 5:52
AnoopAnoop
16112
16112
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
add a comment |
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
1
1
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
The escape is not necessary, if you can go to the line you want to delete.
– Anthon
Jan 14 '14 at 6:15
2
2
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
Escape is needed if you use the arrow keys in insert mode to go to the right line.
– Alexander
May 4 '14 at 20:02
add a comment |
Make sure you are now in the "Normal" mode, and then press dd
.
The command ndd
will delete n lines from the line which the cursor is on.
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
add a comment |
Make sure you are now in the "Normal" mode, and then press dd
.
The command ndd
will delete n lines from the line which the cursor is on.
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
add a comment |
Make sure you are now in the "Normal" mode, and then press dd
.
The command ndd
will delete n lines from the line which the cursor is on.
Make sure you are now in the "Normal" mode, and then press dd
.
The command ndd
will delete n lines from the line which the cursor is on.
edited Jun 10 '11 at 13:47
Martin Ueding
1,31511228
1,31511228
answered Apr 15 '11 at 12:10
user6619
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
add a comment |
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
9
9
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
There is already an upvoted and accepted answer with this suggestion and another with details on your additional suggestion. In the future if you don't have anything new to add, throw your weight behind somebody elses answer. This is a collaborative community where we build on each other not fight for attention.
– Caleb
Apr 15 '11 at 13:04
add a comment |
In visual mode,
shift+v, choose the lines, then d
ctrl+v, choose the columns, then d
please try again. It works.
– Ben
Jul 20 '18 at 7:35
add a comment |
In visual mode,
shift+v, choose the lines, then d
ctrl+v, choose the columns, then d
please try again. It works.
– Ben
Jul 20 '18 at 7:35
add a comment |
In visual mode,
shift+v, choose the lines, then d
ctrl+v, choose the columns, then d
In visual mode,
shift+v, choose the lines, then d
ctrl+v, choose the columns, then d
edited Jul 20 '18 at 7:41
answered Jul 20 '18 at 7:23
BenBen
12
12
please try again. It works.
– Ben
Jul 20 '18 at 7:35
add a comment |
please try again. It works.
– Ben
Jul 20 '18 at 7:35
please try again. It works.
– Ben
Jul 20 '18 at 7:35
please try again. It works.
– Ben
Jul 20 '18 at 7:35
add a comment |
Open the file with commmand vi a.txt
, and then use command dd
. It should work.
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
add a comment |
Open the file with commmand vi a.txt
, and then use command dd
. It should work.
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
add a comment |
Open the file with commmand vi a.txt
, and then use command dd
. It should work.
Open the file with commmand vi a.txt
, and then use command dd
. It should work.
answered Jan 24 at 8:18
LiangmpLiangmp
11
11
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
add a comment |
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
1
1
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
This answer has been given six times already!
– G-Man
Jan 24 at 10:28
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f11369%2fdelete-line-in-vi%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
5
I suggest you read washington.edu/computing/unix/vi.html it gives you a basic usage overview. Here's a cheatsheet: tuxfiles.org/linuxhelp/vimcheat.html It's always a good idea to take a look at pages like that before asking trivial questions...
– polemon
Apr 15 '11 at 12:41
2
there's also S for deleting a line and entering insert
– Ben Creasy
Oct 24 '17 at 4:00