Windows, Linux and MacOS CAPS detector and indicator for Neovim
return {
"nikita-edel/capsdetect.nvim",
}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,
}this plugin exposes:
get_caps_state()which is the platforms specific function that returns a boolstart()andstop()- and the global variable
vim.g.caps_stateif not turned off (it wont be set)
The builtin indiciator is a small window that follows above the cursor:
feel free to submit a pr for more supported platforms
