Skip to content

Quickly format a file opened in vim with npx and prettier with 0 install.#31

Description

@alvaropinot

Just share this trick for formatting code inside vim with npx and prettier

Quickly format a file opened in vim with npx and prettier with 0 install.

:%! npx -q prettier

Here is how it works 馃憞

% 鉃★笍 use the actual file
! 鉃★笍 execute any command
npx -q prettier 鉃★笍 -q makes npx run is silent mode avoiding extra output

vim npx prettier

Is there any way to add it to awesome-npx? (If you consider it interesting of course 馃槄) I could write a small article if needed 馃槃 Here the tweet 馃憞 https://twitter.com/AlvaroPinot/status/998117748893863937

This makes me think if npx should be running in quite mode by default. What do you think @zkat?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions