Skip to content

fix(input/#595): Handle simple vim remaps #2668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Nov 6, 2020

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Nov 3, 2020

This implements the first step in handling Vim remaps (map, inoremap, etc) - hooks up the externalized mapping API in onivim/libvim#236 , and uses a common input handling framework for both the bindings specified in keybindings.json and the mappings specified via map - an important step in being able to use and load VimL plugins and configuration.

This only handles very basic mappings currently - mappings that don't have any mode transitions and are only command characters (<esc>, <cr>, etc) - however, subsequent work will remove these limitations. It's enough though to handle basic scenarios like #595 , but not enough to handle more intricate bindings as described in #2579 (yet).

Fixes #595

@bryphe bryphe merged commit 0fff96b into master Nov 6, 2020
@bryphe bryphe deleted the fix/input/595/simple-vim-remaps branch November 6, 2020 05:59
bryphe added a commit that referenced this pull request Nov 7, 2020
This adds support for specifying the `<leader>` key in `keybindings.json` as well as mappings coming from VimL (`map` family).

The leader key can be specified via either:
- `vim.leader` configuration setting in `configuration.json` - ie: `"vim.leader": "<space>"`
- `:map <space> <leader>`"` via an Ex command.

In addition, this also lays some groundwork for some other binding constructs we need... Like support for handling `<Plug>` and `<SNR>` as part of the VimL integration work.

__TODO:__ 
- [x] Depends on #2668 
- [x] Add `vim.leader` configuration setting
- [x] Update documentation

__Next steps:__
- Pull leader key from `let mapleader`, if available - this requires a bit of extra work in libvim: onivim/libvim#244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't type letters in remapped sequence
1 participant