Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable vim *only* for jupyter notebook editors #6950

Closed
rosspleban opened this issue Aug 3, 2021 · 13 comments
Closed

Disable vim *only* for jupyter notebook editors #6950

rosspleban opened this issue Aug 3, 2021 · 13 comments

Comments

@rosspleban
Copy link

Key bindings for vim and juptyer notebooks overlap, which can frustrate users. For example the period (.) keystroke doesnt work. Also j & k can move the active cell selection.

I prefer vim to be disabled in jupyter notebooks and remained enabled in other editors. This preserves the notebook bindings. Also, notebooks tend to be simpler code/text than traditional source code.

vscode-jupyter said they could not facilitate this: microsoft/vscode-jupyter#6837

@northernocean
Copy link

A toggleVim shortcut to quickly disable/enable Vim extension would be a quick way to turn off Vim when you are in a notebook and turn it back on when you aren't in a notebook.

https://stackoverflow.com/questions/47502318/how-to-toggle-between-vim-emulation-and-no-vim-emulation-when-the-vscodevim-exte

@rosspleban
Copy link
Author

Yes, I have a key binding for toggle vim entirely. Often I'm working with multiple file types simultaneously so that solution isn't ideal.

@PiotrCzapla
Copy link

The VIM behaviour is really erratic in jupyter notebooks, there were too many bugs to describe them here. So it would be really good to let us disable the plugin in jupyter until the issues are sorted out.

Re. bugs it looks like internal state of plugin gets messed up when one I navigate the jupyter notebook with mouse. It manifest it self with cursor jumping to previous locations on edit, copy to clipboard not working , selection not working correctly etc.

@jswetzen
Copy link

I just tried the notebook interface as well, and vim mode makes it completely unusable. Would love it to work of course, but until that's possible, disabling is a must.

@J-Fields
Copy link
Member

Marking this as a duplicate of #6960/#6104. Behavior will be much better in the upcoming release, so hopefully no need to disable 🙂

@ltalirz
Copy link

ltalirz commented Jun 16, 2022

In the meanwhile, another issue popped up about this very topic #6151

It seems to me there is a real demand for being able to disable the vim plugin for certain file types.
Given that both vim and Jupyter notebooks have their own extensive sets of keybindings, it is also not clear to me whether it is even possible to marry vim and Jupyter notebooks in a way that does not lead to unexpected results (as is currently the case).

Is there a good reason for not implementing this feature to disable vim for certain file types?

@v3ss0n
Copy link

v3ss0n commented Jan 11, 2023

anyone get this solve? how can i disable vscode vim for notebooks?

@corneliusroemer
Copy link

@J-Fields can you reopen this issue here? Vim still is broken in the Jupyter REPL editor and neither #6960 nor #6104 fix/have fixed it. Disabling vim altogether still seems the best quickfix.

@fnl
Copy link

fnl commented Dec 16, 2023

I realized the same issues, and was hoping there already exists an automated way to disable vscodevim in Notebooks.
Using Vim editing semantics just don't seem to work well inside a Notebook - for me, in any case.
Is there any better solution other than disabling this extension entirely?

@corneliusroemer
Copy link

It's been almost two months and 5 people have liked my comment asking for reopening so I'll open a new issue.

@jswetzen
Copy link

jswetzen commented Dec 17, 2023 via email

@corneliusroemer
Copy link

corneliusroemer commented Dec 17, 2023

What is not working for you? I've been using Vim mode in notebooks for months without issues. I can see if there are any special settings I made.

Esc deletes my input rather than going from insert mode to normal mode, at least sometimes.
2023-12-17 14 18 36

I think I made some special keybindings to work around vim/jupyter issues but even disabling all custom shortcuts I still get this issue (sometimes)

@jswetzen
Copy link

Interesting, that never happens for me. I didn't have any workaround keybindings only had these:

  1. jk to ESC
  2. ctrl-p override for quickOpen
  3. ctrl-shift-r to restart the Jupyter kernel, can be useful.
  "vim.insertModeKeyBindings": [

    {
      "before": [
        "j",
        "k"
      ],
      "after": [
        "<Esc>"
      ]
    },
  ],
  "vim.normalModeKeyBindings": [
    {
      "before": [
        "<C-p>",
      ],
      "commands": [
        "workbench.action.quickOpen",
      ],
    },
    {
      "before": [
        "<C-shift-r>",
      ],
      "commands": [
        "jupyter.restartkernel",
      ],
    },
  ],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants