Skip to content
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

Fix/keymap/vim ctrl w idle #5711

Merged
merged 2 commits into from Dec 15, 2018

Conversation

fraxx001
Copy link
Contributor

Add new keymap for ctrl-w in normal mode.
type idle is not catched by Command dispatcher and therefore idles.

@marijnh marijnh merged commit 9c1df7b into codemirror:master Dec 15, 2018
@marijnh
Copy link
Member

marijnh commented Dec 15, 2018

Thanks!

@pmbauer
Copy link

pmbauer commented Mar 10, 2022

Questions

Is there context on why <C-w> was explicitly disabled in normal mode? I'd work on a pull request to re-enable it (or submit a revert) but I want to understand the use case for the pull @marijnh @fraxx001.

  1. Would it make sense to revert this change or would that break another use case?
  2. If it would break another use case, would you accept a patch to over-ride entries in the default keymap for contexts it makes sense?

Context

Because <C-w> is explicitly disallowed in the default keymap, it is not possible to use window manipulation routines like split, vsplit, and pane navigation in a context that makes sense.

For example, I'm using vim mode in Obsidian with the obsidian-vimrc-support plugin, and would like to make the following work:

exmap focusRight obcommand editor:focus-right
nmap <C-w>l :focusRight

exmap focusLeft obcommand editor:focus-left
nmap <C-w>h :focusLeft

exmap focusTop obcommand editor:focus-top
nmap <C-w>k :focusTop

exmap focusBottom obcommand editor:focus-bottom
nmap <C-w>j :focusBottom

exmap splitVertical obcommand workspace:split-vertical
nmap <C-w>v :splitVertical

exmap splitHorizontal obcommand workspace:split-horizontal
nmap <C-w>s :splitHorizontal

I have an hilarious hack to patch the vim.js in Obsidian, that does let me use the <C-w> leader to create window splits and navigate windows, but would be happy to work on an upstream patch to make it more accessible.

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.

None yet

3 participants