Replies: 3 comments 1 reply
-
Cursor hiding is possible and working in nvim: neovim/neovim#3688 Unfortunately it's controlled via a global option. I experimented with We can dynamically set the global option, however it's pretty hacky. Please try this POC out for a week and see if it behaves. I think you'll need to tweak things to handle some edge cases. vim.cmd([[
" we have to set some gui attributes for blend to take effect
:hi NvimTreeCursorInvisible guifg=bg guibg=fg blend=100
]])
vim.api.nvim_create_autocmd({ "WinEnter", "BufWinEnter" }, {
callback = function(data)
local api = require("nvim-tree.api")
if api.tree.is_tree_buf(data.buf) then
vim.cmd("set guicursor+=a:NvimTreeCursorInvisible/lNvimTreeCursorInvisible")
else
vim.cmd("set guicursor-=a:NvimTreeCursorInvisible/lNvimTreeCursorInvisible")
end
end,
}) |
Beta Was this translation helpful? Give feedback.
-
Alternative: change the highlight group instead: vim.cmd("hi NvimTreeCursorInvisible guifg=bg guibg=fg blend=0")
vim.cmd("set guicursor+=a:NvimTreeCursorInvisible/lNvimTreeCursorInvisible")
vim.api.nvim_create_autocmd({ "WinEnter", "BufWinEnter" }, {
callback = function(data)
local api = require("nvim-tree.api")
if api.tree.is_tree_buf(data.buf) then
vim.cmd("hi NvimTreeCursorInvisible blend=100")
else
vim.cmd("hi NvimTreeCursorInvisible blend=0")
end
end,
}) |
Beta Was this translation helpful? Give feedback.
-
Improving on @alex-courtis answer:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
is it possible to add a new setup option to hide the cursor in nvim-tree buffer?
Beta Was this translation helpful? Give feedback.
All reactions