diff --git a/CHANGELOG.md b/CHANGELOG.md index 248eb6b..aa0dc5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,14 @@ ## [Unreleased] +### Added +- Support all IntelliJ Platform-Based IDEs. +- Support format in commit message. +- Support format in Reformat Code Action and Reformat Commit Message Action. +- Change the keyboard shortcut because it conflicts with "Commit and Push" while using the non-model commit interface in Version Control. + ## [1.0.0] -### Added -- Spacing selected content. +### Added +- Spacing selected content. - Spacing whole file. diff --git a/DESCRIPTION.md b/DESCRIPTION.md index 09a76ed..d0895c7 100644 --- a/DESCRIPTION.md +++ b/DESCRIPTION.md @@ -1,28 +1,74 @@ Automatically inserts whitespace between CJK (Chinese, Japanese, Korean), half-width English, digit, and symbol characters. -When you select some text, the plugin will only space the selected text. +## Usage + +You can use this plugin to spacing content in editor and commit message. + +### In Editor +When you select some text in editor, the plugin will only space the selected text. Otherwise, it will space the whole file. -### Usage -There are three ways to use this plugin to spacing: -- See editor popup menu > Pangu Format. -- See Tools > Pangu Format. -- Use ⌥ + . / Alt + . . +There are three ways to use: +- See editor popup menu > Pangu Format + +- Use Alt + . / ⌥ + . + +- Use Reformat Code Action (Ctrl + Alt + L / ⌘ + ⌥ + L by default) + + Pangu Format Action will perform after internal Reformat Code Action. + + You can disable this feature in Settings/Preferences > Tools > Pangu + +### In Commit message + +There are also three ways to use this plugin in commit message: + +- Click the Pangu Format icon besides the commit message text area. + +- Use Alt + . / ⌥ + . + +- Use Reformat Commit Message Action (Ctrl + Alt + L / ⌘ + ⌥ + L by default) + + Pangu Format Action will perform after internal Reformat Commit Message action. + If you find something is not working or missing, feel free to submit an issue on [GitHub repo](https://github.com/LiLittleCat/intellij-pangu). --- +
自动在 CJK(中文、日文、韩文)、英文、数字和符号之间插入空格。 +## 使用 + +你可以使用这个插件对编辑器中的文本和提交信息里的文本进行空格插入格式化。 + +### 编辑器中的文本 + 当你在文件中选中部分内容时,该插件只会在选中的部分进行空格插入。 没有选中时,该插件会在当前文件的所有文本进行空格插入。 -### 使用方法 -有三种方式使用此插件: -- 在编辑时右键弹出菜单中使用 > Pangu Format。 -- 使用 Tools > Pangu Format。 -- 使用快捷键 ⌥ + ⇧ + P / Alt + Shift + P。 +有三种使用方式: + +- 在编辑时右键弹出菜单中使用 Pangu Format +- 使用快捷键 Alt + . / ⌥ + . +- 使用软件自带格式化代码功能(默认快捷键:Ctrl + Alt + L / ⌘ + ⌥ + L) + + 插件会在自带格式化代码功能之后执行空格插入。 + + 你可以在 Settings/Preferences > Tools > Pangu 关闭此功能: + +### 提交信息中的文本 + +同样有三种方式: + +- 点击提交信息旁边的图标 + +- 使用快捷键 Alt + . / ⌥ + . + +- 使用软件自带格式化提交信息功能(默认快捷键:Ctrl + Alt + L / ⌘ + ⌥ + L) + + 插件会在自带格式化提交信息功能之后执行空格插入。 有任何问题或者建议,欢迎在 [GitHub repo](https://github.com/LiLittleCat/intellij-pangu) 提交 issue。 diff --git a/README.md b/README.md index 2123fbf..d53a4c7 100644 --- a/README.md +++ b/README.md @@ -42,19 +42,43 @@ Here are some examples: Settings/Preferences > Plugins > ⚙️ > Install plugin from disk... ## Usage -When you select some text, the plugin will only space the selected text. + +You can use this plugin to spacing content in editor and commit message. + +### In Editor +When you select some text in editor, the plugin will only space the selected text. Otherwise, it will space the whole file. -There are three ways to use this plugin to spacing: -- See editor popup menu > Pangu Format. +There are three ways to use: +- See editor popup menu > Pangu Format ![EditorPopupMenu](example/EditorPopupMenu.png) -- See Tools menu > Pangu Format. +- Use Alt + . / ⌥ + . + +- Use Reformat Code Action (Ctrl + Alt + L / ⌘ + ⌥ + L by default) + + Pangu Format Action will perform after internal Reformat Code Action. + + You can disable this feature in Settings/Preferences > Tools > Pangu + + ![Setting](example/Setting.png) + + +### In Commit message + +There are also three ways to use this plugin in commit message: + +- Click the Pangu Format icon besides the commit message text area. + + ![CommitMessage](example/CommitMessage.png) + +- Use Alt + . / ⌥ + . + +- Use Reformat Commit Message Action (Ctrl + Alt + L / ⌘ + ⌥ + L by default) - ![Tools](example/Tools.png) + Pangu Format Action will perform after internal Reformat Commit Message action. -- Use ⌥ + . / Alt + . . ## Thanks @@ -66,4 +90,4 @@ There are three ways to use this plugin to spacing: [XiaoYao's link]: https://space.bilibili.com/15765234 [template]: https://github.com/JetBrains/intellij-platform-plugin-template [vinta]: https://github.com/vinta -[pangu.js]: https://github.com/vinta/pangu.js +[pangu.js]: https://github.com/vinta/pangu.js \ No newline at end of file diff --git a/README_CN.md b/README_CN.md index 7899e4e..04ae49c 100644 --- a/README_CN.md +++ b/README_CN.md @@ -42,19 +42,42 @@ ## 使用 +你可以使用这个插件对编辑器中的文本和提交信息里的文本进行空格插入格式化。 + +### 编辑器中的文本 + 当你在文件中选中部分内容时,该插件只会在选中的部分进行空格插入。 没有选中时,该插件会在当前文件的所有文本进行空格插入。 有三种使用方式: -- 在编辑时右键弹出菜单中使用 Pangu Format。 +- 在编辑时右键弹出菜单中使用 Pangu Format ![EditorPopupMenu](example/EditorPopupMenu.png) -- 在 Tools 中使用 Pangu Format。 +- 使用快捷键 Alt + . / ⌥ + . + +- 使用软件自带格式化代码功能(默认快捷键:Ctrl + Alt + L / ⌘ + ⌥ + L) + + 插件会在自带格式化代码功能之后执行空格插入。 + + 你可以在 Settings/Preferences > Tools > Pangu 关闭此功能: + + ![Setting](example/Setting.png) + + +### 提交信息中的文本 + +同样有三种方式: + +- 点击提交信息旁边的图标 + + ![CommitMessage](example/CommitMessage.png) + +- 使用快捷键 Alt + . / ⌥ + . - ![Tools](example/Tools.png) +- 使用软件自带格式化提交信息功能(默认快捷键:Ctrl + Alt + L / ⌘ + ⌥ + L) -- Use ⌥ + . / Alt + . 。 + 插件会在自带格式化提交信息功能之后执行空格插入。 ## 致谢 diff --git a/example/CommitMessage.png b/example/CommitMessage.png new file mode 100644 index 0000000..f062d15 Binary files /dev/null and b/example/CommitMessage.png differ diff --git a/example/EditorPopupMenu.png b/example/EditorPopupMenu.png index bd4223c..86afcbf 100644 Binary files a/example/EditorPopupMenu.png and b/example/EditorPopupMenu.png differ diff --git a/example/Setting.png b/example/Setting.png new file mode 100644 index 0000000..9e8ef75 Binary files /dev/null and b/example/Setting.png differ diff --git a/example/Tools.png b/example/Tools.png deleted file mode 100644 index 3a5be85..0000000 Binary files a/example/Tools.png and /dev/null differ diff --git a/gradle.properties b/gradle.properties index 7e1cd6d..b0c3a5f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = com.lilittlecat.plugin.intellij-pangu pluginName = Pangu # SemVer format -> https://semver.org -pluginVersion = 1.0.0 +pluginVersion = 1.1.0 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. @@ -13,8 +13,8 @@ pluginUntilBuild = 222.* # IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties platformType = IC -platformVersion = 193.5233.102 -#platformVersion = 2022.1 +#platformVersion = 193.5233.102 +platformVersion = 2022.1 # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 8624792..cc7a244 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -12,7 +12,7 @@