Closed elvis-sik closed 8 years ago
Can I see your full custom.js
while swapping gj
with j
is what I did in my custom.js
so should work.
Sure, here it is
// Configure CodeMirror
require([
'nbextensions/vim_binding/vim_binding', // depends your installation
], function() {
// Map jj to <Esc>
CodeMirror.Vim.map("fd", "<Esc>", "insert");
// Swap j/k and gj/gk (Note that <Plug> mappings)
// CodeMirror.Vim.map("j", "<Plug>(vim-binding-gj)", "normal");
CodeMirror.Vim.map("k", "<Plug>(vim-binding-gk)", "normal");
// CodeMirror.Vim.map("gj", "<Plug>(vim-binding-j)", "normal");
CodeMirror.Vim.map("gk", "<Plug>(vim-binding-k)", "normal");
CodeMirror.Vim.map("gu", "<Plug>(vim-binding-_)", "normal");
});
I left k
swapped and j
not so that I know that both are behaving exactly the same (that is, when I press gj
it goes one visual line down, and when I press j
it goes one logical line down. Similarly, k
goes one logical line up and gk
one visual one.
Also I experimented setting random noise as escape-sequence (e.g. uu
) just to be sure that my file was being properly read.
What happened was I could type uu
to jump out of insert mode
but the behavior of gj
or j
or k
or gu
for that matter was still the same.
I see. Thanks for reporting. It seems a bug of the plugin (I didn't notice but my one has same problem as well). I'll fix it
Fixed. Try a latest HEAD (3e4030da4d23094840baa6967b99b965bea4144b)
Thank you very much @lambdalisue If it weren't for this plugin, I wouldn't use the Jupyter nb at all, thank you for your work!
Summary
My
custom.js
is read properly (because I can map the sequencefd
to<Esc>
). However, no<Plug>
mappings seem to work.Environment
Behavior
Expected
With the mapping
in place, when I press
gu
in normal mode, the selected cell should change.Actual
When I press
gu
in normal mode, nothing happens. Similarly for other bindings that use<Plug>
.Step by step procedure
custom.js
gu
What you have done to solve the issue
This happens in Chrome 49.0 as well.
Remarks
What I actually wanted to accomplish is swapping
gj
withj
and ditto fork
.