MacOS block select / replace text?

TeeJayHoward

Limpness Supreme
Joined
Feb 8, 2005
Messages
11,698
So in MacOS, you can block-select text by holding down option (alt) and selecting the lines you want. Cool. Works well. But I'm a little spoiled by Notepad++ which allows you to replace the text you just selected just by typing. Is there a way to enter the same text on multiple lines in MacOS?
 

Brian_B

2[H]4U
Joined
Mar 23, 2012
Messages
3,356
Not sure I understand- if you have selected text and type it will replace.

Enter the same text on multiple lines... not sure about that. Sure sounds an awful lot like CMD-C, CMD-V
 

TeeJayHoward

Limpness Supreme
Joined
Feb 8, 2005
Messages
11,698
So, as an example:

AAA1AAA
BBB1BBB
CCC1CCC

Select just the "1" column by holding down Alt+drawing a box around the 1s.

In Notepad++, you can type "2" after selecting the "1"s and it will end up looking like this:

AAA2AAA
BBB2BBB
CCC2CCC

However, in TextEdit (and I imagine other MacOS programs), it looks like this:
AAA2AAA
BBB1BBB
CCC1CCC
 

Brian_B

2[H]4U
Joined
Mar 23, 2012
Messages
3,356
Oh a vertical select - that I don’t know - it’s not OS level but doesn’t mean a program couldn’t have implemented something like it.

If you were to hold Alt and arrow down and select all the 1’s, after you type you would normally have:

AAA2222
2222222
2222CCC

Check out TextWrangler / BBEdit- not sure if they do that specific item but they are pretty robust text editors on OS X
 

Algrim

[H]ard|Gawd
Joined
Jun 1, 2016
Messages
1,760
Oh a vertical select - that I don’t know - it’s not OS level but doesn’t mean a program couldn’t have implemented something like it.

If you were to hold Alt and arrow down and select all the 1’s, after you type you would normally have:

AAA2222
2222222
2222CCC

Check out TextWrangler / BBEdit- not sure if they do that specific item but they are pretty robust text editors on OS X

Late reply but this does indeed work in TextWrangler. Bare Bones Software no longer supports TextWrangler nor, as far as I can tell, allow you to download it from their site. However, BBEdit in lite mode (what BBEdit becomes after 30 days if you don't pay) is supposed to be functionally equivalent.
 

defaultluser

[H]F Junkie
Joined
Jan 14, 2006
Messages
14,399
What you want is Column Edit mode.

It's supported by most major text editors. You'll just have to switch modes using a hotkey combo.

For Ultraedit, it's Alt-C.
 
Top