My goto solution for this kind of task is to open up a jupyter notebook and solve if from there with Python. And yes, repeatability in his solutin is lacking. 3 weeks later with an updated zip file he will have to do it all again.
Clever but there are better solutions.
Are there though? It's a one off specific task. It took 10 minutes to do a bunch of the work whilst making a video/explaining. Writing python for this would feel so uninteractive and clunky. And how would you do the manual part of getting the pdf names? I think you're placing way too much value on repeatability for a specific task. I feel like he'd be done with his task whilst you're still writing your API. Then next week a different professor would ask for a different task and your python script wouldn't work.
Not if you are in a notebook. Have you tried?
Opening a zip file and retrieving a listing of the file names is also not very difficult in python, what is manual in that?
Apart from the repeatability, a notebook allows you to start from where you failed. With the vim solution, if you do one mistake, I believe you'd have to start over from scratch.
Also if the next professor comes, what I'd do is to make a copy of the notebook and modify it just slightly to make it work for the new use-case.
A notebook is not like starting your IDE, setting up a project and writing some .py files. It is more like reaching for your pocket calculator to do some quick maths.
Execution of a vim macro is atomic and can be undone with 'undo' AND you can edit a vim macro. So the Jupyter notebook solution might be a overkill for what should be a native editor solution.
True, writing a program for this task is bringing a bazooka to knife fight, but a bazooka is such a terrifying weapon that will make you king of the hood so fast that you will never have to waste time fighting with knives.
>>Clever but there are better solutions.
I doubt it.
Because that's not what Macros really are. In a programming language when you want to do X, you go about using programming features such as if-then-else statements and a for loop to achieve it, if things get complicated you use namespace features.
In a Macro you tell the editor to watch what you are doing and repeat it N times. This significantly simplifies your task while you are doing non-trivial manipulation over several buffers/tabs. And in many way this is more easy to do with a tool that supports macros than with a regular programming language.
I guess it is fine. just I work regularly with Python so it is more easy for me to remember. For me personally it would be an overhead to learn vim commands. And also the notebooks are more visual for me. I don't need to remember what the last command was, if i am interrupted.
But a script is a totally reasonable approach, and what's important is what works best in your workflow, just pointing out options for the sake of interest.