Skip to content

The idle cursor is always white; it doesn't pick up the highlight color. #174

@AugustoMegener

Description

@AugustoMegener

I have this autocmd plugin to change my cursor color to specific modes. Without it, it works normally, but with it, it doesn't. The correct color only appears when the cursor is moving; when it's stationary, it's white.

local mode_cursor_colors = {
    n = "#f29554",
    i = "#6bc99d",
    v = "#9595d9",
    V = "#9595d9",
    ["\22"] = "#9595d9",
    R = "#f25146",
    c = "#e3a824",
}

vim.api.nvim_create_autocmd("ModeChanged", {
    callback = function()
        local color = mode_cursor_colors[vim.fn.mode()] or "#f29554"
        vim.api.nvim_set_hl(0, "Cursor", { fg = "NONE", bg = color })
        vim.api.nvim_set_hl(0, "CursorLineNr", { fg = color, bold = true })
    end,
})

I'm configuring it this way to get the hl from the "Cursor", but it turns white when it's idle.

require("smear_cursor").setup({
    opts = {
        cursor_color = "Cursor",
        legacy_computing_symbols_support = false,
        scroll_buffer_space = true,
        smear_between_buffers = true,
        smear_between_neighbor_lines = true,
        smear_insert_mode = true,
    },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions