Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

capsdetect.nvim

Windows, Linux and MacOS CAPS detector and indicator for Neovim

Usage

Lazy.nvim

return {
  "nikita-edel/capsdetect.nvim",
}

Configuration

return {
	"nikita-edel/capsdetect.nvim",
	config = function()
		require("capsdetect").setup({
			-- those are the defaults
			schedule = {
				no_schedule = false, -- turns of the scheduler / updater
				refresh_ms = 100, -- rate at which the update happens
				-- user provided call back with signature:
				-- act_on(state) where state is a bool
				-- which is setting the variable / updating the window
				callback = nil,
				-- decides if the global vim variable:
				-- vim.g.caps_state gets updated on schedule or not set at all
				update_global = true,
			},
			indicator = {
				use_indicator = true, -- use the builtin indicator
				highlight = "ErrorMsg", -- color of the "CAPS" text
				-- alternative:
				--highlight = {
				--fg = "#ff0000",
				--},
			},
		})
	end,
}

Functions

this plugin exposes:

  • get_caps_state() which is the platforms specific function that returns a bool
  • start() and stop()
  • and the global variable vim.g.caps_state if not turned off (it wont be set)

Indicator

The builtin indiciator is a small window that follows above the cursor:

demo

Contribution

feel free to submit a pr for more supported platforms

About

Windows, Linux and MacOS CAPS detector and indicator for neovim

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Contributors

Languages