andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

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

Open vi opened 11 years ago

vi commented 11 years ago

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...

andreikop commented 11 years ago

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

andreikop commented 10 years ago

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

vi commented 10 years ago

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.

andreikop commented 10 years ago

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

vi commented 10 years ago

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)?

andreikop commented 10 years ago

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

andreikop commented 10 years ago

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

Osndok commented 5 years ago

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.

vi commented 5 years ago

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?