kyoheiu / felix

tui file manager with vim-like key mapping
https://kyoheiu.dev/felix/
MIT License
708 stars 24 forks source link

Add registers #204

Closed dyerti closed 1 year ago

dyerti commented 1 year ago

Is there any interest for support registers? I'd be open to contributing if there is interest.

My use case would be disjoint file manipulation and it seems like it would be a natural extension of the existing support.

Existing yank and put would modify the "" register. Named registers ("a) could be used to collect file selections when coupled with register appending ("A).

:reg a, " - list the contents of register a and the default register
"ay (select mode) - yank selected files into register a
"ad (select mode) - delete selected files and yank into register a
"Ay (select mode) - yank selected files and append into register a
"Ad (select mode) - delete selected files, yank and append into register a
"ayy - yank selected file into register a
"add - delete and yank select file into register a
"Ayy - yank selected file and append into register a
"Ayy - delete selected file, yank and append into register a
"ap - put contents of register a into current directory
kyoheiu commented 1 year ago

Sorry for being late. That'd be interesting and useful!

What we have to think would be:

dyerti commented 1 year ago

I was thinking numbered and named, so using something like BTreeMap<String, Vec<ItemInfo>>.

I could start with numbered for the PoC and still use BTreeMap<String, Vec<ItemInfo>>. It would make the changes needed in event loop smaller.

kyoheiu commented 1 year ago

Yeah, that's good if named is planned. (vec_deque would be enough if numbered only though)

I'm ready to implement it, but what's your thought? Can I assign myself to this?

dyerti commented 1 year ago

Sounds good. Go for it!

kyoheiu commented 1 year ago

Implemented by #215. It needed much refactoring but it feels now way, way better than before! Thank you. If you're interested, please build from feature-reg branch and tinker with it. After debugging I'll release new version.

kyoheiu commented 1 year ago

Merged & released as v2.4.0.