title: Managing keyboard shortcut conflicts between IDE and OS (Ubuntu)
body: <p>I'm using IntelliJ IDEA, but I think this applies to any IDE.</p>
  
  <p>In IDEA, some <a href="https://stackoverflow.com/questions/294167/what-are-the-most-useful-intellij-idea-keyboard-shortcuts">very useful keyboard shortcuts</a> conflict with Ubuntu keyboard shortcuts. Some examples:</p>
  
  <ul>
  <li><strong><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>L</kbd></strong> : formats the source code (mapped to "Lock Screen" in Ubuntu)</li>
  <li><strong><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Left</kbd></strong> : navigates backward (mapped to "switch to workspace on the left of the current workspace" in Ubuntu)</li>
  <li>...</li>
  </ul>
  
  <p>I've been using Ubuntu for a long time, and I'm used to these shortcuts. I use them all the time to switch between workspaces, lock my session... At the same time, I know how useful the IntelliJ shortcuts can be, and I want to avoid using the mouse as much as possible.</p>
  
  <p>Currently, my workaround for "format source code" is <kbd>Alt</kbd>+<kbd>D</kbd> (opens the "Code" menu), followed by "R" ("Reformat Code"). It works okay, since I don't format code that often, but it could be better. There is no real alternative for <strong><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Left</kbd></strong>, though.</p>
  
  <p>How do you manage these conflicts in your IDE?</p>
  
  <p>Do you simply remap all the conflicting IDE keyboard shortcuts to something else (and then get lost when you are pair programming with a colleague with different shortcuts...)?</p>
  
  <p>Do you remap the Linux keyboard shortcuts (even though you are "used" to them)?</p>
  
  <p>Is there a way to make keyboard shortcuts "contextual"? By this, I mean: hit a key to go into "IDEA mode" when coding (all conflicting Ubuntu shortcuts are temporarily deactivated), hit the key again to go back to "Standard mode" (Ubuntu shortcuts are reactived).</p>
  
  <p>Do you have any other ideas / tips on how to manage this problem?</p>