Re: [dev] how can I remap vis to bépo layout?

From: Felix Van der Jeugt <felixvdj+suckless_AT_posteo.be>
Date: Thu, 31 Oct 2019 17:21:41 +0100

Hi,

Quoting Damien Thiriet (2019-10-31 13:27:28)
> Since there were announcement related to vis on that
> list, I'll give a try here.
> Being a bépo user (a dvorak-inspired keyboard,
> look at www.bepo.fr), I would like to remap some keys
> in vis normal mode, namely ctrs to hjkl and hjkl to ctrs.
> I tried this on my visrc.lua
>
> -- load standard vis module, providing parts of the Lua API
> require('vis')
>
> vis.events.subscribe(vis.events.INIT, function()
> -- Your global configuration options
> -- hjkl <=> ctrs
> vis:command('map! normal h c')
> vis:command('map! normal c h')
> vis:command('map! normal j t')
> vis:command('map! normal t j')
> vis:command('map! normal k s')
> vis:command('map! normal s k')
> vis:command('map! normal l r')
> vis:command('map! normal l r')
> end)
>
> vis.events.subscribe(vis.events.WIN_OPEN, function(win)
> -- Your per window configuration options e.g.
> vis:command('set number')
> end)
>
> As a result neither of these keys do work.
> This might be because mapping is recursive,
> or something connected to operators.
> What shall I do to switch those keys?

I'm not sure if you can do actual swaps. This works, though:

    vis:map(vis.modes.NORMAL, 'r', '<vis-motion-line-down>')
    vis:map(vis.modes.NORMAL, 'j', '<vis-replace-char>')

You can check :help in vis to find the other names to map to.

Sincerely,
Felix
Received on Thu Oct 31 2019 - 17:21:41 CET

This archive was generated by hypermail 2.3.0 : Thu Oct 31 2019 - 17:24:11 CET