Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim how to set directory used for colorschemes

Tags:

vim

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.

like image 319
Flux Avatar asked Dec 19 '25 11:12

Flux


1 Answers

'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.

like image 188
Ingo Karkat Avatar answered Dec 21 '25 08:12

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!