DEV Community

loading...

Discussion on: Vim won't make you a more productive developer

Collapse
tux0r profile image
tux0r

The one thing Vim does better than Atom and VS Code is performance. Even a GVim with a dozen of plug-ins feels snappy when compared to those.

But then again, so does every other non-JavaScript editor...

Collapse
chiefnoah profile image
Noah Pederson • Edited

I disagree, it depends heavily on your plugins. I've had my vim slow to a crawl (full seconds between key presses and actions) because an environment variable wasn't set.

That isn't to say Electron based editors are fast either, they aren't. But VS Code is 'good enough' and has an insane number of plugins.

Thread Thread
fenetikm profile image
Michael Welford

You can profile syntax highlighting by running :syntime on, moving around, then running :syntime report. Then fix it :)

Thread Thread
chiefnoah profile image
Noah Pederson

The issue was actually caused by vim-powerline and some locale variables being not set. Not really the syntax highlighting, but thanks for the info :)

Thread Thread
fenetikm profile image
Michael Welford

Great to hear. Personally I switched to lightline which is quite a bit leaner with respect to performance. I also removed git information from my statusline as I found that to sometimes cause a performance hit (although I didn't bother trying to fix it to update async).

Collapse
thermatix profile image
Martin Becker

Ehhhhh I would agree with this for most things save ruby.. specifically ERB files. I have super performance problems that I've never been able to solve, tried all kinds of stuff, but nothing I can think of works, Vim's fine with most things but Open an ERB file and vim begins to chug.

Thread Thread
bradenbest profile image
Braden Best

Have you tried vim -u NONE?

Thread Thread
Sloan, the sloth mascot
Comment deleted
thermatix profile image
Martin Becker

I was able to narrow it down with debugging, it only slows down in erb files, it's fine every where else. I believe it to be an issue with the regex for syntax highlighting.

Thread Thread
bradenbest profile image
Braden Best

If you think syntax highlighting is what's slowing it down, then you need to try to load one of the problematic files with vim -u NONE. That command tells vim not to load any config and thus vim launches in vi compatibility mode. If it it's still slow, then it's not the syntax highlighting and the problem is elsewhere. For example, vim doesn't take too kindly to files that are absurdly huge (>5MB) or have absurdly long lines (>10K columns). But the thing is, that in itself is way better than all the other text editors, which choke on files much smaller than the ones vim chokes on. You should isolate the problem before spreading something like this; you might be spreading misinformation.

Forem Open with the Forem app