atom/vim-mode

ci' command does not work

Closed this issue · 17 comments

Version: 0.59.0

How to reproduce:

  1. Create a new file
  2. Write: 'my-project'
  3. In normal mode set cursor to character "o"
  4. Enter the following command: ci'

What happens: nothing
What should happen: "my-project" should be removed and editor should enter insert mode

@mushketyk can you please check what the Key Binding Resolver (toggled with cmd-. or in the Packages menu) shows when you've pressed ci'?

@jacekkopecky Hi, I could only find bindings for "c" in Packages -> Settings View -> Show Keybindings:
c vim-mode:change Vim Mode atom-text-editor.vim-mode:not(.insert-mode)

I also noticed that I can reproduce this bug only from time to time and if I restart Sublime everything works fine again.

I am a new vim-mode user and this is a limitation I have encountered as well.

The Key Binding Resolver shows i'.

And here is the code I am trying to perform the operation on:

ExUnit.start

defmodule MyTest do
  use ExUnit.Case
    test 'i wanna replace text in here pls' do
      assert 1 + 1 == 2
    end
end

Is there any more information you would like from me?

I noticed that ci{ etc. works fine.

@alexbooker can you reliably reproduce the condition? I tried ci' in various places of your test name and it worked properly. And if you can reproduce it, does it also show up when you disable packages other than vim-mode and restart Atom?

It could also be that the user sometimes, through a distraction, spends more than a second between typing i and ' – that would cancel the Atom command.

Can you reliably reproduce the condition?

@jacekkopecky Yes, I can.

And if you can reproduce it, does it also show up when you disable packages other than vim-mode and restart Atom?

Yes.

It could also be that the user sometimes, through a distraction, spends more than a second between typing i and ' – that would cancel the Atom command.

It does work with ci{ etc. so I do not think this is the problem.

I am running Atom 1.0.11 on Windows 10 64bit. I'll try reinstalling Atom now.

Any other questions I can answer to help solve this? Thanks.

@alexbooker can you also please paste the output of apm list --installed here (and/or try to disable all community packages except vim-mode)? Thanks.

Eureka!

This issue stems from using English (United Kingdom) keyboard layout. It works if I use English (United States).

Makes sense because @mushketyk and I are both in the United Kingdom.

How to reproduce:

(On Windows 10)

  1. Change keyboard layout to English (United Kingdom) (tutorial).
  2. Follow steps in OP

Other:

I dunno if this is a problem with vim-mode or Atom in general because vim-surround commands that involve ' or " do not work with English (United Kingdom) either... //cc @gepoch

Do you need to press AltGr to get to '?

@50Wliu No I do not - I never use AltGr.

Is there any more information I can provide? I really miss this feature 😢

@alexbooker in case you haven't already, can you please try it with https://atom.io/packages/keyboard-localization installed? Cf #709
I don't have Windows so I can't reproduce it.

@jacekkopecky That definitely helped - now I can use ci" but ci' still does not work. Thanks.

Unfortunately, I adopted a single-quote convention in my app (i.e. I use ' instead of "). Any other thoughts?

Upon further inspection keyboard-localization works very well for me and it should for @mushketyk, too.

I generated a custom keymap using these instructions:

{
    "50": {
        "shifted": 34
    },
    "192": {
        "unshifted": 39
    }
}

And now ci" and ci' work fine. vim-surround commands involving ' and " work fine now as well.

As stated in the README, this package is no longer maintained and is deprecated. We recommend that people use the vim-mode-plus package instead. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!