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 插件
- Host: GitHub
- URL: https://github.com/m1dsolo/chinese-formatter.nvim
- Owner: m1dsolo
- License: mit
- Created: 2025-02-17T16:34:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-17T16:44:14.000Z (over 1 year ago)
- Last Synced: 2025-05-16T16:50:32.807Z (about 1 year ago)
- Topics: lua, neovim, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chinese Formatter
一个用于美化中英文混排文本的 Neovim 插件

## 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