If either were optimal in every case, this debate would be settled by now. Yet what matters here, more so than tiny idiosyncrasies in each, is the overarching philosophy each editor has, and whether that maps to your mode of thinking. I admit this is a dubious answer: our thinking can be restricted by choices we made early on and got used to, but never attempted to improve upon. If you do attempt to explore beyond what you have tried, by definition you run the chance of regretting lost time in the case where you find a better way of doing something. But this is a blessing in disguise anyways. I try not to let such fear (or even complacency, as the case may be) keep me from trying further things unless -- and this is a big, subjective caveat -- I feel as though I stand nothing to gain from pursuing it. The choice of text editor seems about on par with the choice of any other programming tool, such as a language or version control system. Not all of them are created equally, except in the technical sense (as in, e.g., Turing equivalence) that, at least in the limit, you can achieve the same things with one tool as another. Any may be more productive than another, but this is per person, situation, and preference. The only way to know for certain is to invest time (a precious resource) into learning all that you can.

I feel weird making such claims. For instance, I have very strong opinions over programming languages (though I do try to learn as many different modes of thinking -- in this context, languages -- as I can), yet with text editors I don't feel like I've been stuck with vim as an accident of history. I genuinely prefer its mode of thinking, despite not becoming an expert in Emacs before making a decision (since doing so is quite impractical). I also feel the flimsiness of the reply "depends; try both and see". To cut to the chase, luckily we have decades of flamewars to draw upon -- or, at least, the general consensus of the philosophy of either editor. Choose wisely:

Vim: modal editing; small, orthogonal commands that can be composed into more elaborate forms; "do one thing and do it well" philosophy, so the main function is as a text editor and there is less concern (except via plugins in its admittedly esoteric extension language) about performing other programmatic tasks not directly related to editing text.

Emacs: "Everything at reach" philosophy, be it text-editing or access to a REPL, browser, email client, Tetris, etc.; larger set of commands (it's like a CISC to vim's RISC); elisp is a much better extension language; no mode switching, which then requires more key-chording.

Whichever sounds nicer, you should probably go with, unless you have the time to dedicate to both -- even a little bit of working in either can help you get a feel for them. If you don't, they honestly accomplish so much of the same sort of tasks in their respective ways that neither is clearly better than the other (except to their proponents -- did I mention vim is better? ;) ). Which is encouraging, I think, because it buys you a degree of freedom to use their general philosophies as a grounds for a decision, rather than having to teach yourself every detail about each editor. You won't be at a terrible loss, whichever you choose.