Skip to content

yukimemi/spectrism.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spectrism.vim

Vim / Neovim random colorscheme plugin.

spectrism is spectrum and prism.

Features

This plugin change the colorscheme for Vim / Neovim.

Installation

If you use folke/lazy.nvim.

{
  "yukimemi/spectrism.vim",
  lazy = false,
  dependencies = {
    "vim-denops/denops.vim",
  },
}

If you use yukimemi/dvpm.

dvpm.add({ url: "yukimemi/spectrism.vim" });

Requirements

Usage

No special settings are required. By default it changes the colorscheme every 3,600 seconds.

Commands

:ChangeColorscheme

Change the colorscheme.

:OpenColorschemeSetting

Open the spectrism priority setting. colorschme setting is a toml file. Colorschemes with higher numerical priorities are preferred.

:ResetColorschemeSetting

Remove the spectrism setting file. The configuration file will be automatically regenerated the next time you start Vim / Neovim.

:DisableSpectrism

Disable spectrism. Stop changing colorschme.

:EnableSpectrism

Enable spectrism.

:DisableThisColorscheme

Disable this colorscheme. (Set colorschmeme priority to 0.)

:LikeThisColorscheme [size]

Increase priority by g:spectrism_changesize. (default) If size is passed, increase priority according to size.

:HateThisColorscheme [size]

Decrease priority by g:spectrism_changesize. (default) If size is passed, decrease priority according to size.

Config

No settings are required. However, the following settings can be made if necessary.

g:spectrism_debug

Enable debug messages. default is v:false

g:spectrism_echo

Whether to echo the modified colorscheme. default is v:true

g:spectrism_notify

Whether to vim.notify the modified colorscheme. (Neovim only) default is v:false

g:spectrism_interval

Interval to change colorscheme. default is 3600 (seconds)

g:spectrism_retry

Whether to retry change colorscheme when after changed colorschme is same before. default is v:true

g:spectrism_checkwait

Time to wait before checking g:colors_name after changing colorschme. g:colors_name may not be included immediately after changing colorschme. default is 3000 (milliseconds)

g:spectrism_enables

A list of colorschemes to be used for selection. If this list is set, only the changing colorschme that includes this list will be used. Not included colorscheme's priority are all set to 0. default is [] (Use all colorscheme)

g:spectrism_disables

A list of colorschemes to be not used for selection. If this list is set, only the changing colorschme that not includes this list will be used. Included colorscheme's priority are all set to 0. default is [] (Use all colorscheme)

g:spectrism_match

A match pattern to be used for selection. (regexp) If this pattern is set, only the changing colorschme that match this pattern will be used. default is "" (Use all colorscheme)

g:spectrism_notmatch

A match pattern to be not used for selection. (regexp) If this pattern is set, only the changing colorschme that not match this pattern will be used. default is "" (Use all colorscheme)

g:spectrism_events

A list of events to be used for selection. If this list is set, the colorscheme will be changed if the target event fires. default is []

g:spectrism_background

"dark" or "light" If this option is set, the background option set after the colorscheme change is set default is ""

g:spectrism_changesize

Priority size changed during LikeThisColorscheme and HatesThisColorscheme. default is 50

g:spectrism_path

The path to the colorscheme config file. default is $XDG_CONFIG_HOME/spectrism/colorschemes.toml

g:spectrism_colors_path

colorschme looks from runtimepath and, for Neovim, from stdpath("data"). If it is delayed by plugin manager etc., it may not be included in the runtimepath at the time of startup. If you still want to use spectrism, add it manually to g:spectrism_colors_path as a search path. This path will be searched recursively, and colors/*.vim or colors/*.lua files will be registered as colorscheme. default is []

g:spectrism_priority

The priority of the colorscheme. (readonly) You can use this value for statusline.

Example

let g:spectrism_debug = v:false
let g:spectrism_echo = v:false
let g:spectrism_notify = v:true
let g:spectrism_interval = 60
let g:spectrism_enables = ["morning", "ron"]
let g:spectrism_disables = ["evening", "default"]
let g:spectrism_match = "base16"
let g:spectrism_notmatch = "light"
let g:spectrism_events = ["CursorHold", "FocusLost", "BufWritePost"]
let g:spectrism_background = "dark"
let g:spectrism_path = expand("~/.cache/colors.toml")
let g:spectrism_colors_path = [expand("~/.cache/vim/plugs")]

" Useful mappings
nnoremap <space>rc <cmd>ChangeColorscheme<cr>
nnoremap <space>rd <cmd>DisableThisColorscheme<cr>
nnoremap <space>rl <cmd>LikeThisColorscheme<cr>
nnoremap <space>rh <cmd>HateThisColorscheme<cr>

License

Licensed under MIT License.

Copyright (c) 2023 yukimemi

About

Vim / Neovim random colorscheme plugin

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published