Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Keyboard Accessibilty for non-Vim/Neovim features #366

Closed
bryphe opened this issue Apr 13, 2017 · 3 comments
Closed

Keyboard Accessibilty for non-Vim/Neovim features #366

bryphe opened this issue Apr 13, 2017 · 3 comments

Comments

@bryphe
Copy link
Member

bryphe commented Apr 13, 2017

One major selling point for me in using Vim/Neovim is keyboard accessibility. In fact, the reason I started using Vim in the first place was because I had trouble coding on an airplane and hated touchpads ✈️ 😄

At the same time, Oni is exploring bringing in some modern, non-terminal UX features that are present in more modern IDEs. The log viewer in #365 is an example - some other examples might be a file browser, a git repo history browser, markdown preview, etc. I believe it is still important to preserve the keyboard accessibility of these features in a way that makes sense to Vim users.

I'd like to propose adding capabilities similiar to Vimium (https://github.com/philc/vimium) or cVim in the browser - these let you specify a specific hotkey, like f and jump to elements on the page.

The behavior could be as follows:

  • Hotkey to trigger behavior: <Alt+s> for navigation with the current buffer/window/split, <Alt+Shift+s> for navigation across Oni
  • Once the hotkey is triggered, we would show labels against all interactive elements, something like this:
    image

This would make it easy to quickly navigate across various pieces of UI.

Some example use cases:

  • Trigger a button in a sidebar menu
  • Trigger a status bar item
  • Open a markdown preview window, use this behavior to click a link
  • Open a separate browser window, use this behavior to navigate
@justinmk
Copy link

justinmk commented Apr 20, 2017

I wonder what mechanism could be added in core nvim to help with this. E.g. for the examples of an embedded web browser, or a graphical file tree, one can ask: what do users want carried over to those components?

The most basic thing that stands out is key mappings. As I user I would want to be able to ctrl-w to the graphical window like any other text window, and have buffer-local mappings there.

These graphical windows could be backed by a special buffer type (or even just a blank, normal buffer with a name like [External] and filetype=extfoo). Then users can set up mappings using the typical approach, on a FileType event: au FileType extfoo nnoremap <buffer> a b. The external UI would probably need to ignore the cursor position reported by nvim in these buffers, but the external component still needs to know the user pressed something (j) that means "go down 1 unit".

What's the minimum needed from core nvim to support this somewhat elegantly for external UIs? Perhaps a new mode (and/or new "mapping namespace", e.g. :enoremap) is justified?

@jordwalke
Copy link

I would want these key bindings to integrate with the actual internal vim windows. For example in Atom, I have a binding to move to the left window or right window. It focuses either the split to the left or right but then it eventually focuses the file tree if that is the left most window. I would hope it possible to make the internal key mappings integrate well in a similar manner.

@bryphe bryphe added this to the 0.4 milestone Apr 27, 2017
This was referenced Aug 14, 2017
bryphe added a commit that referenced this issue Jan 31, 2018
* Start prototyping sneak UI

* Some progress towards prototyping sneak UI

* Add 'sneak-style' UI + helper component

* Fix up lint issues / remove addressed comments

* Add bold highlighting, use colors from colorscheme

* Tweak visual styling of sneaks

* Fix lint issues

* Add placeholder binding for s/S
@bryphe
Copy link
Member Author

bryphe commented Feb 3, 2018

With the latest work, we now have window navigation between windows / splits / sidebar pane (using the same mechanism, like <C-w>h, and we have a preliminary 'jump-to-elements' behavior with Control+G. So I'll close this out for now, but it does need further integration with some of the upcoming features (like the embedded browser) to be really useful!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants