Last active
August 26, 2021 02:34
-
-
Save localmin/4ee1a8fb3ce3305c3a99fff3f85194ba to your computer and use it in GitHub Desktop.
My keybindings for Inkdrop's vim plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
".CodeMirror.vim-mode": {}, | |
".CodeMirror.vim-mode.normal-mode textarea": { | |
"escape": "vim:reset-normal-mode" | |
}, | |
".CodeMirror.vim-mode:not(.insert-mode):not(.key-buffering) textarea": { | |
"h": "vim:move-left", | |
"left": "vim:move-left", | |
"backspace": "vim:move-left", | |
"l": "vim:move-right", | |
"right": "vim:move-right", | |
"space": "vim:move-right", | |
"k": "vim:move-up", | |
"up": "vim:move-up", | |
"j": "vim:move-down", | |
"down": "vim:move-down", | |
"g k": "vim:move-up-by-display-lines", | |
"g j": "vim:move-down-by-display-lines", | |
"w": "vim:move-to-next-word", | |
"W": "vim:move-to-next-whole-word", | |
"e": "vim:move-to-end-of-word", | |
"g e": "vim:move-to-previous-end-of-word", | |
"E": "vim:move-to-end-of-whole-word", | |
"g E": "vim:move-to-previous-end-of-whole-word", | |
"b": "vim:move-to-previous-word", | |
"B": "vim:move-to-previous-whole-word", | |
"}": "vim:move-to-next-paragraph", | |
"{": "vim:move-to-previous-paragraph", | |
"|": "vim:move-to-beginning-of-line", | |
"0": "vim:move-to-beginning-of-line-with-zero", | |
"^": "vim:move-to-first-character-of-line", | |
"_": "vim:move-to-first-character-of-line-and-down", | |
"$": "vim:move-to-last-character-of-line", | |
"g _": "vim:move-to-last-nonblank-character-of-line-and-down", | |
"-": "vim:move-to-first-character-of-line-up", | |
"+": "vim:move-to-first-character-of-line-down", | |
"enter": "vim:move-to-first-character-of-line-down", | |
"g g": "vim:move-to-start-of-file", | |
"ctrl-u": "vim:scroll-half-screen-up", | |
"ctrl-b": "vim:scroll-full-screen-up", | |
"ctrl-d": "vim:scroll-half-screen-down", | |
"ctrl-f": "vim:scroll-full-screen-down", | |
"ctrl-e": "vim:scroll-down", | |
"ctrl-y": "vim:scroll-up", | |
"z enter": "vim:scroll-cursor-to-top", | |
"z t": "vim:scroll-cursor-to-top-leave", | |
"z .": "vim:scroll-cursor-to-middle", | |
"z z": "vim:scroll-cursor-to-middle-leave", | |
"z -": "vim:scroll-cursor-to-bottom", | |
"z b": "vim:scroll-cursor-to-bottom-leave", | |
"z s": "vim:scroll-cursor-to-left", | |
"z e": "vim:scroll-cursor-to-right", | |
"z M": "editor:fold-all", | |
"z R": "editor:unfold-all", | |
"z c": "editor:fold-current-row", | |
"z o": "editor:unfold-current-row", | |
"G": "vim:move-to-line", | |
"H": "vim:move-to-top-of-screen", | |
"L": "vim:move-to-bottom-of-screen", | |
"M": "vim:move-to-middle-of-screen", | |
"d": "vim:delete", | |
"D": "vim:delete-to-last-character-of-line", | |
"c": "vim:change", | |
"C": "vim:change-to-last-character-of-line", | |
"r": "vim:replace", | |
">": "vim:indent", | |
"<": "vim:outdent", | |
"=": "vim:auto-indent", | |
"J": "vim:join", | |
"y": "vim:yank", | |
"Y": "vim:yank-line", | |
"P": "vim:put-before", | |
"p": "vim:put-after", | |
"g ~": "vim:toggle-case", | |
"g U": "vim:upper-case", | |
"g u": "vim:lower-case", | |
"~": "vim:toggle-case-now", | |
"m": "vim:mark", | |
"`": "vim:move-to-mark-literal", | |
"'": "vim:move-to-mark", | |
"f": "vim:find", | |
"F": "vim:find-backwards", | |
"t": "vim:till", | |
"T": "vim:till-backwards", | |
";": "vim:repeat-find", | |
",": "vim:repeat-find-reverse", | |
"/": "vim:search", | |
"?": "vim:reverse-search", | |
"*": "vim:search-current-word", | |
"#": "vim:reverse-search-current-word", | |
"n": "vim:repeat-search", | |
"N": "vim:repeat-search-backwards", | |
"%": "vim:bracket-matching-motion", | |
":": "vim:ex-command" | |
}, | |
".CodeMirror.vim-mode:not(.insert-mode):not(.key-buffering-command) textarea": { | |
"i": "vim:text-object-manipulation-inner", | |
"a": "vim:text-object-manipulation" | |
}, | |
".CodeMirror.vim-mode.normal-mode:not(.key-buffering):not(.visual-mode) textarea": { | |
"i": "vim:activate-insert-mode", | |
"I": "vim:insert-at-beginning-of-line", | |
"insert": "vim:activate-insert-mode", | |
"R": "vim:activate-replace-mode", | |
"v": "vim:activate-characterwise-visual-mode", | |
"V": "vim:activate-linewise-visual-mode", | |
"ctrl-v": "vim:activate-blockwise-visual-mode", | |
"ctrl-q": "vim:activate-blockwise-visual-mode", | |
"u": "vim:undo", | |
"ctrl-r": "core:redo", | |
"O": "vim:insert-above-with-newline", | |
"o": "vim:insert-below-with-newline", | |
"a": "vim:insert-after", | |
"A": "vim:insert-after-end-of-line", | |
"x": "vim:delete-right", | |
"X": "vim:delete-left", | |
"s": "vim:substitute", | |
"S": "vim:substitute-line", | |
".": "vim:repeat", | |
"ctrl-a": "vim:increase", | |
"ctrl-x": "vim:decrease", | |
"\"": "vim:register-prefix" | |
}, | |
".CodeMirror.vim-mode.insert-mode textarea": { | |
"escape": "vim:exit-insert-mode", | |
"j j": "vim:exit-insert-mode", | |
"ctrl-w": "vim:delete-to-beginning-of-word" | |
}, | |
".CodeMirror.vim-mode.replace-mode textarea": { | |
"escape": "vim:exit-insert-mode" | |
}, | |
".CodeMirror.vim-mode.visual-mode textarea": { | |
"escape": "vim:exit-visual-mode", | |
"\"": "vim:register-prefix", | |
"I": "vim:insert-at-start-of-target", | |
"A": "vim:insert-at-end-of-target", | |
"v": "vim:activate-characterwise-visual-mode", | |
"V": "vim:activate-linewise-visual-mode", | |
"o": "vim:reverse-selections", | |
"O": "vim:reverse-selections-at-same-line", | |
"x": "vim:delete-right", | |
"X": "vim:delete-left", | |
"s": "vim:substitute-visual", | |
"S": "vim:substitute-line-visual" | |
}, | |
".note-list-bar": { | |
"k": "core:open-prev-note", | |
"j": "core:open-next-note" | |
}, | |
".mde-preview": { | |
"g g": "vim:move-to-start-of-file", | |
"ctrl-u": "vim:scroll-half-screen-up", | |
"ctrl-b": "vim:scroll-full-screen-up", | |
"ctrl-d": "vim:scroll-half-screen-down", | |
"ctrl-f": "vim:scroll-full-screen-down", | |
"k": "vim:scroll-up", | |
"j": "vim:scroll-down", | |
"G": "vim:move-to-line", | |
"H": "vim:move-to-start-of-file" | |
} | |
} |
Sorry, I couldn't solve the problem and now ignore the custom command.
I also want to know the solution for it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Curious as to how you made the following work:
It works for me, but disables all use of the 'j' key while in insert mode.