Skip to content

I can't format code when i save file on vscodevimΒ #9883

@daicx0904

Description

@daicx0904

Describe the bug
I can't format code when i save file by ":w",but "Ctrl+S" is feasible.
its my config file(settings.json)

...
"editor.formatOnSave": true,
  "files.saveConflictResolution": "overwriteFileOnDisk",
  "files.autoSave": "afterDelay",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "always",
    "source.fixAll": "explicit",
    "source.organizeImports": "always"
  },
...

To Reproduce
Steps to reproduce the behavior:

  1. coding
  2. input ":w" to save file and format
  3. The file was saved, but formatting was not applied.
  4. After pressing "ctrl+s", the file was successfully formatted and saved.

Expected behavior
After entering ':w', the file can be correctly formatted and saved.

Screenshots
video here
debug log:

2025-12-25 19:25:51.117 [debug] Set nextStepCursorsAtStart to [[70, 15] | [70, 15]]
2025-12-25 19:25:51.117 [debug] Finished history step with 1 change(s)
2025-12-25 19:25:51.117 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:51.117 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:51.118 [debug] Status bar: -- INSERT --
2025-12-25 19:25:51.814 [debug] Handling key: <BS>
2025-12-25 19:25:51.814 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:51.815 [debug] Adding Transformation {"type":"vscodeCommand","command":"deleteLeft","args":[]}
2025-12-25 19:25:51.820 [debug] 1 change(s) to d:\coding\heart.py because undefined
2025-12-25 19:25:51.826 [debug] Set nextStepCursorsAtStart to [[70, 15] | [70, 15]]
2025-12-25 19:25:51.826 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:52.130 [debug] Handling key: <Esc>
2025-12-25 19:25:52.130 [debug] Remapping <Esc> to <Esc>
2025-12-25 19:25:52.130 [debug] Handling key: <Esc>
2025-12-25 19:25:52.130 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:52.131 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:52.131 [debug] Status bar: -- NORMAL --
2025-12-25 19:25:52.131 [debug] Finished history step with 1 change(s)
2025-12-25 19:25:52.799 [debug] Handling key: :
2025-12-25 19:25:52.814 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:52.825 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:52.826 [debug] Status bar: :|
2025-12-25 19:25:53.456 [debug] Handling key: w
2025-12-25 19:25:53.457 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:53.457 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:53.458 [debug] Status bar: :w|
2025-12-25 19:25:54.131 [debug] Handling key: <enter>
2025-12-25 19:25:54.132 [debug] [InternalSelectionsTracker] Now ignoring intermediate selection change events while running action
2025-12-25 19:25:54.132 [info] Executing :w
2025-12-25 19:25:54.133 [debug] [InternalSelectionsTracker] Resuming handling of selection change events after running action
2025-12-25 19:25:54.133 [debug] Status bar: -- NORMAL --
2025-12-25 19:25:54.133 [debug] Status bar: "heart.py" 390L 10639C written
2025-12-25 19:26:00.596 [info] Active editor: output:vscodevim.vim.Vim
2025-12-25 19:26:00.678 [debug] Status bar: -- NORMAL --

Environment (please complete the following information):

  • Extension (VsCodeVim) version:1.32.4
  • VSCode version:1.107.1(user setup)
  • OS:Windows_NT x64 10.0.26100

Additional context
One day I suddenly discovered that after using clangd to format, it couldn't automatically format on save. But I was sure that other settings were fine (like auto-format on save), and then, for some reason, other languages also couldn't auto-format afterwards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions