Is there a way to do a block indent by 1 character at a time?

(mtiede) #1

In Visual Studio I can do Ctrl-Alt-DownArrow to mark an insertion block and then hit tab or space bar to move the block. You can also type characters and they get put on all the lines. It looks like Water only allows the “mark block” and then tab to move it operation.

Are there other options?

(marc hoffman) #2

currently you can only indent in increments of the indent size (ie 2 chars, for Oxygene). Sorry.

(mtiede) #3

Bummer. I use that a pretty lot. I may have to keep VS open, edit things over there and then paste them in.

Or maybe just not use Water at all. Bummer. I was liking what I was seeing in Water.

(marc hoffman) #4

I’ll see what I can do. What’s the shortcut in VS to indent/unindent by a single char?

(mtiede) #5

In my first post. Ctrl-Alt-DownArrow marks a “block insertion point” or whatever they may call that. Then you can just hit the space bar to insert a space (or whatever you type) in the insertion point on all lines marked.

I can look into VS and find the exact terminology if that is helpful.

I’ve done it for so long I don’t even remember if it is described somewhere inside VS. I’m poking around to see what I find.

… time passes …

And along with that (hope I’m not getting too greedy), when you have the block insertion points marked, you can also PASTE some text and it gets copied to all the insertion points. Really useful when creating some sort of data initialization, for instance, and you want the same thing at the beginning (or anywhere else) on every line of bunch.

… time passes …

I do the keystrokes so automatically I didn’t even remember what the keys were. I went into VS and did it and then noted what keystrokes I was doing. It is actually Shift-Alt-DownArrow (or UpArrow) to mark the insertion points. When you do that, a vertical line character appears on every line where at the point the insertion is to take place.

Still hunting for some official documentation for it. Don’t remember how I might have stumbled onto it. The same things work in Sql Server Management Studio editor for instance. So I think it is a common Microsoft thing.

I just found a place that pointed out that you can also hold down the Alt and use the mouse to drag over an area to do the block operations. I’m a keyboard kind of guy and find it quicker, easier, and more precise to use the keyboard to do those operations.

… time passes …

The only place I could find documentation was for sql server. I may very likely have found it there and then realized that it works just about everywhere in the Microsoft stuff, Word, SSMS, and Visual Studio, that I know of.

It is marking a block operation. So it could be an insert, or a paste point, or a deletion. If you mark a block of letters across a block of lines, you can press Delete to delete the selected letters.

For Sql Server, I found this:

under “Text Selection Keyboard Shortcuts”.

(marc hoffman) #6

Ah, so its not so much a more granular indent, but multi-curtsor editing with a rectangular selection? you can type whatever else you wan t in addition to space? I’ll need to check what VS does there exactly, but that’ll be a “far out” feature for when I really bored sometime next year ;).

(mtiede) #7

lol. yes, I understand. Of course, I just bragged to a former co-worker about how responsive you are :slight_smile:

That is still true, but as I was looking for how it works I too realized it was more complicated.

(marc hoffman) #8

multi-edit is something I’ll wanna do, but it’ll be a tremendous bit of work. :wink:

(mtiede) #9

I KNOW it is a lot of work. When I use it I think, “How the heck would I code that because it isn’t easy what they are doing.” And there are some funny edge cases like, “What if I have 5 lines ready for insertion and I paste 6 lines of words? What should happen?” I’m not sure Microsoft does the most logical thing there either.