Leader key for IntelliJ-based IDE's. Now IdeaVim-friendly!

Overview

icon

Ataman

JetBrains IntelliJ Plugins jb downloads

Ataman - an elected leader of the Cossack troops and settlements

Ataman is an Intellij Idea plugin for using leader key for bindings (almost like in Spacemacs)

Rationale

Intellij Idea is notorious for its tricky keybindings involving multiple modifiers and F1-F12 keys. Another approach of using Cmd+Shift+A command pallete and search for most of the actions, reducing the speed.

There is another way, popularized by Spacemacs and Doom Emacs – leader (or sticky) keys. It works fairly simple – you choose a combination to use as a leader, e.g. Ctrl-E. After you activate leader, next keys can be simply typed one after another. For example, we can have Ctrl-E c r for opening refactoring menu and Ctrl-E c f to reformat file. With this approach keybindings are easier to type and memorize.

This approach could already be done in IntelliJ using IdeaVim and some tricks. Ataman is independent of your choice to use IdeaVim and works everywhere across Intellij

Easy setup

Install plugin from Jetbrains Marketplace (or build it yourself as shown below). In your keymap settings (Preferences -> Keymap) find and bind Ataman: Leader Key to the shortcut of your choice. When executed first time, the only binding is to open your config. Enjoy!

Advanced setup for IdeaVim users

To use leader key without modifier (e.g. to use SPACE as leader), bind your desired leader key to the Ataman: Transparent Leader Key action and add this line

:nnoremap <Space> :action LeaderAction<cr>

to your ~/.ideavimrc file. This way leader key will work unless you are entering text anywhere

Config structure

Your mappings config is located at ~/.atamanrc.config. File is in HOCON format. Suggested style is here:

bindings { # always present
  c { # tree of bindings starting with 'c'
    description: Code...
    bindings {
      # some leaves with actions to call
      r { actionId: RefactoringMenu, description: Refactor this... }
      f { actionId: ReformatCode, description: Reformat code }
      c { # you can nest arbitrary amount of tree groups
        description: Compile/Run...
        bindings { 
          a { actionId: RunAnything, description: Run Anything... }
          r { actionId: ReRun, description: Rerun last build }
        }
        # actionId: ... -- error! do not mix actionId and bindings clause together! 
      }
    }
  }
}

You can look at my own config here for more examples

Building from source

This repo uses gradle-intellij-plugin for building. To build plugin, use this command:

./gradlew buildPlugin

For more advanced usecases, please refer to gradle-intellij-plugin documentation.

License

This project is distributed under MIT License. Please refer to LICENSE.txt for details.

