Keymap when not in insert mode


#1

Hi,

I fail to understand the keymap syntax and cannot find the documentation about it to resolve my issue.

I want some keybindings to occur when I’m neither in insert mode nor visual mode of visual-mode-plus.

What seems logic to me is ‘body .normal-mode’:
However, the issue is it won’t be triggered in the settings view.

So I have tried ‘body :not(.insert-mode)’. That doesn’t work at all. Do I correctly use the ‘not(.insert-mode)’, can I find somewhere more documentation, or do I just have to read the source code for this?

Kind regards


#2

You seem much in a rush -

You will have to explain that sentence, please. Are you sure you are not thinking of vim-mode-plus?

For what it is worth you can find documentation for Atom:
image

https://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/

For specific package related issues, consider creating an issue where the package is published.


#3

What documentation led you to use .normal-mode and .insert-mode in the first place? It would be helpful to know how you got to this point.


#4

Yes, my apologies for the typo :slight_smile:


#5

I had already read the documentation.
I couldn’t find all the rules about the selectors, therefore I opened this issue.


#6

I started with tweaking the standard keybindings of vim-mode-plus, with selectors such as
'atom-text-editor.vim-mode-plus.with-count:not(.insert-mode)':

However, when I enter the Settings view, or I open a new pane without a text-editor initialized inside of that pane, the selector above will not function (at least in my case).

By reading the documentation (https://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/#selectors-and-custom-packagesmentioned as well by @danPadric :slight_smile: ), I thought there would be just a document.querySelector() on all the strings inside of the selector.

So I looked at the focused pane with the debugger, and see that in normal vim-mode the ‘normal’ class is active.

Maybe to clarify what I would really like to know: are the selectors applicable globally to the entire DOM structure, and what are the exact rules?
For instance, does it in some way accept queries as “pane:not(.insert-mode) && pane.isFocused”

Hopefully I made my question clear, either way thank you guys already for reaching out.


#7

I started with tweaking the standard keybindings of vim-mode-plus, with selectors such as 'atom-text-editor.vim-mode-plus.with-count:not(.insert-mode)':

However, when I enter the Settings view, or I open a new pane without a text-editor initialized inside of that pane, the selector above will not function (at least in my case). By reading the documentation (https://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/#selectors-and-custom-packages mentioned as well by @danPadric :slight_smile: )

I thought there would be just a document.querySelector() on all the strings inside of the selector. So I looked at the focused pane with the debugger, and see that in normal vim-mode the ‘normal’ class is active.

Maybe to clarify what I would really like to know: are the selectors applicable globally to the entire DOM structure, and what are the exact rules?
For instance, does it in some way accept queries as “pane:not(.insert-mode) && pane.isFocused”?

Hopefully I made my question clear, either way thank you guys already for reaching out.


#8

I started with tweaking the standard keybindings of vim-mode-plus, with selectors such as 'atom-text-editor.vim-mode-plus.with-count:not(.insert-mode)': However, when I enter the Settings view, or I open a new pane without a text-editor initialized inside of that pane, the selector above will not function (at least in my case).

By reading the documentation (https://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/#selectors-and-custom-packagesmentioned as well by @danPadric :slight_smile: ), I thought there would be just a document.querySelector() on all the strings inside of the selector. So I looked at the focused pane with the debugger, and see that in normal vim-mode the ‘normal’ class is active.

Maybe to clarify what I would really like to know: are the selectors applicable globally to the entire DOM structure, and what are the exact rules?
For instance, does it in some way accept queries as “pane:not(.insert-mode) && pane.isFocused”?

Hopefully I made my question clear, either way thank you guys already for reaching out.


#9

No, because vim-mode-plus applies its special classes to the atom-text-editor element. The package was never intended to control your keybindings when you aren’t looking at a TextEditor as the active item.


#10

Hello.

I have not idea how to help you;
I do not even understand what exactly you are asking;

My suggestions:

  • Try and ask these questions where the package vim-mode-plus is published
    - perhaps it gets the specialized attention you require.

  • Edit the title of this topic to include the phrase vim-mode-plus.

Cheers.