-
Notifications
You must be signed in to change notification settings - Fork 109
VmpUniqueKeymaps
t9md edited this page Mar 20, 2018
·
3 revisions
- Normal keymap addition
- Operator-pending-mode specific shorthand keymaps
- Conditional keymap enabled by setting.
-
g /
is mapped totoggle-line-comments
- So you can toggle comment for paragraph by
g / i p
org / p
.
- So you can toggle comment for paragraph by
-
g C
is mapped tocamel-case
- You can convert to CamelCase for dash-case-ed word by
g C c
.
- You can convert to CamelCase for dash-case-ed word by
-
g -
is mapped todash-case
- You can convert to dash-case for CamelCase-ed word by
g - c
.
- You can convert to dash-case for CamelCase-ed word by
-
g space
is mapped tocompact-spaces
- You can convert to
(a b c)
to(a b c)
byg space i (
.
- You can convert to
-
g |
is mapped totrim-string
- You can convert to
" abc "
to"abc"
byg | i "
.
- You can convert to
-
subword
text-object have default keymap, you can change subword byc i d
.-
i d
:inner-subword
-
a d
:a-subword
-
-
cmd-a
is mapped toinner-entire
inoperator-pending
andvisual-mode
for macOS user.- So macOS user can use
cmd-a
as shorthand ofi e
(inner-entire
). - E.g. Change all occurrence in text by
c o cmd-a
instead ofc o i e
- So macOS user can use
- In
operator-pending-mode
, next command must betext-object
ormotion
- So all
operator
command inoperator-pending-mode
is INVALID. - This mean, we can safely use operator command's keymap in
operator-pending-mode
as shorthand keymap oftext-object
ormotion
. - But using these keymap for
motion
is meaningless since motion is single-key, but text-object key is two keystroke(e.g.i w
). - So I pre-defined short-hand keymap for text-object which was work for me.
-
c
as shorthand ofinner-smart-word
, butc c
is not affected.- You can
yank word
byy c
instead ofy i w
. ( change byc c
if you enabled it in setting ) - To make
c c
works forchange inner-smart-word
, setkeymapCCToChangeInnerSmartWord
totrue
(false
by default ) -
smart-word
is similar toword
but it's include-
char.
- You can
-
C
as shorthand ofinner-whole-word
- You can
yank whole-word
byy C
instead ofy i W
. ( change byc C
)
- You can
-
d
as shorthand ofinner-subword
, butd d
is not affected.- You can
yank subword
byy d
instead ofy i d
. ( change byc d
)
- You can
-
p
as shorthand ofinner-paragraph
- You can
yank paragraph
byy p
instead ofy i p
. ( change byc p
)
- You can
- Several configuration option each is 1-to-1 mapped to keymap.
- When set to
true
, corresponding keymap is defined. - This is just as helper to define complex keymap via checkbox.
- For me, I enabled all of these setting and I want strongly recommend you to evaluate these setting at least once.
- These keymaps are picked from my local keymap which was realy work well for a log time.
- Here is new setting, all
false
by default. Effect(good and bad) of these keymap is explained in vmp's setting-view.
-
keymapCCToChangeInnerSmartWord
- Can:
c c
tochange inner-smart-word
- Conflicts:
c c
( change-current-line ) keystroke which is equivalent toS
orc i l
etc.
- Can:
-
keymapUnderscoreToReplaceWithRegister
- Can:
_ i (
to replace inner-parenthesis with register's value
- Can:
_ i ;
to replace inner-any-pair if you enabledkeymapSemicolonToInnerAnyPairInOperatorPendingMode
- Conflicts:
_
(move-to-first-character-of-line-and-down
) motion. Who use this??
- Can:
-
keymapSemicolonToInnerAnyPairInOperatorPendingMode
- Can:
c ;
tochange inner-any-pair
, Conflicts with original;
(repeat-find
) motion.
- Conflicts:
;
(repeat-find
).
- Can:
-
keymapSemicolonToInnerAnyPairInVisualMode
- Can:
v ;
toselect inner-any-pair
, Conflicts with original;
(repeat-find
) motion.
L - Conflicts:
;
(repeat-find
).
- Can:
-
keymapBackslashToInnerCommentOrParagraphWhenToggleLineCommentsIsPending
- Can:
g / /
to comment-in already commented region,g / /
to comment-out paragraph.
- Conflicts:
/
(search
) motion only wheng /
is pending. you no longe cang /
with search.
- Can: