justinmk / vim-sneak

The missing motion for Vim :athletic_shoe:
http://www.vim.org/scripts/script.php?script_id=4809
MIT License
3.24k stars 88 forks source link

Add support for `vscode-neovim` #285

Closed searleser97 closed 1 year ago

searleser97 commented 2 years ago

Updated PR from: https://github.com/justinmk/vim-sneak/pull/284, just for reference

Context

  1. vscode-neovim does not support conceal properly when highlighting for now, therefore, when using let g:sneak#label = 1 the labels were not shown as expected, instead, the first character of the match is shown always.
  2. vscode-neovim supports text decorations to be shown on top of existing text with the option "vscode-neovim.textDecorationsAtTop": true in vscode's settings.json
  3. easymotion plugin had a similar issue that was solved using textDecorations for vscode. See https://github.com/asvetliakov/vscode-neovim#vim-easymotion and commit adding text decorations

https://user-images.githubusercontent.com/5056411/136433077-53bd524c-09e1-49fd-ba71-10d9e5ffbda6.mp4

note 1: all the labels have the same key on them note 2: you can see the key strokes on the status line at the bottom

What does this PR do?

It adds support for vscode-neovim by adding text-decorations just when the user is in vscode

Evidence

https://user-images.githubusercontent.com/5056411/136434014-5f5ad353-11f3-4c18-b4a5-e1008d4f63de.mp4

theol0403 commented 2 years ago

Thanks for working on this! Is it totally necessary, though? About half a year ago, vim-sneak worked as-is in vscode-neovim, and then something broke - maybe a fix, rather than a completely different approach, would be better? What about adding support for the conceal property?

Imo, the easymotion text-decoration workaround isn't ideal either, it would be best to add extmark support to vscode-neovim and then use hop.nvim as-is.

justinmk commented 1 year ago

Besides the above question, https://github.com/justinmk/vim-sneak/pull/303 may also have helped here.

searleser97 commented 1 year ago

Actually, Now there is no reason to keep using vim-sneak sine we now have leap plugin which works with VSCode and does better job than vim-sneak .

justinmk commented 1 year ago

Wrong. vim-sneak supports vim 7.3.