and if I were to select the whole buffer with
%then<a-k>and finally typenotesand<ret>it’s supposed to discardthe lineeverything that doesn’t matchnotes, correct?
<a-k> keeps selections. If you select whole buffer, you have single selection. If you press <a-k> and type anything that is inside this selection it will be kept. If you have several selections, you discard selections that doesn’t have the regex, and keep those who match.
For example:
string buffer_name;
int buffer_index;
string window_name;
int window_index;
You want to make all strings near each other, and all ints near other ints.
% - select whole buffer:
[string buffer_name;
int buffer_index;
string window_name;
int window_index;]
Alt+s -split selections by lines:
[string buffer_name;]
[int buffer_index;]
[string window_name;]
[int window_index;]
Alt+k string - keep selections matching pattern:
[string buffer_name;]
int buffer_index;
[string window_name;]
int window_index;
d - cut selections
int buffer_index;
int window_index;
Now you can move to another place, and paste them with P, or Alt+P in case you merged cursors:
int buffer_index;
int window_index;
string buffer_name;
string window_name;