Giter Club home page Giter Club logo

ataman-intellij's Introduction

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 these lines

nnoremap <Space> :action LeaderAction<cr>
vnoremap <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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.