Skip to content

DanielVolchek/tailiscope.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tailiscope.nvim

Simple Telescope extension that mirrors the nerdcave cheatsheet

Help maintain development flow within Neovim while using Tailwind CSS

Demo

Search through lists and copy what you need:

Go back between history:

Open Docs:

Search through everything:

Setup

-- plugin setup
use("danielvolchek/tailiscope.nvim")
-- anywhere else
require('telescope').load_extension('tailiscope')

If you have tailwind lsp you can setup on attach

if client.name == "tailwindcss" then
  require('telescope').load_extension('tailiscope')
  vim.keymap.set("n", "<leader>fw", "<cmd>Telescope tailiscope<cr>")

Config

Default Config

require('telescope').setup({
	extensions = {
		tailiscope = {
			-- register to copy classes to on selection
			register = "a",
		 	-- indicates what picker opens when running Telescope tailiscope
			-- can be any file inside of docs dir but most useful opts are
			-- all, base, categories, classes
			-- These are also accesible by running Telescope tailiscope <picker>
			default = "base",
			-- icon indicates an item which can be opened in tailwind docs
			-- can be icon or false
			doc_icon = "",
		  	-- if you would prefer to copy with/without class selector
		 	-- dot is maintained in display to differentiate class from other pickers
			no_dot = true,
			maps = {
				i = {
					back = "<C-h>",
					open_doc = "<C-o>",
				},
				n = {
					back = "b",
					open_doc = "od",
				},
			},
	}
}

Useful changes

If you would like to set result to default register, set register = '"'

If you would like to open a searchable list of only classes when using :Telescope tailiscope command set default = "classes"

Future update features

  • Maintain search when going back through history
  • Support multiselect to copy multiple classes to register
  • Even possibly multiselect to open lists of lists together
  • Match regex for colors and set highlight if the regex matches
  • Get a list of default colors from tailwind docs, also check tailwind config for alternate colors (only matching default color groups)

About

TailwindCSS cheatsheet within Telescope

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published