t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

[No Default Keymap] Insert At Start/End Of Occurrence #859

Closed s3cy closed 7 years ago

s3cy commented 7 years ago

atom + vmp is amazing! thank you! :heart:

Small question here. Under wiki:Rename function parameters in bulk in refactoring , it says

  1. Mark that parameter name with g o(preset occurrence)
  2. Do whatever from following
    • I f or I a f to insert start-of-each occurrence, which is useful when you want to prefix it.
    • A f or A a f to insert start-of-each occurrence, which is useful when you want to suffix it.

But neither I nor A is mapped by default. What is the correct behavior?

Check list

t9md commented 7 years ago

You are correct. I removed some keymap from when I wrote that wiki. I'll update wiki with proper instruction. thanks for asking this.

t9md commented 7 years ago

What I removed keymap is this. Put this in your keymap.cson.

'atom-text-editor.vim-mode-plus.has-occurrence:not(.insert-mode)':
  'I': 'vim-mode-plus:insert-at-start-of-target'
  'A': 'vim-mode-plus:insert-at-end-of-target'

Why I removed this keymap is I thought this is too surprising. But now, I like this keymap again. So I'll make it yet another conditional keymap(enabled based on configuration). And update wiki after that.

t9md commented 7 years ago

Wiki now mentioning conditional keymap which will be available in vmp1.4.0 and later. User still can set above keymap by themselves.

For I f and A f in step 3 to work, you need to enable "keymap I and A to insert-at-start-of-target and insert-at-end-of-target" config(from v1.4.0).