Skip to content

Option to keep esc-as-meta in normal mode. #93

@ftpd

Description

@ftpd

There are few of us, these weirdos who use esc instead of alt.

Currently vimode blocks that, as Esc in normal mode does nothing. The fix is:

diff --git a/vimode.py b/vimode.py
index 21424fa..50ab1f1 100755
--- a/vimode.py
+++ b/vimode.py
@@ -1407,6 +1407,9 @@ def cb_key_combo_default(data, signal, signal_data):
     global esc_pressed, vi_buffer, cmd_compl_text, cmd_text_orig, \
         cmd_compl_pos, cmd_history_index
 
+    if signal_data.startswith("\x01") and mode == "NORMAL":
+        return weechat.WEECHAT_RC_OK
+
     # If Esc was pressed, strip the Esc part from the pressed keys.
     # Example: user presses Esc followed by i. This is detected as "\x01[i",
     # but we only want to handle "i".

19:53:16 < GermainZ> ftpd: if you want, open an issue on GitHub so I eventually remember to make it an option
19:54:34 < ftpd> GermainZ: Sure I will, thank you.

So, here I am ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions