Flux
Flux

Reputation: 10920

Vim how to set directory used for colorschemes

By default, Vim looks for colorschemes in the <runtimepath>/colors/ directory.

Is there a way to specify a different directory name, or to specify an additional directory that vim can in look for colorschemes?

The purpose of wanting additional directories is for organizing colorschemes from third-party sources.

Upvotes: 3

Views: 3708

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172530

'runtimepath' actually is a comma-separated list of directories. Each of those can contain the common structure of plugin, autoload, colors, etc. Vim is considering all of those trees for its configuration.

So, to separate third-party colorschemes, you can put them in ~/.vimstyles/colors/ instead of ~/.vim/colors, and augment the runtimepath in your ~/.vimrc:

:set runtimepath+=~/.vimstyles

Package management

If your requirement actually is having a separate directory structure for each colorscheme (or more general: plugin), Vim 8 provides a built-in way for that: :help packages. These are directores below ~/.vim/pack/ that are automatically added to the runtimepath. pathogen.vim has been offering something similar also for older Vim versions.

Plugin managers build on top of that and enable features like automatic updating from various sources, dependency management, and so on.

Upvotes: 4

Related Questions