3 ms·
This seems really useful. I'm not a heavy regex user, but 9 times out of 10 when I use one, it's to modify a bunch of lines in a file to prepend and append som
by tieTYT 13y ago
This seems really useful. I'm not a heavy regex user, but 9 times out of 10 when I use one, it's to modify a bunch of lines in a file to prepend and append something to each line. EG: I'll copy something from an external source like
1
2
3
...
100
I want to paste this into my source code, but of course that doesn't compile. I'll use a regex to change it to this:
list.add("1");
list.add("2");
list.add("3");
...
list.add("100");
I'm hoping this feature is convenient enough that I can stop using a regex search and replace.
- rschmitty 13y agoThat is exactly what sublime could do, in your case you would enter the following (in sublime) CTRL-A CTRL-L list.add(" END "); I havent checked out intellij's shortcuts to do this yet
- mdwrigh2 13y agoIn vim: :let @q="ilist.add(\"^[A\");" :%normal @q
- fragmede 13y ago1G (goto top) ctrl-v (enter visual mode) 0G (goto end) I (insert at beginning of line) list.add(" ESC ESC H $ ctrl-v L A (append) ") ESC ESC