Skip to content
master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
May 14, 2021

fmt.vim

Generic code formatting interface for Vim

Installation

Install aonemd/fmt.vim using a plugin manger such as: vim-plug, NeoBundle, Vundle, or Pathogen.

Usage

The plugin provides the command: Fmt that delegates the auto-formatting to a formatter. Currently, these formatters are used:

Language Formatter Command used
Rust rustfmt rustfmt
Go gofmt gofmt -w
C clang-format clang-format -i -style=google
C++ clang-format clang-format -i -style=google
JavaScript prettier prettier --write
TypeScript prettier prettier --write
Ruby rufo rufo

User-defined commands can be used through the global variable g:fmt_commands which overwrites the default commands above.

In order to use auto-formatting on buffer saving, you can add the following to ~/.vimrc:

autocmd! BufWrite * Fmt

License

See LICENSE.

About

Generic code formatting interface for Vim

Topics

Resources

License

Releases

No releases published

Packages

No packages published