nvim-zh / colorful-winsep.nvim

Make your nvim window separators colorful
MIT License
422 stars 16 forks source link

Change color of active window based on mode #65

Closed nishantpillai5 closed 4 months ago

nishantpillai5 commented 5 months ago

Is there a way to change the color of active window based on the current mode? I would like to have a different color if the window in Insert mode or Visual mode, etc.

denstiny commented 4 months ago

cmd highlight NvimSeparator

denstiny commented 4 months ago
vim.api.nvim_create_autocmd({ "ModeChanged" }, {
    callback = function(arg)
        local n = arg.match:match(".:(%a)")
        if n == "i" then
            vim.cmd("hi NvimSeparator guifg=red")
        elseif n == "n" then
            vim.cmd("hi NvimSeparator guifg=#E6C384")
        elseif n == "v" then
            vim.cmd("hi NvimSeparator guifg=blue")
        end
    end,
})