An open API service indexing awesome lists of open source software.

https://github.com/m1dsolo/chinese-formatter.nvim

用于美化中英文混排文本的 Neovim 插件
https://github.com/m1dsolo/chinese-formatter.nvim

lua neovim neovim-plugin nvim nvim-plugin

Last synced: about 1 month ago
JSON representation

用于美化中英文混排文本的 Neovim 插件

Awesome Lists containing this project

README

          

# Chinese Formatter

一个用于美化中英文混排文本的 Neovim 插件

![chinese_formatter_format](https://github.com/user-attachments/assets/6fc4e29f-9233-4142-94d0-c71af5798390)

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Contributing](#contributing)
- [License](#license)

## Features

- 自动调整中文和英文之间的空格。
- 自动调整中文和数字之间的空格。

## Installation

使用 [lazy.nvim](https://github.com/folke/lazy.nvim)。

```lua
return {
"m1dsolo/chinese-formatter.nvim",
lazy = true,
ft = "markdown",
opts = {
auto_format_on_save = true,
space_between_zh_and_en = true,
space_between_zh_and_num = true,
space_between_sym_and_link = true,
space_between_sym_and_pic = true,
},
}
```

## Usage

当你设置 `auto_format_on_save` 为 `true` 时,
这个插件自动会在你保存文件时自动格式化文本。

如果你想手动格式化文本,可以使用 `ChineseFormatterFormat` 命令。

## Contributing

目前这个插件主要是为了解决个人写博客时遇到的排版问题,所以功能比较简单。

如果你有更好的想法或者建议,欢迎提 issue 或者 pr 。

## License

[MIT](LICENSE) © m1dsolo