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.
I'm extremely indecisive when choosing my colorscheme. I considered setting up my colors in a .gitignore
d file, but telescope's colorscheme picker is way too convenient compared to editing a file 🐵
Ye olde plugin manager.
-- packer
use({ 'raddari/last-color.nvim' })
None. It'll call setup
itself when loaded.
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 😀
Using the lua snippet above:
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 😁