inkdropapp / inkdrop-vim

Provides Vim modal control for Inkdrop, blending the best of Vim and Inkdrop
https://www.inkdrop.app/
MIT License
99 stars 9 forks source link

'Ctrl-[' not working on Windows #26

Closed GaelanVenturi closed 3 years ago

GaelanVenturi commented 3 years ago

Hello, It doesn't appear that 'Ctrl-[' remaps the esc key for vim in inkdrop.

I've placed the following command in my keymap file but the command still does not work:

{
  ".CodeMirror.vim-mode.normal-mode textarea": {
    "ctrl-[": "vim-mode: reset-normal-mode"
  }
}

For reference the keyboard I am using is an HHKB Hybrid Type-S with a standard ANSI layout.

Thank you

craftzdog commented 3 years ago

Hi. vim-mode: reset-normal-mode is not correct. Do not insert a space after the colon.

{
  ".CodeMirror.vim-mode.normal-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.insert-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.replace-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.visual-mode textarea": {
    "ctrl-[": "vim:exit-visual-mode",
  }
}
hideakitai commented 2 years ago

Hi @craftzdog , thank you for the great app! I had the same problem on Windows. My keyboard is RealForce UB87 and it's a US keyboard. Replacing ctrl-[ to j j also didn't work... Do you have any idea for this?

{
  '.CodeMirror textarea': {
    'ctrl-[': "false",
    'ctrl-]': "false"
  },
  ".CodeMirror.vim-mode.normal-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.insert-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.replace-mode textarea": {
    "ctrl-[": "vim:reset-normal-mode"
  },
  ".CodeMirror.vim-mode.visual-mode textarea": {
    "ctrl-[": "vim:exit-visual-mode"
  }
}

image

craftzdog commented 2 years ago

Hi,

The commands are different for the other modes. Can you please try the following keymap?:

  ".CodeMirror.vim-mode.insert-mode textarea": {
    "ctrl-[": "vim:exit-insert-mode"
  },
  ".CodeMirror.vim-mode.replace-mode textarea": {
    "ctrl-[": "vim:exit-insert-mode"
  },
  ".CodeMirror.vim-mode.visual-mode textarea": {
    "ctrl-[": "vim:exit-visual-mode"
  }

Ref: https://github.com/inkdropapp/inkdrop-vim/blob/master/keymaps/vim.json#L145

hideakitai commented 2 years ago

Wow, worked perfectly... Thank you so much!

craftzdog commented 2 years ago

Great!