Skip to main content
replaced http://vi.stackexchange.com/ with https://vi.stackexchange.com/
Source Link

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainlromainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

For example, if you use absolute line numbers, you can replace the /I want Enter with something like 78gg or 78G to jump directly at that line number.

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

For example, if you use absolute line numbers, you can replace the /I want Enter with something like 78gg or 78G to jump directly at that line number.

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

For example, if you use absolute line numbers, you can replace the /I want Enter with something like 78gg or 78G to jump directly at that line number.

added 162 characters in body
Source Link
VanLaser
  • 9.9k
  • 2
  • 26
  • 37

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

For example, if you use absolute line numbers, you can replace the /I want Enter with something like 78gg or 78G to jump directly at that line number.

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.

For example, if you use absolute line numbers, you can replace the /I want Enter with something like 78gg or 78G to jump directly at that line number.

Source Link
VanLaser
  • 9.9k
  • 2
  • 26
  • 37

Perhaps you'll improve your workflow if don't fear to ... jump :)

Example:

This is where cursor initially is: _.

[Some other stuff you want to keep/skip ...]

I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.
I want to delete these lines.

Your actions (normal mode, cursor is on _): /I want Enter 5dd Ctrl-o. That's it.

Of course, romainl answer is the best if all you want to delete whole lines, and you can count their offset easily (using relative linenumbers for example). The above is a more generic way to "act": go there, using something that counts as a jump: this means you can always jump back, after you modify the text.