Argyll
Argyll

Reputation: 9875

How to delete multiple lines by line number

Is there a way to delete all the lines between two particular line number via command pallete in Sublime Text 3?

I frequently run into the situation of having a large file and needing to delete a few thousand lines between two particular line numbers. It'd be nice to not have to wait for the render due to user scrolling and just let the CPU do the delete in the background.

Upvotes: 0

Views: 1890

Answers (1)

ToTamire
ToTamire

Reputation: 1703

There is a way to delete all lines between two particular line number.

  • Press CTRL + G. Text input will appear.
  • Go to last line you want to select by typing :line_number. For example :400000
  • Press ENTER to set cursor on this line
  • Edit > Mark > Set Mark. Circle near line number will appear.
  • Press CTRL + G. Text input will appear.
  • Go to last line you want to select by typing :line_number. For example :200000
  • Press ENTER to set cursor on this line
  • Edit > Mark > Select to Mark. Large selection will appear.
  • Press DELETE

Upvotes: 4

Related Questions