Skip to content

Commit

Permalink
Clean up and add new keybindings from latest keymap
Browse files Browse the repository at this point in the history
Long term cleanup tasks:
- Upgrade from Gradle 5.2.1 to 6.6.1
- Start refactor of build script
- Remove gradle.properties from gitignore and add props
- Add real changelog
- Add FAQs and more detailed keybinding information
  • Loading branch information
samvtran committed Sep 24, 2020
1 parent ccccc04 commit 591882c
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 109 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
build
.idea
.gradle
gradle.properties
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [Unreleased]
### Added

### Changed

### Deprecated

### Removed

### Fixed

### Security
## [2.0.0]
### Added
- Updated to match latest keymap as of [367cd5f](https://github.com/JetBrains/intellij-community/blob/fb0eb45e7d27dffbb490030c623bcf65eb402aeb/platform/platform-resources/src/keymaps/Mac%20OS%20X%2010.5%2B.xml).
- Support new commit tool window (`Alt-0` when commit is active)
### Removed
- `ActivateTODOToolWindow` removed from keymap as of [b6eda](https://github.com/JetBrains/intellij-community/commit/24fe6c91cc91d51a2042737e9b7d01dd94305943#diff-8d8929a05e92b93072513b4727735c81) to make room for the Problems view.
### Fixed
- Keymap range set to 2020.2.* and beyond (no `untilBuild`)
- `NextSplitter` and `PrevSplitter` updated to prevent conflicts with Alt-Tab
96 changes: 77 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
# JetBrains macOS Keymap for Windows and Linux

![JetBrains IntelliJ Plugins](https://img.shields.io/jetbrains/plugin/v/13968-macos-for-all?style=for-the-badge)

[Cheatsheet](Keymap-macOS%20For%20All.pdf)

This repo converts the lovely Mac OS X 10.5+ keymap in JetBrains
IDEs from macOS-specific bindings to ones without `meta` (i.e., the Command/splat/cloverleaf interchange from hell).

While some keybindings are close to their original, others have more modifier keys or different bindings altogether to avoid clashing.
While some keybindings are close to their original, others have more modifier keys or different bindings altogether to avoid conflicts.

## Build
Follow JetBrain's [guide](https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html) for using Gradle for plugins development.
Follow JetBrain's [guide](https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system/prerequisites.html) for using Gradle for plugin development.

## Installation

Install the plugin from the [plugin marketplace](https://plugins.jetbrains.com/plugin/13968-macos-for-all) or
grab the zip file from the [latest release](https://github.com/samvtran/jetbrains-macos-keybindings-for-all/releases/latest) and install manually.

## Release
For release tasks, the INTELLIJ_PUBLISH_TOKEN environment variable should be available.

## Issues
If you notice any issues, please report them [here](https://github.com/samvtran/jetbrains-macos-keybindings-for-all/issues/new)!

## Key Updates

| Actions | Mac OS X 10.5+ Keybindings | New Keybindings |
| --: | -- | -- |
| ActivateMessageToolWindow | `Command-0` | `Alt-0` |
| ActivateProjectToolWindow | `Command-1` | `Alt-1` |
| ActivateFavoritesToolWindow | `Command-2` | `Alt-2` |
| ActivateFindToolWindow | `Command-3` | `Alt-3` |
| ActivateRunToolWindow | `Command-4` | `Alt-4` |
| ActivateDebugToolWindow | `Command-5` | `Alt-5` |
| ActivateTODOToolWindow | `Command-6` | `Alt-6` |
| ActivateProblemsViewToolWindow | `Command-6` | `Alt-6` |
| ActivateStructureToolWindow | `Command-7` | `Alt-7` |
| ActivateHierarchyToolWindow | `Command-8` | `Alt-8` |
| ActivateServicesToolWindow | `Command-8` | `Alt-8` |
| ActivateVersionControlToolWindow | `Command-9` | `Alt-9` |
| ActivateCommitToolWindow | `Command-0` | `Alt-0` |
| Back | `Command-[` <br> `Command-Alt-Left` | `Control-[` |
| ChangesView.Move | `Command-Shift-M` | `Control-Shift-M` |
| ChooseDebugConfiguration | `Control-Alt-D` | `Control-Alt-Shift-D` |
| ChooseRunConfiguration | `Control-Alt-R` | `Control-Alt-Shift-R` |
| CloseContent | `Command-W` | `Control-W` |
| ContextHelp | `Command-Shift-F1` | `Control-Shift-F1` |
| Debug | `Control-D` | `Control-Alt-D` |
| Diff.NextChange | `Command-Shift-]`<br>`Control-Right` | `Control-Shift-]` |
| Diff.PrevChange | `Command-Shift-[`<br>`Control-Left` | `Control-Shift-[` |
Expand Down Expand Up @@ -73,37 +79,37 @@ If you notice any issues, please report them [here](https://github.com/samvtran/
| GotoClass | `Command-O` | `Control-O` |
| GotoFile | `Command-Shift-O` | `Control-Shift-O` |
| GotoLine | `Command-L` | `Control-L` |
| GotoNextElementUnderCaretUsage | `Control-Alt-Down` | `Alt-Shift-Down` |
| GotoPrevElementUnderCaretUsage | `Control-Alt-Up` | `Alt-Shift-Up` |
| GotoRelated | `Control-Meta-Up` | `Control-Shift-Up` |
| GotoRelated | `Control-Meta-Up` | `Control-Alt-Home` |
| GotoSymbol | `Command-Alt-O` | `Control-Alt-O` |
| GoToTypeDeclaration | `Command-Shift-B` <br> `Control-Shift-B` <br> `Command-Shift-button1` | `Control-Shift-B` <br> `Control-Shift-button` |
| GotoTypeDeclaration | `Command-Shift-B` <br> `Control-Shift-B` <br> `Command-Shift-button1` | `Control-Shift-B` <br> `Control-Shift-button` |
| MethodDown | `Control-Down` | `Control-Alt-Down` |
| MethodUp | `Control-Up` | `Control-Alt-Up` |
| MinimizeCurrentWindow | `Command-M` | `Control-M` |
| NewElement | `Command-N` | `Control-N` |
| NewScratchFile | `Command-Shift-N` | `Control-Shift-N` |
| NextEditorTab | `Control-Shift-Right` | `Control-Alt-Shift-Right` |
| NextProjectWindow | ``Command-Alt-` `` | ``Control-Alt-` `` |
| NextTag | `Command-Shift-]`<br>`Control-Right` | `Control-Shift-]` |
| NextSplitter | `Alt-Tab` | `Control-Alt-Left` |
| NextTab | `Command-Shift-]`<br>`Control-Right` | `Control-Shift-]` |
| OptimizeImports | `Control-Alt-O` | `Control-Alt-Shift-O` |
| OverrideMethods | `Control-O` | `Alt-Shift-O` |
| PreviousEditorTab | `Control-Shift-Left` | `Control-Alt-Shift-Left` |
| PreviousProjectWindow | ``Command-Alt-Shift-` `` | ``Control-Alt-Shift-` `` |
| PreviousSplitter | `Alt-Shift-Tab` | `Control-Alt-Right` |
| PreviousTab | `Command-Shift-[`<br>`Control-Left` | `Control-Shift-[` |
| QuickImplementations | `Command-Y` | `Control-Y` |
| Refresh | `Command-R` | `Control-R` |
| Refresh | `Command-R` | `Control-R` <br> `Control-F5` |
| ReplaceInPath | `Command-Shift-R` | `Control-Shift-R` |
| Rerun | `Command-R` | `Control-R` |
| Run | `Control-R` | `Control-Alt-R` |
| RunClass | `Control-Shift-R` | `Control-Shift-C` |
| RunDashboard.ShowConfigurations | `Command-Shift-T` | `Control-Shift-T` |
| ServiceView.ShowServices | `Command-Shift-T` | `Control-Shift-T` |
| SafeDelete | `Command-Delete` | `Control-Delete` |
| SearchEverywhere.NavigateToNextGroup | `Command-Down` | `Control-Down` |
| SearchEverywhere.NavigateToPrevGroup | `Command-Up` | `Control-Up` |
| SelectAllOccurrences | `Command-Control-G` | `Control-Alt-Shift-G` |
| ShowBookmarks | `Command-F3` | `Control-F3` |
| ShowContent | `Control-Down` | `Control-Shift-Down` |
| ShowContent | None | `Control-Shift-Down` |
| ShowNavBar | `Command-Up` | `Control-Up` |
| ShowProjectStructureSettings | `Command-;` | `Control-;` |
| ShowSettings | `Command-,` | `Control-,` |
Expand All @@ -120,20 +126,72 @@ If you notice any issues, please report them [here](https://github.com/samvtran/
## Removed Keybindings

| Actions | Mac OS X 10.5+ Keybindings | Alternatives |
| -- | -- | -- |
| $Delete | `Command-Backspace` | Just backspace... |
| ActivateVersionControlToolWindow | `Command-Shift-9` | `Control-Alt-9` |
| --: | -- | -- |
| $Delete | `Command-Backspace` | Just backspace |
| Back | `Command-Alt-Left` | `Control-[` |
| CommentByBlockComment | `Command-Alt-/` <br> `Command-Shift-/` | `Control-Shift-/` |
| EditorDown | `Control-N` | `Down` |
| EditorLeft | `Control-B` | `Left` |
| EditorLineEnd | `Control E` | `Control-Right` <br> `End` |
| EditorLineEnd | `Control-E` | `Control-Right` <br> `End` |
| EditorLineStart | `Control-A` | `Control-Left` <br> `Home` |
| EditorPreviousWord | `Control-Alt-B` | `Alt-Left` |
| EditorPreviousWordWithSelection | `Control-Alt-Shift-B` | `Alt-Shift-Left` |
| EditorNextWord | `Control-Alt-F` | `Alt-Right` |
| EditorNextWordWithSelection | `Control-Alt-Shift-F` | `Alt-Shift-Right` |
| EditorRight | `Control-F` | `Right` |
| EditorToggleColumnMode | `Command-Shift-NumPad[*]` | `Control-Alt-Shift-8` |
| EditorUp | `Control-P` | `Up` |
| FindNext | `Control-L` | `F3` |
| FindPrevious | `Control-Shift-L` | `Shift-F3` |
| RerunTests | `Command-Control-R` | `Shift-Alt-R` |
| Forward | `Command-Alt-Right` | `Control-]`
| RerunTests | `Command-Control-R` | `Alt-Shift-R` |
| Resume | `Command-Alt-R` | `F9` |
| Vcs.ShowMessageHistory | `Control-M` | `Control-E` |
| Vcs.ShowMessageHistory | `Control-M` | `Control-E` |

## Default Implicit Keybindings
These keybindings are set by the [`$default`](https://github.com/JetBrains/intellij-community/blob/master/platform/platform-resources/src/keymaps/%24default.xml) keymap
and are, therefore, not included even though the Mac OS X 10.5+ keymap may define them explicitly.

| Actions | Mac OS X 10.5+ Keybindings | $default Keybindings |
| --: | -- | -- |
| ChangesView.GroupBy.Directory | `Control-P` | `Control-Alt-P` |
| ChangesView.GroupBy.Module | `Control-M` | `Control-Alt-M` |
| Diff.ApplyLeftSide | `Control-Shift-Right` | `Alt-Shift-Right` |
| Diff.ApplyRightSide | `Control-Shift-Left` | `Alt-Shift-Left` |
| ForceRefresh | `Command-Alt-Shift-R` | `Control-Shift-F5` |
| GoToDeclaration | `Command-B` <br> `Command-click` <br> `Middle click` <br> Force touch | `Control-B` <br> `Control-click` |
| RunToCursor | `Alt-F9` <br> Force touch | `Alt-F9` |
| ServiceView.GroupByContributor | `Control-T` | `Control-Alt-T` |
| ServiceView.GroupByServiceGroups | `Control-P` | `Control-Alt-P` |
| TodoViewGroupByShowModules | `Control-M` | `Control-Alt-M` |
| TodoViewGroupByShowPackages | `Control-P` | `Control-Alt-P` |
| TodoViewGroupByFlattenPackage | `Control-F` | `Control-Alt-C` |
| ToggleAmendCommitMode | `Control-Alt-M` | `Alt-M` |
| ToggleFindInSelection | `Control-Alt-E` | `Control-Alt-E` |
| UsageGrouping.Module | `Control-M` | `Control-Alt-M` |
| UsageGrouping.Directory | `Control-P` | `Control-Alt-P` |
| UsageGrouping.UsageType | `Control-T` | `Control-Alt-T` |
| UsageGrouping.FlattenModules | `Control-O` | `Control-Alt-O` |
| UsageGrouping.FileStructure | `Control-F` | `Control-Alt-F` |
| UsageGrouping.DirectoryStructure | `Control-D` | `Control-Alt-D` |

## Missing/no-op Keybindings
This list may change over time.

| Actions | Keybindings | Reason |
| --: | -- | -- |
| PrevWindow/NextWindow | ``Command+Shift+` ``/``Command+` `` | Workaround for [platform-specific issues](https://youtrack.jetbrains.com/issue/IDEA-217613). For Linux, use ``Alt-` `` for supported WMs. For Windows, try something like [this AutoHotKey script](https://gist.github.com/samvtran/3b11cdb829ea5da9f166591752123816) for similar behavior. |
| EmojiAndSymbols | `Command-Control-Space` | This is rebound to `Control-Alt-Shift-Space` but [does not function outside macOS](https://github.com/JetBrains/intellij-community/blob/b69a466631b01c408897e1b9f4159f6632470a0b/platform/platform-impl/src/com/intellij/ide/actions/MacEmojiAndSymbolsInputAction.java). For Windows, use `Super+;` or `Super+.` to activate the built-in emoji picker. |


## FAQ
### Oh no! My favorite keybinding changed after an update! What do I do?
This project tries to follow the Mac OS X 10.5+ keybindings as closely as possible.
As new UI elements and IDE features are added, JetBrains may add and remove keybindings to
better match their evolving feature set. If you find that your muscle memory is getting in the way
of a new binding, make a copy of this keymap for your own custom shortcuts.

### I just switched from macOS to Linux/Windows. What can I do to make the transition easier?
Use a plugin like [Presentation Assistant](https://plugins.jetbrains.com/plugin/7345-presentation-assistant)
or [Key Promoter X](https://plugins.jetbrains.com/plugin/9792-key-promoter-x) to help you learn new
shortcuts.
93 changes: 57 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@

import org.jetbrains.intellij.tasks.PublishTask

plugins {
id("org.jetbrains.intellij") version "0.4.16"
}

group = "com.samvtran"
version = "1.0.2"

repositories {
mavenCentral()
}

dependencies {
testCompile("junit", "junit", "4.12")
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version = "2019.3.3"
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.getByName<org.jetbrains.intellij.tasks.PatchPluginXmlTask>("patchPluginXml") {
changeNotes("""
<ul>
<li>Increasing supported IDE range from 2019.* to 2017 to 2020+</li>
</ul>""")
sinceBuild("173.*")
untilBuild("202.*")
}
tasks.withType<PublishTask> {
token(findProperty("intellijPublishToken"))
}
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML

plugins {
id("org.jetbrains.intellij") version "0.4.26"
id("org.jetbrains.changelog") version "0.5.0"
}

val pluginGroup: String by project
val pluginName_: String by project
val pluginVersion: String by project

val platformVersion: String by project

group = pluginGroup
version = pluginVersion

buildscript {
repositories {
// Workaround: https://github.com/JetBrains/gradle-intellij-plugin/issues/537
maven("https://jetbrains.bintray.com/intellij-plugin-service")
}
}

repositories {
mavenCentral()
jcenter()
}

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
pluginName = pluginName_
version = platformVersion
updateSinceUntilBuild = false
}

tasks {
// Set the compatibility versions to 1.8
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}

patchPluginXml {
changeNotes(
closure {
changelog.getLatest().toHTML()
}
)
}

publishPlugin {
dependsOn("patchChangelog")
token(System.getenv("INTELLIJ_PUBLISH_TOKEN"))
channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first())
}
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pluginGroup = com.samvtran
pluginName_ = macosforallkeymap
pluginVersion = 2.0.0
platformVersion = LATEST-EAP-SNAPSHOT
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 591882c

Please sign in to comment.