enki icon indicating copy to clipboard operation
enki copied to clipboard

Typing in "rectangular select" mode should type/replace in all rows

Open vi opened this issue 12 years ago • 9 comments

I have vertically aligned code and want to replace something in it.

Current example:

    en <- DBP.getWord32be
    sn <- DBP.getWord32be
    ts <- DBP.getWord64be
    rs <- DBP.getWord32be
    rt <- DBP.getWord64be 
    fi <- DBP.getRemainingLazyByteString 

And I want to make it DBG instead of DBP.

I try rectangular selection (column of "P" letters) and press "G". The letter appears inserted (in old Enki - replaced) in the last row. I want Enki to update all rows in this case.

Then I thought "I can use regex s/// for this", but remembered that unfortunately Enki can't do ranged s/// like Vim...

What's the best way to use current Enki to edit the code in this way? Without O(n) manual actions, of course.

P.S. When I was entering the title of this issue Firefox hinted me Typing in "rectangular select" mode should type in all rows, and I vaguely remember filing similar issue. Yet I can't find the issue neither here nor with Google Search...

vi avatar Sep 14 '13 16:09 vi

vi, have you seen https://github.com/hlamer/qutepart/issues/2?

andreikop avatar Sep 16 '13 11:09 andreikop

vi, check https://github.com/hlamer/enki/wiki/User-manual#rectangular-indentation. This is not true rectangular edit, but I hope this feature will be useful for you

andreikop avatar Nov 22 '13 08:11 andreikop

I already use this feature often.

But sometimes I want to edit tabular, aligned data or some ASCII-art diagram. In this case replace mode and "rectangular" features come in use.

vi avatar Nov 22 '13 10:11 vi

Do you indent by 1 indentation level with Space and Backspace? I coded this feature just today.

andreikop avatar Nov 22 '13 10:11 andreikop

No, in that case I usually manually typed/removed space character on each line (or used rectangular select feature).

BTW does it conflict with just deleting the selected content (with backspace)?

vi avatar Nov 22 '13 10:11 vi

Yes, it does conflict, if more than one line is selected. Del still works

andreikop avatar Nov 22 '13 12:11 andreikop

I found that Backspace is often used to delete lines, so, remapped rectangular indentation to Shift+Space and Shift+Backspace

andreikop avatar Dec 02 '13 06:12 andreikop

I would very much like to see this realized... ATM, my choices are notepadqq (with graphical glitches), or enki (without multi-line editing)... or perhaps diving headlong into neovim :-/

Perhaps someone could point out where, approximately, in the code the change would be needed? I imagine that it should be somewhat simple (applying to N insertion points rather than 1)... like a for-loop.

Osndok avatar Nov 13 '18 21:11 Osndok

Unfortunately, Enki seems to be [semi-]abandonware currently. It may be not a good choice regardless of "long cursor" typing support.

Checked again: there seems to be some activity, even a release. Maybe the hope is not lost?

vi avatar Nov 13 '18 21:11 vi