VSCodeVim / VSCodeVim/Vim

Make `:w` execute "Save Without Formatting" (or introduce new command)

Open
#4,493 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Is your feature request related to a problem? Please describe.

In "real" vim, by default, the command :w saves the document without applying any language-specific formatting rules to the active buffer.

However, in VSCodeVim, :w performs the default Save action (i.e. cmd+s), which formats the document before saving it.

Describe the solution you'd like

VSCode offers a separate action in the command palette called "File: Save without formatting," which will save your file as-is.

It's my opinion that :w should invoke that save method.

Describe alternatives you've considered
So that behavior doesn't change for existing users, perhaps a separate command could be introduced that invokes the "File: Save without formatting" command, for instance: :wwo, (i.e. write without)

Additional context

I've been working with a team on a Javascript project, where all other developers are using Sublime or Atom.

VSCode has an expansive set of formatting rules that are applied on a "regular" file save. It ends up converting things like function(foo) { } into function (foo) {}. These changes are extremely unimportant to me, and to my team. However, I end up saving my work (out of habit) with :w — subtle changes get made that add a ton of bloat to my pull requests, which are a hassle to unwind individually with git add --patch .

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the TypeScript handler for the :w command and the VS Code command used for "File: Save without formatting"; done means :w or a clearly documented new command saves without formatting, with behavior covered by the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.