ardagnir / athame

Full vim for your shell (bash, zsh, gdb, python, etc)
GNU General Public License v3.0
1.62k stars 32 forks source link

Multiline editing #50

Open ardagnir opened 6 years ago

ardagnir commented 6 years ago

Right now, multiline commands are effectively broken into separate lines by Athame. This is baked pretty deeply into how Athame works, but it would be nice to change because Vim would be especially useful for editing multiline commands.

henrebotha commented 6 years ago

Oof, yeah, this is just about a dealbreaker for me at the moment. I need to do work with big curl commands, which are just far more palatable in multiline format.

Can you state in a sentence or two what would need to change to support this @ardagnir?

ardagnir commented 6 years ago

I’ve actually been working on this a little bit since the last release. It mostly involves trying to get some way to have vim track which lines go together, and I currently have something partially, but not really, working using folds that I might push out in an experimental branch soon if I can get it working better.

wahrwolf commented 6 years ago

how about we use folds for that? vim is pretty good in keeping track of them...

--[edited for some details]-- So my idea was to add a fold marker with a comment (e.g.#{{{1) to the end of all lines in the file. Combined with a footer foldmethod=marker (or set in the options) you would maintain the default behavior of cycling through the lines. However since each comment is now hidden in a fold, you can open and edit the fold easy. To get the text out of the fold you could either use the folddoopen fommand or the textarea between a [z and a ]z

DISCLAIMER: I have actually not read much of the current athame or vimbed code, so I have no idea "how easy" this actually is...

resolritter commented 3 years ago

@ardagnir do you still have the experimental branch? I'm interested in seeing how it went, even if it's unfinished

ardagnir commented 3 years ago

No, I was dumb and never uploaded it. :( Now the only copy is in storage >2000 miles from me and I won't be able to get it any time soon because of covid