A Vim plugin for seamless colorscheme management with FZF integration and Pywal support. themer.vim provides an intuitive interface for selecting, applying, and managing colorschemes, including support for Pywal-generated themes with automatic updates.
- π¨ FZF-powered colorscheme selector with real-time preview
- π Automatic Pywal theme updates with periodic checking (Pywal mode)
- π Mode persistence across sessions (Pywal or manual mode)
- πΎ Theme persistence and saving across sessions
- β‘ Quick theme switching with customizable keybindings
- π Background toggle for light/dark modes with traditional themes
- π Support for multiple colorscheme directories
- Vim 8.0+ with Python support and
+timerfeature - FZF (for colorscheme selection)
- Pywal (optional, for Pywal integration)
Using vim-plug:
Plug 'junegunn/fzf' " Required dependency
Plug 'kyleorman/vim-themer'Add these settings to your vimrc to customize themer.vim's behavior:
" Default settings shown below
let g:vim_themer_dirs = ['~/.vim/pack/colors/start'] " Colorscheme directories
let g:vim_themer_mode = "manual" " Options: 'manual', 'pywal'
let g:vim_themer_background = "auto" " Options: 'light', 'dark', 'auto'
let g:vim_themer_silent = 0 " Options: 0 (verbose), 1 (silent)
let g:vim_themer_preview = 1 " Options: 0 (centered), 1 (preview)
let g:vim_themer_disable_keybindings = 0 " Options: 0 (enable), 1 (disable)
" Optional: Customize keybindings
let g:vim_themer_keymap_theme_select = '<leader>tt' " Fuzzy find themes
let g:vim_themer_keymap_pywal = '<leader>tp' " Toggle Pywal mode
let g:vim_themer_keymap_save_theme = '<leader>ts' " Save current theme
let g:vim_themer_keymap_toggle_background = '<leader>tb' " Toggle light/dark background
let g:vim_themer_keymap_toggle_mode = '<leader>tm' " Toggle between Pywal and manual modes
let g:vim_themer_keymap_toggle_preview = '<leader>tv' " Toggle preview mode in theme selectorthemer.vim provides the following commands:
| Command | Description | Default Keybinding |
|---|---|---|
:ThemeSelect |
Open FZF theme selector | <leader>tt |
:PywalTheme |
Apply Pywal colorscheme manually | <leader>tp |
:SaveTheme |
Save current theme as default | <leader>ts |
:ToggleBackground |
Toggle light/dark background modes | <leader>tb |
:ThemeToggleMode |
Toggle between Pywal and manual modes | <leader>tm |
:ThemeTogglePreview |
Toggle preview mode in theme selector | <leader>tv |
themer.vim supports two modes of operation:
- Manual Mode: Allows you to select and save themes manually.
- Pywal Mode: Automatically applies the current Pywal theme, updating whenever Pywal's
colors.jsonchanges.
The plugin remembers your last selected mode across Vim sessions.
- Use
<leader>tmor:ThemeToggleModeto toggle between Pywal and manual modes. - The current mode is saved and will be restored on the next Vim startup.
themer.vim offers two modes for theme selection:
- Ensure preview mode is enabled:
let g:vim_themer_preview = 1 - Press
<leader>ttor run:ThemeSelectto open the split-window selector. - Navigate through themes to see real-time previews in your actual buffer.
- Select a theme to apply it permanently, or exit to restore the original theme.
- Disable preview mode:
let g:vim_themer_preview = 0 - Press
<leader>ttor run:ThemeSelectto open the centered selector. - Use FZF's fuzzy finding to search and select themes.
- The selected theme will be applied upon confirmation.
When in Pywal mode, themer.vim automatically applies the current Pywal theme and updates it whenever colors.json changes.
- Toggle to Pywal mode using
<leader>tmor:ThemeToggleMode. - The plugin will apply the current Pywal theme and start monitoring for changes.
themer.vimchecks for updates to Pywal'scolors.jsonevery 5 seconds.- When
colors.jsonis updated (e.g., after runningwalwith a new image), the Vim theme updates automatically.
- Switch back to manual mode using
<leader>tmor:ThemeToggleMode. - Automatic updates will stop, and you can select themes manually.
- Toggle between light and dark background modes for traditional themes using
<leader>tbor:ToggleBackground. - For Pywal themes, the background toggle is not available, as the theme is determined by Pywal.
- Save a theme as default with
<leader>tsor:SaveTheme. - The saved theme will automatically load in future sessions.
- The plugin uses the XDG Base Directory specification for storing configuration and cache files, ensuring compatibility across different systems.
themer.vim can search for colorschemes in multiple directories:
let g:vim_themer_dirs = [
\ '~/.vim/pack/colors/start',
\ '~/.vim/colors',
\ '/usr/share/vim/vimfiles/colors'
\]Control how themer.vim displays the theme selector:
" Enable split-window preview mode with real-time theme preview
let g:vim_themer_preview = 1
" Use centered window without preview
let g:vim_themer_preview = 0Toggle preview mode dynamically using <leader>tv or :ThemeTogglePreview.
Control how themer.vim handles light/dark background settings:
" Automatic detection based on colorscheme brightness
let g:vim_themer_background = "auto"
" Force light mode
let g:vim_themer_background = "light"
" Force dark mode
let g:vim_themer_background = "dark"Enable silent mode to suppress informational messages:
let g:vim_themer_silent = 1Disable default keybindings and set your own:
" Disable default keybindings
let g:vim_themer_disable_keybindings = 1
" Set custom keybindings
nnoremap <silent> <leader>th :ThemeSelect<CR>
nnoremap <silent> <leader>pm :PywalTheme<CR>Adjust the interval for checking Pywal updates (in milliseconds):
" In your vimrc, before the plugin is loaded
let g:vim_themer_pywal_update_interval = 5000 " Check every 5 seconds (default)Note: This variable should be set before the plugin is loaded.
-
Theme Not Found
- Ensure the theme is in one of the directories specified in
g:vim_themer_dirs. - Check that the theme file has a
.vimextension.
- Ensure the theme is in one of the directories specified in
-
Pywal Integration Not Working
- Verify Pywal is installed and has generated colors (
~/.cache/wal/colors.jsonshould exist). - Make sure you've run Pywal at least once to generate the initial color scheme.
- Ensure you are in Pywal mode (
g:vim_themer_modeis set to'pywal').
- Verify Pywal is installed and has generated colors (
-
Automatic Pywal Updates Not Working
- Confirm that Vim supports timers (
+timerfeature). - Check that the plugin is in Pywal mode.
- Ensure
colors.jsonis being updated by Pywal.
- Confirm that Vim supports timers (
-
FZF Not Opening
- Confirm FZF is properly installed and updated.
- Check that the FZF Vim plugin is loaded before
themer.vim.
-
Preview Mode Issues
- Ensure your Vim version supports the required features for split windows.
- Verify that
g:vim_themer_previewis set correctly.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for bug reports and feature requests.
themer.vim is licensed under the MIT License. See the LICENSE file for details.