Initiatives

For each time in neovim I feel it doesn’t make sense to simply use hjkl with a magic trackpad on hand. And eventually I get to work on it.

To begin.

  1. The file structure
  2. Works on the init.lua in neovim config
.config/
└── nvim/
    ├── init.lua
    └── lua/
        ├── config/
        │   └── ...
        └── plugins/
            └── ...

Major Workaround

  1. Reference to Neovim official document about the scrollwheel.
  2. Setups in init.lua
1
2
3
4
5
vim.cmd([[hi CursorLine guibg='default' gui=underline]])
vim.cmd([[map <ScrollWheelUp> j]])
vim.cmd([[map <ScrollWheelDown> k]])
vim.cmd([[map <ScrollWheelRight> h]])
vim.cmd([[map <ScrollWheelLeft> l]])

Final Effect

Two finger scroll to replace hjkl in normal mode. gif