Giter Club home page Giter Club logo

ergo-keys's People

Contributors

amibiz avatar amynbe avatar jacksonbenete avatar vrtantti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ergo-keys's Issues

Bind Home key to Command Mode

xah-fly-keys recommends mapping the Capslock key to << Home >> and binding << Home >> to Command mode.
It makes things a lot easier and it would be really handy if I could switch to the command mode with CapsLock.
Thanks.

Removing plugin causes error if custom keymap was based on plugin keymap

After removing the plugin, if a custom keymap was created based on the plugin keymaps, an error notification is shown

image

Because the cloned keymap uses the ErgoKeys (QWERTY) keymap as parent, after uninstalling the plugin, IntelliJ can not find the parent keymap and shows the error notification.

Steps to reproduce:

  1. Install the plugin
  2. Create custom keymap based on ErgoKeys (QWERTY) by duplicating it
  3. Uninstall the plugin

Workaround: delete any custom keymap based on the plugin before/after removing the plugin

Related to #30

Binding Escape key to Command Mode has no effect

I wanted to reproduce vim's exit from insert mode by pressing escape key, but I can't seem to do so.
I've added a custom binding for Command Mode to do that (I've had to do it directly in file), but Pressing escape does nothing. I've also removed all other mappings for escape key, but nothing changed.

Binding Insert Mode to Escape has some weird consequences too: insert mode is entered, but only after second press.

Can Escape a viable key for command mode/insert mode?

Support custom key bindings

Currently, the key bindings are coded at compile time. This feature will let the user customize the key bindings.
Note that changing the default key binding for entering command mode, ALT + SPACE, is possible in Settings / Keymap.

Go To Line action stuck in commnad mode

How to reproduce:

  1. switch editor to CMD mode
  2. press A (Find Action)
  3. search for "Go To Line"
  4. input text is stuck in CMD mode

Expected:

When the dialog is open switch to INS mode.

See current mappings/change mappings

Hello! Thank you for the great plugin.

Coming from emacs I was excited to see someone had implemented modal key bindings.

I can't seem to find the list of keybindings? And is it possible to change what command the keys bind to?

command mode does not work in pycharm notebooks

This plugin is great! I am just having some trouble using it in the new jupyter notebook interface (PyCharm 2021.3.3 (Professional Edition)).
The command mode does not seem to work in this interface. While it seems as though it is possible to enable it, none of the commands work and it cannot be disabled again. Perhaps this is due to interference from the jupyter command mode?

Update to 2022.3.*

This plugin isn't compatible with the latest IntelliJ and Rider versions (2022.3.*). Could you publish an update?

Custom Keybindings And Switching to Insert Mode

There is a problem with command-mode custom keybindings that open pop-up windows or menus. The menu or window will open but I will be stuck on command-mode with the key to switch to insert-mode not working. Basically, we need to switch to insert-mode before performing the action. I think you have also ran into this problem and that's why this piece of code exists:

                if (action.getClass().equals(SearchEverywhereAction.class) ||
                        action.getClass().equals(RunAnythingAction.class) ||
                        action.getClass().equals(IncrementalFindAction.class) ||
                        action.getClass().equals(FindInPathAction.class) ||
                        action.getClass().equals(ViewStructureAction.class)) {
                    final Editor editor = dataContext.getData(CommonDataKeys.EDITOR);
                    activateInsertMode(editor);
                }

This fixes the issues for these specific actions, but obviously can never cover all the different actions I want to bind to keys.

This is my current minimal solution:

  1. Whenever the focus is lost, I activate insert mode (We lose focus for actions that create a pop-up window). The idea being that we only want to be in command-mode in the "main" editor where we actually edit code, so whenever whenever focus is lost on this editor we probably want to be in insert mode.
  2. When we gain focus we check if the editor is editing a named file. (Editor seems to be a generic named used for many things we can type into, including pop-up windows, etc). But only the "main" editor has named files we are modifying. So when we gain focus on the main editor we switch back to command mode. This is pretty much the entire change:
         EditorFactory.getInstance().addEditorFactoryListener(
                 new EditorFactoryListener() {
                     @Override
                     public void editorCreated(@NotNull EditorFactoryEvent event) {
                         Editor editor = event.getEditor();
+
                         editor.getContentComponent().addFocusListener(new FocusListener() {
                             @Override
                             public void focusGained(FocusEvent focusEvent) {
-                                LOG.debug("focusGained: focusEvent=", focusEvent);
-                                editor.getSettings().setBlockCursor(inCommandMode());
+                                LOG.debug("focusGained: focusEvent=", focusEvent.toString());
+
+                                EditorComponentImpl e = (EditorComponentImpl)(focusEvent.getSource());
+                                VirtualFile f = e.getEditor().getVirtualFile();
+                                // No file name. Assume it is not the "main" editor windows where user modifies code.
+                                if(f != null){
+                                    activateCommandMode(editor);
+                                }
                             }
 
                             @Override
                             public void focusLost(FocusEvent focusEvent) {
                                 LOG.debug("focusLost: focusEvent=", focusEvent);
-                                lastEditorUsed = editor;
+                                // Will we need this?
+//                                lastEditorUsed = editor;
+                                activateInsertMode(editor);
                             }
                         });
                     }

I have been using this for a while and seems to work well. Other approaches that I tried had corner cases I couldn't easily handle. I have a fork of this repo but it is cumbersome to maintain and merge new changes.

I'd be happy to make a PR with these changes if there is interest? Thanks

Mouse shortcuts don't work in command mode

First of all thanks for writing this plugin.
I've started using it today and am liking it. I've also noticed the following problems:

  • Middle click (or Ctrl+Click) on an identifier no longer goes to declaration/usages if you're in command mode.
  • i j k l keys don't insert the corresponding char in "search everywhere"(shift-shift) and "run anything" (ctrl-ctrl)
  • Non-Xah shortcuts don't work in command mode (e.g Ctrl+N for go to class)
  • Alt-space doesn't work on my system (windows 10). It triggers the OS window menu (with Restore, Move, etc) and had to remap to Alt-F (which normally triggers the File menu but you can still do that with another hit of Alt-F)

I think we can live with most of these issues but the first one would definitely need to be fixed, if possible. As neither of mouse-based and keyboard-based input mode can ever totally replace one another, any software should provide optimal support for both.

Also, I created a visual layout of the plugin's Keymap on keyboard-layout-editor.com, as a way to help familiarise myself quickly with it: ErgoKeysV0. Might come in handy for other new users.

Insert mode and builtin terminal

(#29) Opening the builtin terminal while in command mode does not automatically switch to insert mode and will also prevent switching to it, forcing the user to switch back to the editor in order to change the keymap.

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.