All Projects → joelstrouts → Swatch.vim

joelstrouts / Swatch.vim

work with hex color codes and make your own vim colorschemes easily and quickly

Projects that are alternatives of or similar to Swatch.vim

vim-lighthaus
A Lighthaus theme for (n)vim, vim-airline and lightline
Stars: ✭ 33 (-42.11%)
Mutual labels:  colorscheme, color-scheme, nvim
Darcula
A Vim color scheme reproduction of the official JetBrains IDE Darcula theme
Stars: ✭ 158 (+177.19%)
Mutual labels:  nvim, color-scheme, colorscheme
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: ✭ 37 (-35.09%)
Mutual labels:  colorscheme, color-picker, color-scheme
vscode.nvim
Neovim/Vim color scheme inspired by Dark+ and Light+ theme in Visual Studio Code
Stars: ✭ 362 (+535.09%)
Mutual labels:  colorscheme, color-scheme, nvim
aquarium-vim
🌊 Aquarium, a simple vibrant dark theme for vim 🗒
Stars: ✭ 151 (+164.91%)
Mutual labels:  colorscheme, color-scheme, nvim
Vim Colors Github
A Vim colorscheme based on Github's syntax highlighting as of 2018.
Stars: ✭ 286 (+401.75%)
Mutual labels:  nvim, colorscheme
Spacecamp
🔭 Vim colors for the final frontier
Stars: ✭ 288 (+405.26%)
Mutual labels:  color-scheme, colorscheme
Nord Jetbrains
An arctic, north-bluish clean and elegant JetBrains IDE UI and editor color theme.
Stars: ✭ 293 (+414.04%)
Mutual labels:  color-scheme, colorscheme
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (+468.42%)
Mutual labels:  nvim, colorscheme
nord-mintty
An arctic, north-bluish clean and elegant Mintty color theme.
Stars: ✭ 40 (-29.82%)
Mutual labels:  colorscheme, color-scheme
Spaceduck
🚀 🦆 An intergalactic space theme for Vim, Terminal, and more!
Stars: ✭ 177 (+210.53%)
Mutual labels:  nvim, color-scheme
Nord
An arctic, north-bluish color palette.
Stars: ✭ 4,816 (+8349.12%)
Mutual labels:  color-scheme, colorscheme
Vim Monokai Tasty
VIM Colour scheme
Stars: ✭ 279 (+389.47%)
Mutual labels:  color-scheme, colorscheme
Nord Gnome Terminal
An arctic, north-bluish clean and elegant GNOME Terminal color theme.
Stars: ✭ 258 (+352.63%)
Mutual labels:  color-scheme, colorscheme
Nofrils
An extremely minimalist colorscheme, even opting out of the second L in frills
Stars: ✭ 292 (+412.28%)
Mutual labels:  color-scheme, colorscheme
disco.vim
A full set of 2-, 8-, 16-, 88-, 256-, and GUI-color-compatible Vim colors.
Stars: ✭ 53 (-7.02%)
Mutual labels:  colorscheme, color-scheme
Kicad Color Schemes
Want to change the color scheme of KiCad? Look here for Inspiration.
Stars: ✭ 315 (+452.63%)
Mutual labels:  color-scheme, colorscheme
Nord Visual Studio Code
An arctic, north-bluish clean and elegant Visual Studio Code theme.
Stars: ✭ 749 (+1214.04%)
Mutual labels:  color-scheme, colorscheme
Nord Iterm2
An arctic, north-bluish clean and elegant iTerm2 color scheme.
Stars: ✭ 651 (+1042.11%)
Mutual labels:  color-scheme, colorscheme
Briofita vim
colorful Vim colorscheme for both GUI and 256-color terminals
Stars: ✭ 9 (-84.21%)
Mutual labels:  color-scheme, colorscheme

Swatch.vim

The easiest way to make your own custom colorschemes. There are other color pickers available for nvim/vim, swatch.vim is different because:

  • specifically designed to make the development of personal colorschemes as easy and intuitive as possible
  • works in an un-fancy, low-tech, idiomatic-vim way (easy to understand and use, no dependencies, just a good interface for manipulating vim's own highlighting groups)
  • limited scope allows the plugin to be small

adjust color schemes

Requirements:

  • nvim instance capable of displaying true color.
  • an nvim interface that correctly interprets meta key chords (ie. allows mappings like :nnoremap <M-A> :echo 'hi'<CR>)

Setup

Swatch runs automatically on startup, but to ensure that alterations are re-applied when your config files are sourced during usage, add if exists('*Swatch_load') | call Swatch_load() | endif to your vimrc after specifying a colorscheme.

ie.

colo gruvbox
if exists('*Swatch_load') | call Swatch_load() | endif

Default Mappings:

" New adjustment: identify hl group under cursor and take you to new
" buffer where its attributes can be adjusted
nnoremap <leader>ss :call Swatch_new_adjustment()

" Preview this: highlight the current word (color name or hex code) with
" the color it represents
nnoremap <leader>pt :call Swatch_preview_this()

How to interact with color under the cursor:

meta chord

This image shows the key chord that you would press to increase the first channel.

The top row of keys corresponds to an increase in a channel, the bottom row corresponds to a decrease.

The columns correspond to the three channels, first red, then green then blue.

So meta-w increases red, meta-f decreases blue.

I find it fairly intuitive to use.

If you want, you can remap these keys like so:

call Swatch_set_shortcuts([
        \['e','d'],
        \['r','f'],
        \['t','g']
        \])

the first pair map <M-E> to increase channel 1 (red), and <M-D> to decrease channel 1. The secound pair maps <M-R> to increase channel 2 (green), and ... etc. So the result in this case looks mostly the same as the diagram above but the keys have all moved right by one column.

Variables

These are the variables exposed to the user, and their default values:

let g:swatch_step = 5             
let g:swatch_dir = expand('~/.config/nvim/swatch/')
let g:swatch_preview_region = 'word'        
let g:swatch_preview_style = 'bg'
let g:swatch_enable_on_startup = v:true          

You can change the step that each channel increases/decreases by with the g:swatch_step variable, the preview region with g:swatch_preview_region (accepted values are: word, WORD, para, screen), and the preview attributes with g:swatch_preview_style (either fg, bg, or both).

By default the plugin works off of whichever colorscheme you are already using as a base, and on startup applies the changes relative to that base automatically. If you would like to disable the automatic loading of alterations, and instead only have them applied when the Swatch_load() function is called, then toggle the startup variable to equal v:false.

Usage

For altering/making colorschemes

calling the new adjustment function opens a file containing adjustments to the currently active colorscheme, in the directory specified by g:swatch_dir. By default this path is: ~/.config/nvim/plugins/swatch/.

You can change the location of the swatch directory by putting :let g:swatch_dir = 'path/to/your/desired/location/ (trailing forward slash obligatory)

to load alterations to a colorscheme on startup add the line :call Swatch_load('$name_of_colorscheme') either instead of, or after calling :colo $name_of_colorscheme.

Todos

  • implement second mode where the channels correspond to hue/saturation/value
  • add interface for designing palettes of swatches, which the user can then link existing highlight groups to freely. (currently only possible to link between existing groups or manually defined ones)
  • fix previewing of named colors with upper case letters in the middle of the word
  • write help file
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].