mikavilpas / yazi.nvim

A Neovim Plugin for the yazi terminal file manager
MIT License
243 stars 7 forks source link

Feature request: Mousewheeel support #49

Closed Zeioth closed 2 months ago

Zeioth commented 2 months ago

Back in the day I implemented this in rnvimr and implementing the same feature here would be trivial.

You can check my PR as reference: https://github.com/kevinhwang91/rnvimr/issues/58#issuecomment-1550090411

mikavilpas commented 2 months ago

Thanks for the idea!

How is yazi mouse support for you without neovim? My experience has been less than optimal, but I have some trackpad and it may complicate things.

I notice your implementation had some extra logic for tmux. Does this complicate things?

Zeioth commented 2 months ago

@mikavilpas The main mouse feature is covered in the snippet above.

Yazi still lack a few important mouse features I had back in ranger.

Personally I use a programmable keyboard with a trackball and this is x300 user experience for me.

mikavilpas commented 2 months ago

@mikavilpas The main mouse feature is covered here: "Beign able to scroll the list with the mousewheeel".

was this supposed to include a link? I'm curious to read more but don't know where to go 🙂


Anyway, I think this is a cool idea so I'll try to implement it, perhaps as optional at first so we can try it out.

Zeioth commented 2 months ago

Ok it's a pretty straighforward copy paste. To be honest I would PR it myself, but I'm full for a few days. So whoever go it faster :3

mikavilpas commented 2 months ago

Ok there's now a "soft launch" in the main branch. You need to opt in to this feature like this https://github.com/mikavilpas/dotfiles/commit/f7aff2b88d32c86f0deb09f9f530f8230e302fb2

Let me know how it works for you.

Zeioth commented 2 months ago

I can confirm it works. Thank you so much for adding it so fast!! 🎉🎉

mikavilpas commented 1 month ago

@Zeioth much better mouse support was merged into yazi an hour or so ago https://github.com/sxyazi/yazi/pull/1038

If you're able to build from source (I use cargo install --path yazi-fm to do this), you might get much better mouse support. Also remember to turn off our "hacky" setting if you try it out:

diff --git a/.config/nvim/lua/plugins/my-file-manager.lua b/.config/nvim/lua/plugins/my-file-manager.lua
index bb70be8..8d278c6 100644
--- a/.config/nvim/lua/plugins/my-file-manager.lua
+++ b/.config/nvim/lua/plugins/my-file-manager.lua

@@ -27,7 +27,6 @@ return {
     ---@type YaziConfig
     opts = {
       open_for_directories = true,
-      enable_mouse_support = true,
       -- log_level = vim.log.levels.DEBUG,
       integrations = {
         grep_in_directory = function(directory)