Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BufEnter autocmd for DiffviewFiles #545

Open
simonmandlik opened this issue Dec 4, 2024 · 0 comments
Open

BufEnter autocmd for DiffviewFiles #545

simonmandlik opened this issue Dec 4, 2024 · 0 comments

Comments

@simonmandlik
Copy link

Hello everyone, I'm using the following to hide the cursor when entering NvimTree and DiffviewFiles:

local function hide_cursor()
    vim.cmd [[
        hi Cursor blend=100
        set guicursor+=a:Cursor/lCursor
    ]]
end

local function show_cursor()
    vim.cmd [[
        hi Cursor blend=0
        set guicursor-=a:Cursor/lCursor
    ]]
end

vim.api.nvim_create_autocmd("BufEnter", {
    pattern = { "NvimTree*", "DiffviewFiles" },
    callback = hide_cursor
})

vim.api.nvim_create_autocmd("BufLeave", {
    pattern = { "NvimTree*", "DiffviewFiles" },
    callback = show_cursor
})

This doesn't work as the BufEnter event is never fired. What am I doing wrong? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant