# vim4arkts **Repository Path**: wolfx/vim4arkts ## Basic Information - **Project Name**: vim4arkts - **Description**: vim支持ArkTS语言语法高亮的脚本 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-03-23 - **Last Updated**: 2026-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vim4ArkTS Vim 支持 ArkTS 编程语言语法高亮的插件。 ## 功能特性 - 自动识别 `.ets` 文件类型 - 基于 TypeScript 语法扩展,继承 TypeScript 基础语法 - 支持 ArkTS 特有语法高亮: - 变量声明:`let`、`const`、`var` - 类型定义:`string`、`number`、`boolean`、`void` 等 - 装饰器:`@Entry`、`@Component`、`@State`、`@Prop`、`@Link`、`@BuilderParam` 等 - 类与对象:`class`、`constructor`、`extends`、访问修饰符 - 模块导入导出:`export`、`import`、`as` - ArkTS 特有操作符:`|`、`:>` ## 安装 ### 手动安装 将项目克隆到 Vim 的配置目录: ```bash # Linux / macOS git clone https://gitee.com/wolfx/vim4arkts.git ~/.vim/pack/plugins/start/vim4arkts # Windows (PowerShell) git clone https://gitee.com/wolfx/vim4arkts.git $HOME/vimfiles/pack/plugins/start/vim4arkts ``` ### vim-plug ```vim Plug 'git@gitee.com:wolfx/vim4arkts.git' " vim4arkts ``` ## 依赖 - Vim 8.0+ 或 Neovim - TypeScript 语法文件(Vim 自带或通过 `typescript-vim` 插件安装) ## 文件结构 ``` vim4arkts/ ├── ftdetect/ │ └── arkts.vim # 文件类型检测 ├── syntax/ │ └── arkts.vim # 语法高亮定义 ├── LICENSE # MIT 许可证 └── README.md # 说明文档 ``` ## 使用示例 打开任意 `.ets` 文件即可自动启用 ArkTS 语法高亮: ```arkts @Entry @Component struct HelloWorld { @State message: string = 'Hello ArkTS' build() { Column() { Text(this.message) .fontSize(20) } } } ``` ## 许可证 [MIT License](LICENSE)