Comments
  • RunClass actionId weird behavior

    RunClass actionId weird behavior

    Since i've updated from PHPStorm 2021.3.3 to 2022.1 the RunClass action has different behaviour when executed through Ataman. It shows a popup instead of running the actual class or test function I'm at. When I run :action RunClass it works as expected.

    This is the popup it shows: image

    opened by megawubs 0
  • Multiple actions for one binding

    Multiple actions for one binding

    Right now, if I want to format the code and cleanup the code in PHPStorm I need to bind two keys to an action. For something like this it would be nice to be able to add a sequence of actions to one key. For example:

    f {actionIds: [ReformatCode, SilentCodeCleanup], description: Format & Cleanup }
    
    enhancement 
    opened by megawubs 1
  • Atama reload config not working

    Atama reload config not working

    When I add a new keybind and trigger the "reload ~/.atamanrc.config File" action, nothing changes. Restarting the IDE works for changing keybinds (although it’s slow).

    opened by sonofhypnos 2
  • Some chars can not be bound

    Some chars can not be bound

    First off, thanks for this awesome plugin! It has helped me embrace ideaVim completely.

    As I'm going through setting up my bindings I found out that binding some special chars does not work.

    Given the following config:

    bindings {
      "." {
        description: "+Collapse"
        bindings {
          "/" {actionId: CollapseAllRegions, description: Collapse All Regions}
          "?" {actionId: ExpandAllRegions, description: Expand All Regions}
          "." {actionId: CollapseRegion, description: Collapse region}
          ">" {actionId: ExpandRegion, description: Expand Region}
        }
      }
    }
    

    Only te . and / bindings work. > and ? are listed as a child from . but are not beging executed.

    After some testing it seems that all special chars that require me to use the shift key (except capital letters) do not work.

    I've tested ~, |, : and > But I have a hunch there are more that do not work.

    enhancement good first issue 
    opened by megawubs 1
  • Exception in the JavaScript project in IntellijIDEA

    Exception in the JavaScript project in IntellijIDEA

    java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc. at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182) at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:102) at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:784) at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:244) at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:349) at com.intellij.util.indexing.FileBasedIndexEx.processValuesInScope(FileBasedIndexEx.java:318) at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:223) at com.intellij.psi.search.FilenameIndex.getVirtualFilesByName(FilenameIndex.java:210) at com.intellij.psi.search.FilenameIndex.getVirtualFilesByName(FilenameIndex.java:57) at com.intellij.lang.typescript.psi.TypeScriptDeclarationMappingsImpl.getFilesByName(TypeScriptDeclarationMappingsImpl.java:365) at com.intellij.lang.typescript.psi.TypeScriptDeclarationMappingsImpl.getDeclarationFileCandidatesByName(TypeScriptDeclarationMappingsImpl.java:349) at com.intellij.lang.typescript.psi.TypeScriptDeclarationMappingsImpl.getDeclarationElements(TypeScriptDeclarationMappingsImpl.java:104) at com.intellij.lang.javascript.findUsages.JavaScriptFindUsagesHandlerFactory.createFindUsagesHandler(JavaScriptFindUsagesHandlerFactory.java:119) at com.intellij.find.findUsages.FindUsagesHandlerFactory.createFindUsagesHandler(FindUsagesHandlerFactory.java:28) at com.intellij.find.findUsages.FindUsagesManager.getFindUsagesHandler(FindUsagesManager.java:160) at com.intellij.find.findUsages.FindUsagesManager.findUsages(FindUsagesManager.java:192) at com.intellij.find.impl.FindManagerImpl.findUsages(FindManagerImpl.java:916) at com.intellij.find.impl.FindManagerImpl.findUsages(FindManagerImpl.java:906) at com.intellij.find.actions.FindUsagesAction.startFindUsages(FindUsagesAction.java:65) at com.intellij.find.actions.FindUsagesAction$1.handlePsi(FindUsagesAction.java:58) at com.intellij.find.actions.PsiTargetVariant.handle(resolver.kt:73) at com.intellij.find.actions.ResolverKt.findShowUsages(resolver.kt:51) at com.intellij.find.actions.FindUsagesAction.actionPerformed(FindUsagesAction.java:44) at io.github.mishkun.ataman.LeaderListStep.executeAction(AtamanAction.kt:157) at io.github.mishkun.ataman.LeaderListStep.onChosen$lambda-0(AtamanAction.kt:119) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$18(AbstractPopup.java:1511) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1508) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:164) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326) at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:136) at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:166) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:169) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:157) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:268) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:270) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:433) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:405) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:356) at io.github.mishkun.ataman.LeaderPopup$1$1.actionPerformed(AtamanAction.kt:180) at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:380) at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:365) at com.intellij.ui.popup.PopupDispatcher.dispatchKeyEvent(PopupDispatcher.java:112) at com.intellij.ui.popup.PopupDispatcher.dispatch(PopupDispatcher.java:148) at com.intellij.ide.IdePopupManager.dispatch(IdePopupManager.java:101) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:724) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

    bug 
    opened by Ed-Pavlov 0
  • Make config parsing exceptions more user-friendly

    Make config parsing exceptions more user-friendly

    Accidentely closed an IDE when config file has invalid state, on opening a project got this exception and plugin won't work.

    java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String at io.github.mishkun.ataman.AtamanConfig.buildBindingsTree(AtamanConfig.kt:107) at io.github.mishkun.ataman.AtamanConfig.updateConfig(AtamanConfig.kt:56) at io.github.mishkun.ataman.PluginStartup.runActivity(AtamanConfig.kt:19) at com.intellij.ide.startup.impl.StartupManagerImpl.runStartupActivity(StartupManagerImpl.kt:311) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration(StartupManagerImpl.kt:292) at com.intellij.ide.startup.impl.StartupManagerImpl.runActivityAndMeasureDuration$default(StartupManagerImpl.kt:287) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1$1.run(StartupManagerImpl.kt:247) at com.intellij.openapi.project.DumbServiceImpl.runWithWaitForSmartModeDisabled(DumbServiceImpl.java:645) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:246) at com.intellij.ide.startup.impl.StartupManagerImpl$runPostStartupActivities$1.accept(StartupManagerImpl.kt:61) at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processWithPluginDescriptor(ExtensionPointImpl.java:299) at com.intellij.openapi.extensions.ExtensionPointName.processWithPluginDescriptor(ExtensionPointName.java:144) at com.intellij.ide.startup.impl.StartupManagerImpl.runPostStartupActivities(StartupManagerImpl.kt:241) at com.intellij.ide.startup.impl.StartupManagerImpl.access$runPostStartupActivities(StartupManagerImpl.kt:61) at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3$1.run(StartupManagerImpl.kt:190) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:255) at com.intellij.ide.startup.impl.StartupManagerImpl$projectOpened$3.run(StartupManagerImpl.kt:190) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

    enhancement 
    opened by Ed-Pavlov 3
