Idea-Which-Key 项目使用教程

Idea-Which-Key 项目使用教程

idea-which-keyIdeaVim extension that displays available keybindings in a popup项目地址:https://gitcode.com/gh_mirrors/id/idea-which-key

1. 项目的目录结构及介绍

Idea-Which-Key 项目的目录结构如下:

idea-which-key/
├── .github/
│   └── workflows/
├── src/
│   ├── main/
│   │   ├── kotlin/
│   │   │   └── org/
│   │   │       └── example/
│   │   │           └── whichkey/
│   │   └── resources/
│   └── test/
│       └── kotlin/
│           └── org/
│               └── example/
│                   └── whichkey/
├── .gitignore
├── LICENSE
├── README.md
└── build.gradle.kts

目录结构介绍

  • .github/workflows/: 包含 GitHub Actions 的工作流配置文件。
  • src/main/kotlin/org/example/whichkey/: 包含项目的主要 Kotlin 源代码。
  • src/main/resources/: 包含项目的资源文件。
  • src/test/kotlin/org/example/whichkey/: 包含项目的测试代码。
  • .gitignore: Git 忽略文件配置。
  • LICENSE: 项目许可证文件。
  • README.md: 项目说明文档。
  • build.gradle.kts: 项目的 Gradle 构建配置文件。

2. 项目的启动文件介绍

项目的启动文件位于 src/main/kotlin/org/example/whichkey/ 目录下。主要的启动文件是 Plugin.kt,它负责初始化插件并注册必要的组件。

package org.example.whichkey

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project

class Plugin : AnAction() {
    override fun actionPerformed(e: AnActionEvent) {
        val project: Project? = e.project
        val editor: Editor? = e.getData(CommonDataKeys.EDITOR)
        if (project != null && editor != null) {
            // 启动逻辑
        }
    }
}

3. 项目的配置文件介绍

项目的配置文件主要包括 build.gradle.ktsideavimrc

build.gradle.kts

build.gradle.kts 是 Gradle 的构建配置文件,定义了项目的依赖、插件和其他构建相关配置。

plugins {
    id("java")
    id("org.jetbrains.kotlin.jvm") version "1.5.21"
    id("org.jetbrains.intellij") version "1.1.4"
}

group = "org.example"
version = "1.0.0"

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.jetbrains.kotlin:kotlin-stdlib")
}

intellij {
    version.set("2020.3")
    type.set("IC")
    plugins.set(listOf("IdeaVim"))
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions.jvmTarget = "11"
}

ideavimrc

ideavimrc 是 IdeaVim 的配置文件,用于自定义 Vim 的行为和键绑定。

set timeoutlen=5000
let g:WhichKey_ShowVimActions = "true"
let g:WhichKey_CommandStyle = "bold"
let g:WhichKey_CommandColor = "red"

以上是 Idea-Which-Key 项目的目录结构、启动文件和配置文件的介绍。希望这份教程能帮助你更好地理解和使用该项目。

idea-which-keyIdeaVim extension that displays available keybindings in a popup项目地址:https://gitcode.com/gh_mirrors/id/idea-which-key

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

姬牧格Ivy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值