Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SublimeText 2: Select lines that match search terms

I need to select some lines inside of a list of file names to bring them at the end of the list.

Suppose I have Files.txt with this list:

filename1.aaa
filename1.bbb
filename1.ccc
filename2.aaa
filename2.bbb
filename2.ccc
filename3.aaa
filename3.bbb
filename3.ccc

I want to select all the lines where the file extension is ccc and then be able to CTRL-X and CTRL-V to put them on the bottom of the list. So the result have to be like this:

filename1.aaa
filename1.bbb
filename2.aaa
filename2.bbb
filename3.aaa
filename3.bbb
filename1.ccc
filename2.ccc
filename3.ccc

Is it possible?

like image 606
Cheshire Cat Avatar asked Sep 13 '13 10:09

Cheshire Cat


People also ask

How do you select multiple lines in Sublime Text?

To select multiple regions using the keyboard, select a block of text, then press Ctrl+Shift+L to split it into one selection per line.

How do I search a line in Sublime Text?

In Sublime Text, you can quickly jump to any line in the code. Hit Ctrl–G (Mac and Windows). Type in a line number and hit Return/Enter to go to that line.

How do I get multiple cursors in Sublime Text?

While you can place multiple text cursors in Sublime Text with Cmd–Click (Mac) or Ctrl–Click (Windows), here's another technique that comes in handy. Hold Ctrl–Shift (Mac) or Ctrl–Alt (Windows) and hit Up or Down Arrow to place an additional text cursor above or below the current cursor.

What is Ctrl D in sublime?

Ctrl + D in SublimeText is "Quick Add Next." This appears to be equivalent to Ctrl + B in Brackets, which is "Add next match to Selection" on the Find menu.


1 Answers

In Windows press:

  1. Ctrl+F for searching all ".ccc" terms in file;
  2. Ctrl+L to expand selection to line;
  3. Ctrl+X to cut all selected lines;
  4. End to go at the end of your file;
  5. Ctrl+V to past all selected line;

If you are using a Mac press Command instead of Ctrl.

This page could also help you: http://www.sublimetext.com/docs/selection

like image 87
itwebdeveloper Avatar answered Oct 22 '22 23:10

itwebdeveloper