Owner
Mikhail Levchenko
Android dev @ Auto.ru
Mikhail Levchenko
IntelliJ-based IDEs Protobuf Language Plugin that provides Protobuf language support.

IntelliJ Protobuf Language Plugin Reference Inspired by protobuf-jetbrains-plugin and intellij-protobuf-editor. Descriptor IntelliJ-based IDEs Protobu

Kanro 72 Dec 7, 2022
Plugin for IntelliJ-based IDEs folding root files in the ProjectView

Foldable ProjectView The Foldable ProjectView is a plugin for the IntelliJ-based IDEs that lets you fold files located in the root of your project. Av

Jakub Chrzanowski 47 Dec 13, 2022
Review crates with cargo-crev in IntelliJ IDEs

IntelliJ Crev Cargo crates review support using cargo-crev Installation Using IDE built-in plugin system: Settings/Preferences > Plugins > Marketplace

Aleksei Trifonov 4 Dec 31, 2021
IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea

IntelliJ Idea Astor Plugin IntelliJ Idea Astor Plugin is a plugin that integrates Astor in Intellij Idea. It communicates with a local/remote program

null 4 Aug 28, 2021
Intellij-platform-plugin-template - IntelliJ Platform Plugin Template

IntelliJ Platform Plugin Template TL;DR: Click the Use this template button and

null 0 Jan 1, 2022
Kirill Rakhman 4 Sep 15, 2022
Add Mac tabbing options to Jetbrains IDEs

IDEA Mac Tabbing Add Mac tabbing options to Jetbrains IDEs: Show Previous Window Tab Show Next Window Tab Move Window Tab to New Window Merge All Wind

DCat 29 Sep 4, 2022
Dark theme for JetBrains IDEs :]

?? Hoshi Theme Dark theme for JetBrains IDEs. :] Screenshots Installation Using IDE built-in plugin system: Settings/Preferences > Plugins > Marketpla

luciano ratamero 3 Jun 23, 2022
IntelliJ Plugin for Android Parcelable boilerplate code generation.

IntelliJ/Android Studio Plugin for Android Parcelable boilerplate code generation This tool generates an Android Parcelable implementation based on fi

Michał Charmas 2.1k Dec 27, 2022
A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development.

ADB Idea A plugin for Android Studio and Intellij IDEA that speeds up your day to day android development. The following commands are provided: Uninst

Philippe Breault 2k Dec 28, 2022
IntelliJ / Android Studio plugin for Android Holo Colors

This project is not maintained anymore. Holo Colors doesn't make sense since the introduction of Material Design and the ability to set the primary co

Jérôme Van Der Linden 644 Nov 10, 2022
eventbus-intellij-plugin 3.8 0.0 L1 Java Plugin to navigate between events posted by EventBus.

eventbus-intellij-plugin Plugin to navigate between events posted by EventBus. Post to onEvent and onEvent to Post Install There are two ways. Prefere

Shinnosuke Kugimiya 315 Aug 8, 2022
Android Studio & IntelliJ Plugin for sort xml by name="xxx".

AndroidXmlSorter Android Studio & IntelliJ Plugin for sort xml by name="xxx". Options Insert space between difference prefix ('Snake Case', 'Camel Cas

Kaoru Tsutsumishita 102 Nov 29, 2022
An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play.

DroidLane An Android Studio / IntelliJ plug-in help you upload your apk or listing to Google Play. Installation Open Android Studio or IntelliJ IDEA O

Jintin 24 Jul 26, 2021
IntelliJ plugin that provides some useful utilities to support the daily work with Gradle.

IntelliJ Gradle Utilities Plugin This IntelliJ plugin provides some useful utilities to support the daily work with Gradle. It's available on the offi

Marcel Kliemannel 6 Jul 29, 2022
IntelliJ plugin that provides a modern and powerful byte code analyzer tool window.

IntelliJ Byte Code Analyzer Plugin This IntelliJ plugin provides a modern and powerful byte code analyzer tool window. Its supports Java, Kotlin, Groo

Marcel Kliemannel 29 Nov 9, 2022
✈️ IDE plugin for the IntelliJ platform which adds GitHub Copilot support. (VERY WIP)

JetBrains Copilot GitHub Copilot support for the IntellIJ Platform. Installation Download the latest release. Select the Install Plugin from Disk opti

Koding 155 Dec 10, 2022
A plugin that adds support for rs2asm files to IntelliJ.

Rs2Asm This plugin adds some simple features when interacting with rs2asm files. Features Syntax highlighting Autocompletion for label names and instr

Joshua Filby 3 Dec 16, 2021
A simple IntelliJ project to demonstrate exception handling in coroutines

ExceptionHandling A simple IntelliJ project to demonstrate exception handling in coroutines NB:** launch coroutine builder type exceptions cannot be h

Felix Nzioki Savali 0 Nov 9, 2021