Skip to content

Theme (colorscheme) selection menu, using telescope pickers for neovim

Notifications You must be signed in to change notification settings

Paulobox/themes.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

${\textsf{\color{#00A6ED}Themes}}$🎨 menu for Neovim (using Telescope plugin)

An extension for Telescope plugin to switch colorschemes. It will read all your installed themes (in addition to Nvim builtin themes)

demo


Prerequisite Telescope🔭 (plugin for neovim)


Installation 🛠️

Using packer.nvim or lazy.nvim plugin managers

🔻 ${\textsf{\color{lightgreen}Add this line to your init.lua :}}$

require("current-theme")

🔻 ${\textsf{\color{lightskyblue}As a plugin, example with keybind (using lazy)}}$

return {
  "nvim-telescope/telescope.nvim",
  tag = "0.1.5",
  cmd = "Telescope",
  dependencies = {
  	"Paulobox/themes.nvim",
  	"nvim-lua/plenary.nvim",
  },
  config = function()
  	local telescope = require("telescope")
  	telescope.load_extension("themes")
  end,
},

vim.keymap.set("n", "<leader>th", ":Telescope themes<CR>", {noremap = true, silent = true, desc = "Theme Switcher"})

Usage ⚙️

:Telescope themes

Keybind to  • <leader>th •  for quick access

vim.keymap.set("n", "<leader>th", ":Telescope themes<CR>", {noremap = true, silent = true, desc = "Theme Switcher"})

Important⚠️

You need to add require require("current-theme") at the end of your ${\textsf{\color{lightgreen}init.lua}}$ so the theme you have selected loads on every startup. As the extension is writing the colorscheme command in your config, and neovim configs are very indvidual and unique, it is hard to predict which part to manipulate, so the ${{\textsf{\color{gold}extension creates a file named {\textsf{\color{#F49EC4}current-theme.lua{\textsf{\color{gold} will be generated in root of /lua directory}}}}}}}$, it contains the command responsible ${\textsf{\color{#00A64F}for saving the latest theme}}$ and it's overwritten by the extension on every new selection.
vim.o.termguicolors = true


Credits

Neovim's plugin Telescope🔭: nvim-telescope/telescope.nvim
Lazy💤 plugin manager folke/lazy.nvim
Screenshot colorscheme embark-theme/vim
Original made by /andrew-george/

  • It is inspired by NvChad's theme switcher, but made to work with most custom configurations.

About

Theme (colorscheme) selection menu, using telescope pickers for neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages