Nvim-tree.lua: add option to avoid having the cursor over the icons

Created on 8 Feb 2021  路  7Comments  路  Source: kyazdani42/nvim-tree.lua

Hello, I love this plugin but I believe there is a serious flaw. As you can see from the screenshot below my cursor is sitting above an icon; look bro, I love freedom (both in software and life), but this is just way too much and this visual bug makes it very difficult for me to focus.

image

My suggested solution is to add some kind of tab + conceal to avoid the cursor going into an icon. Merci.

enhancement

Most helpful comment

Do you want something like this? I have an autocmd for that but it doesn't work correctly on certain conditions (it's rare though) and it also depends on your terminal.

https://user-images.githubusercontent.com/51877647/109299592-ed1d0a00-7867-11eb-8d40-99c68a2dc78c.mp4

augroup HideCursor
  au!
  au WinLeave,FileType NvimTree set guicursor=n-v-c-sm:block,i-ci-ve:ver2u,r-cr-o:hor20,
  au WinEnter,FileType NvimTree set guicursor=n-c-v:block-Cursor/Cursor-blinkon0,
augroup END
au FileType NvimTree hi Cursor blend=100

All 7 comments

This visual bug as you say is just not a bug, nor does it bothers me. If this is some kind of feature you wish to implement, go for it, i wouldn't mind.

Do you want something like this? I have an autocmd for that but it doesn't work correctly on certain conditions (it's rare though) and it also depends on your terminal.

https://user-images.githubusercontent.com/51877647/109299592-ed1d0a00-7867-11eb-8d40-99c68a2dc78c.mp4

augroup HideCursor
  au!
  au WinLeave,FileType NvimTree set guicursor=n-v-c-sm:block,i-ci-ve:ver2u,r-cr-o:hor20,
  au WinEnter,FileType NvimTree set guicursor=n-c-v:block-Cursor/Cursor-blinkon0,
augroup END
au FileType NvimTree hi Cursor blend=100

@elianiva Oh wow perfect, this is amazing.
I just have one follow up question: how can I make the current line highlight have greater contrast only for the NvimTree buffer?

Just add this autocmd and define your custom highlight group, NvimTreeLine in this case.

  au WinEnter,FileType NvimTree setlocal winhighlight=CursorLine:NvimTreeLine

https://user-images.githubusercontent.com/51877647/109378391-adf0c680-7904-11eb-912b-903a5c1aa6e4.mp4

Problem Solved, tnx.

Do you want something like this? I have an autocmd for that but it doesn't work correctly on certain conditions (it's rare though) and it also depends on your terminal.

simplescreenrecorder-2021-02-26_19.21.49.mp4

augroup HideCursor
  au!
  au WinLeave,FileType NvimTree set guicursor=n-v-c-sm:block,i-ci-ve:ver2u,r-cr-o:hor20,
  au WinEnter,FileType NvimTree set guicursor=n-c-v:block-Cursor/Cursor-blinkon0,
augroup END
au FileType NvimTree hi Cursor blend=100

The latest version seem to not work when open new file.

@evolify see #293

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peach-lasagna picture peach-lasagna  路  5Comments

afonsocarlos picture afonsocarlos  路  3Comments

CantoroMC picture CantoroMC  路  7Comments

GustavoPrietoP picture GustavoPrietoP  路  6Comments

gmr458 picture gmr458  路  6Comments