Skip to content

Remember your last call to :colorscheme between restarts

License

Notifications You must be signed in to change notification settings

raddari/last-color.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Last Color

Last Color saves the name of the last (successful) colorscheme change to your filesystem and allows you to recall it whenever you desire. As such, you can automatically set your colorscheme between sessions based on what you last used! See the usage section for an example.

Why?

I'm extremely indecisive when choosing my colorscheme. I considered setting up my colors in a .gitignored file, but telescope's colorscheme picker is way too convenient compared to editing a file 🐵

Installation

Ye olde plugin manager.

-- packer
use({ 'raddari/last-color.nvim' })

Configuration

None. It'll call setup itself when loaded.

Usage

Dead simple. I use the snippet below in my init.lua to automatically use the last theme. There's also an Ex command; :LastColor.

-- default theme as a backup, `recall()` can return `nil`.
local theme = require('last-color').recall() or 'default'
vim.cmd.colorscheme(theme)

I personally don't lazy load my plugins, but I'm sure you could modify the snippet to account for that 😀

Showcase

Using the lua snippet above:

last-color

Issues

Please open an issue for any problems you encounter, or suggestions for improving the code quality. This is my first plugin, so I'm still learning and looking to improve 😁

About

Remember your last call to :colorscheme between restarts

Topics

Resources

License

Stars

Watchers

Forks