nordtheme / vim

An arctic, north-bluish clean and elegant Vim theme.
https://www.nordtheme.com/ports/vim
MIT License
2.51k stars 275 forks source link

Don't load plugin-related things when the relevant plugin isn't installed #294

Closed jvoisin closed 2 years ago

jvoisin commented 2 years ago

Function calls are expensive in vim-script. This commit speeds up the processing of colors/nord.vim in neovim 0.6.1 by almost 50% on my machine, where none of the supported plugins are installed.

Some plugins provide no easy/straightforward way to be detected, so not all blocks are behind conditions, but it's still a significant improvement, and can always be improved in the future.

svengreb commented 2 years ago

Hi @jvoisin :wave:, thanks for your contribution :+1: I'm currently busy with the preparations for the roadmap and future plan of the whole Nord project, but I'll try to review the changes within the next week(s).

alappe commented 2 years ago

I get

Error detected while processing …/nord-vim/colors/nord.vim:
line  729:
E117: Unknown function: exist
line  862:
E117: Unknown function: exist

in NVIM v0.7.0-dev+1436-gf0d07dcb7.

jvoisin commented 2 years ago

301 should fix it, sorry about breaking things :/

alappe commented 2 years ago

No problem, thanks for fixing it :)

svengreb commented 2 years ago

@alappe Thanks for the report, this has been fixed in #297. Also see my comment in the PR about what can be learned from this.