Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global custom ~vim-like (input) mappings for any app is ❤️, formalize it, make it cross-platform! #64

Open
bew opened this issue May 22, 2021 · 0 comments

Comments

@bew
Copy link
Owner

bew commented May 22, 2021

I've been using for months now a set of AutoHotKey mappings (on Wind{ows,aube}) at work, that allows my to get some vim-like keybindings (with Alt pressed) for navigating here and there in a text input area or in the program.

I already ported some bindings on my zsh, nvim (very few, for insert mode short movements) configs, but not yet to my Linux machine / WM (hlwm right now).

NOTE: My ahk scripts are stored in a private repo (work-related), but a dump of the current ~vim-like mappings are:
(at date: 20210522)

; * (Modifier) Fire the hotkey even if extra modifiers (e.g: Shift) are being held down.
; ! is Alt
; ^ is Ctrl
; + is Shift

; --- Word movement

; Alt+{b,w} -> Ctrl+{Left,Right}
*!b::Send ^{Left}
*!w::Send ^{Right}

; --- Begin/End

; Alt+g -> Home (Begin)
; NOTE: I need Alt+^ for Home as well (used in a line, not in a doc)
!g::Send {Home}

; Alt+Shift+g -> End
; Alt+$ -> End
!+g::Send {End}
!$::Send {End}

; --- Arrows

; Alt+{h,j,k,l} -> {Left,Down,Up,Right}
*!h::Send {Left}
*!j::Send {Down}
*!k::Send {Up}
*!l::Send {Right}

; --- Quick retry that line

; Ctrl+u -> Shift+Home (select) then Backspace (delete)
^u::
  Send +{Home}
  Sleep 100 ; 100ms, for minimal visual feedback
  Send {Backspace}
  return

implementation
For Linux, something like #43 could help, TODO: write what might be missing.

@bew bew changed the title Global custom ~vim-like (intput) mappings for any app is ❤️, formalize it, make it cross-platform! Global custom ~vim-like (intput) mappings for any app is ❤️, formalize it, make it cross-platform! May 22, 2021
@bew bew changed the title Global custom ~vim-like (intput) mappings for any app is ❤️, formalize it, make it cross-platform! Global custom ~vim-like (input) mappings for any app is ❤️, formalize it, make it cross-platform! Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

1 participant