Code Monkey home page Code Monkey logo

Comments (7)

above-c-level avatar above-c-level commented on June 20, 2024 2

Hey, I just stopped by to leave the same issue. It's possible he's talking about another vim plugin, but it definitely breaks VSCodeVim.

from vsc-python-indent.

kbrose avatar kbrose commented on June 20, 2024 1

VS code python indent

I believe that's my extension :)

@above-c-level or @ryanrca, could one of you give me a step-by-step instructions for reproducing? I've not used the vim plugin before.

from vsc-python-indent.

above-c-level avatar above-c-level commented on June 20, 2024 1

Yeah no problem! Basically when using vim, you can normally do :w or :wa (colon puts vim into command mode, w means write, a means all), hit enter, and your file(s) is/are saved. For some reason though, vim no longer seems to accept hitting enter in command mode while this plugin is activated, which is necessary for normal operation. Hope this helps

from vsc-python-indent.

ryanrca avatar ryanrca commented on June 20, 2024 1

Try this. Start with a fresh install of VSCode.

  • Install vim plugin
  • Install python plugin
  • Open a python file
  • Edit it: (click i for insert mode, type # test 1234. click esc a couple times to exit insert mode)
  • open dev tools ( Help | Toggle Developer Tools). Go to "console' and clear the console.
  • Save the python file (:w<enter>)

See nothing in the dev tools error console. Observe the file is saved to disk.

  • Install Python indent plugin.
  • Make another edit to a python file
  • Try to save the file (:w<enter>)

See the stack trace in the dev tools error Console. Observe the file is NOT saved to disk.

  • Disable Python Indent plugin.
  • Make another edit to a python file
  • Save the file (:w<enter>)

See nothing in the dev tools error console. Observe the file is saved to disk.

from vsc-python-indent.

kbrose avatar kbrose commented on June 20, 2024

Thanks for leaving an issue! Could you specify which vim plugin you are talking about?

from vsc-python-indent.

ryanrca avatar ryanrca commented on June 20, 2024

Thanks for leaving an issue! Could you specify which vim plugin you are talking about?

VS code python indent

from vsc-python-indent.

kbrose avatar kbrose commented on June 20, 2024

EDIT: This should be resolved in versions v0.7.0 and above, please try upgrading. If the issue persists, please open a new issue.

Thanks for the descriptions!

The problem is that this extension sets the Enter key as a keyboard shortcut, and when the Vim plugin is not in Insert mode, overriding the Enter key means you can't send commands.

In VSCode, you can refine the conditions of when a shortcut will fire, and I can do that for when vim.mode == 'Insert', but this breaks the keyboard when the user does not have the Vim extension installed. As far as I can tell, the when syntax of keyboard shortcuts does not support checking for the existence of a vim.mode variable first.

I'm going to file an issue with the Vim extension to see if we can get a good solution in place.

As a workaround in the meantime, you can edit your own conditions:

  1. Have both the Vim extension and the python indent extensions installed
  2. Open up the keyboard shortcuts page (Ctrl-k Ctrl-s on linux/windows, ⌘-k ⌘-s on Mac)
  3. Use the top bar to search for "pythonindent" (no space)
  4. Right click the pythonIndent.newlineAndIndent row (should be the only row)
  5. Select "Change When Expression"
  6. Add && vim.mode == 'Insert' to the end of the expression.

from vsc-python-indent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.