what is the point of investing so much time learning all of this when there are some IDEs that are preconfigured with all the functionality a programmer would need ?
Editors are a thing you use a lot. They are probably one of the most used tools you will ever use as a programmer. If anything deserve some time investment to learn it is the editor you use. Doing so will pay dividends in the long term. Even one that is preconfigured requires time to learn all those features and how to use them effectively. Time spent configuring is just time spent exploring the features the editor has to offer. Vim and Emacs force you to do this to become on par with other editors, but just because another editor has the tools built in does not mean you don't still need to spend the time to learn those tools.
Does learning neovim or emacs actually save time in the long run?
Lots of people think so. I personally hate using normal editors these days, modal editors like vim are just far nicer to use and lets me jump around and edit code far faster than normal editors. I cannot comment on emacs though.
I know that they’re much more lightweight than IDEs and I’ve been really enjoying using the terminal much more than my time on IntelliJ, but having an easy out of the box visual debugger, refactoring and jump into functions can be really helpful in the long run I think
You can get all these things in terminal editors. Especially with the LSP (language server protocol) vim and similar editors can support all of the language servers that were created for vscode giving you the same refactoring tools as available in vscode. It is mostly a question of finding the right plug-ins that you require.
Why did you chose your editor?
I learnt vim in uni - cannot remember why exactly any more. But ever since I properly learnt it I have not been able to move back to normal editors anymore. They just feel far more clunky than modal ones. Yes you can get the vim input mode on vscode and other editors - but they are always lacking compaire to the real thing.
Recently though I have switch to helix which is a modal terminal editor inspired by neovim and kakoune - takes the keybinding from kakoune but integrates LSP and treesitter in addition to a lot of the common plugins that you have in vim. I love that it requires basically no configuration to give you what is more of a fully functional IDE but still has all the power of a modal editor. It lacks a plugin architecture though (this is still a work in progress feature) but since it bakes in a lot of what you typically go to plugins for I have never felt it lacking by missing this feature.