WOWEE is a set of AutoHotKey scripts designed to bring Emacs-like commands and keybindings to the Windows operating system. Based on the concept of EWOW (Emacs Way of Operating Windows), WOWEE allows you to use Emacs-style navigation and commands throughout your Windows environment.
feat: Add global keybinds and minor refactor
- Added a new file `keybinds-global.ahk` which includes essential keybindings for workspace switching, quitting windows, and starting applications like Emacs and Firefox.
- Updated `wowee.ahk` to include `keybinds-global.ahk` for enhanced functionality with global keybindings.
Details:
- `keybinds-global.ahk`:
- Introduced local utility functions for workspace navigation and window management.
- Added workspace switching keybindings (`#i`, `#u`).
- Added window quitting keybinding (`#q`).
- Added startup applications keybindings (`#m` for Emacs, `#n` for Firefox).
- `wowee.ahk`:
- Included `keybinds-global.ahk` to make use of the new global keybindings.
feat: Add xref navigation functions and keybindings
- Introduced xref_find_references(), xref_go_back(), and xref_find_definitions() functions in commands.ahk for navigation.
- Assigned new keybindings in keybinds-core.ahk:
- Alt+. for xref_find_definitions()
- Alt+, for xref_go_back()
- Alt+? for xref_find_references()
A little support for Notepad++:
- isearch
- comment line
Separated individual ergonomic key-mappings as thus:
- wowee–caps_to_ctrl.ahk
- wowee–ralt_to_ctrl.ahk
These are extra files that can be run in addition to the main wowee.ahk for some common ergonomic keyboard Emacs mappings.
This commit has added windows, frames support
- kill frame (C-x c)
- split window vertically (C-x 3)
- maximize window (C-x 1)
- next window (C-x o)
- suspend frame (C-z)
- reorganisation of kanban
- reorganisation of commands.ahk to better group
This commit has split out ahk files into apps, core and init:
- Added comment-line
- Added mark-whole-buffer
- Refined isearch
- Added application specific bindings in keybinds-apps.ahk for Visual Studio and VSCode
- Update README to reflect design changes
- Added beginning_of_buffer and end_of_buffer core mappings
- Added mark_whole_buffer core mapping
This commit introduces several new functions to enhance the usability and functionality of the `commands.ahk` script. Notable additions include:
- Implementation of `isearch_backward` and `isearch_forward` functions for improved search capabilities, allowing for backwards and forwards in-document searches with initialization and continuation logic.
- Addition of `recenter_line`, `indent_line`, and `backward_kill_word` functions to enrich text editing commands.
- Enhancement of `select_line` and `goto_line` functions for better line selection and navigation.
- The `quit_g` function extends quitting capabilities to also reset the `selecting` and `searching` states.
- Modifications to `next_lines` and `previous_lines` to increase the number of lines navigated with each command from 3 to 6, improving scroll efficiency.
- Update to `kill_ring_save` to include an escape key press, ensuring a more comprehensive cleanup post-operation.
- Improved the README.org kanban to more easily differentiate between command sections and to define those commands I am not implementing (IGNORE) and those additional commands (EXTRA)
Initial version
- **Install AutoHotKey**: Download and install AutoHotKey from [AutoHotKey’s official website](https://www.autohotkey.com/).
- **Run WOWEE**: Double-click on the `wowee.ahk` script to start WOWEE. Once running, Emacs commands will be available in your Windows environment.
- **Quit WOWEE**: To quit WOWEE, right-click the AutoHotKey icon in the task tray and select “Exit.”
- Emacs-like commands and keybindings in Windows
- Based on EWOW – Emacs Way of Operating Windows
- Written in AutoHotKey v2
- Includes various Emacs style navigation commands
(a) Ergonomic keyboard layout options
- map caps lock key to control
- map right alt key to control
- Easily add your own keybindings by modifying AHK source files
(b) Bindings bespoke to individual applications
Additional AHK files that can be run in parallel with the main wowee.ahk file if you would prefer some extra ergonomic mappings.
For example it is common to map the Caps Lock key to the Control key to avoid the dreaded Emacs pinky, which can be performed by running up :
wowee--caps_to_ctrl.ahk
I prefer to map the right hand Alt key to the Control key by running:
wowee--ralt_to_ctrl.ahk
Both can also be run if desired!
- I am playing around with the idea of application specific bindings within the keybinds.ahk file, for example something like :
;; ------------- ;; Visual Studio ;; ------------- ;; Shortcut rebindings: ;; ;; Control+p Control+s : Text Editor : Incremental Search ;; Control+p Control+r : Text Editor : Incremental Search Reverse ;; Control+p Control+l : Text Editor : Scroll Recenter ;; Control+p Control+f : Text Editor : Format selection #HotIf WinActive("ahk_class VisualStudio") ^r::isearch_backward("{Shift down}{F3}{Shift up}" "^p^r") ^s::isearch_forward("{F3}" "^p^s") ^l::recenter_line() ^i::indent_line() ^+i::indent_line()
These will be placed in a separate ahk file called keybinds-apps.ahk.
The comments would indicate which commands require re-bindings, or redefining the shortcuts. For example, in Visual Studio, Control+I is an incremental search which in emacs is used for multiple actions including indentation, cycling, e.t.c, so at times rather than relying on either default application keybindings or the general windows keybindings an explicit mapping may be required for full functionality.
So as part of the application definition, why not add in the re-mappings in a comment!
Also I might have to create some more generic functions to accept arguments defining application specific commands, as demonstrated above with isearch_forward and isearch_backward.
As part of this I might have to expand the kanban per application, or maybe separate kanbans on which functions have been implemented.
- I have yet to implement C-x C-<key> but these functions, for example like save-buffer (C-x C-s) and save-buffers-kill-terminal (C-x C-z) are still accessible, but without the second Control, for example C-x s and C-x z
- Any application shortcut re-mappings are using the convention C-p C-<key>, this is temporary as I never use C-p (print) and thought this would be a good unique leader key combination.
The applications I am currently looking to support are the following:
- Visual Studio
- VSCode
- NotePad++
This kanban board is keeping track of those original EWOW functions.
The IGNORE column includes functions that I am definitely not going to implement.
The EXTRA section are additional commands that I am adding.
There is a prefix type indicator for each command referring to the specific type:
(C) - Core Emacs commands (VS) - Visual Studio specific (VC) - VSCode specific (N++) - NotePad++ specific (E) - Extra
and any command with an asterisk is an unconventional Emacs keybinding which will probably get fixed sometime in the future!
TODO | DOING | DONE | IGNORE |
---|---|---|---|
(C) REGION COMMANDS | (E) global windows navigation keybindings | (C) MOTION COMMANDS | (C) JUMPING AROUND COMMANDS |
- (C) mark_word | (VS) VISUAL STUDIO | - (C) forward_char (C-f) | - (C) scroll_left |
- (C) yank_pop | - (VS) recenter_line (C-l) | - (C) backward_char (C-b) | - (C) scroll_right |
- (C) kill_region | - (VS) indent_line (C-i) | - (C) forward_word (M-f) | (C) NEWLINE AND INDENT COMMANDS |
- (C) delete_backward_char | (VC) VSCODE | - (C) backward_word (M-b) | - (C) open_line |
- (C) kill_word | - (VC) isearch_backwards (C-r) | - (C) next_line (C-n) | (C) EDIT COMMANDS |
- (C) kill_whole_line | - (VC) isearch_forwards (C-s) | - (C) previous_line (C-p) | - (C) transpose_chars |
(C) NEWLINE AND INDENT COMMANDS | - (VC) comment_line (C-;) | (C) JUMPING AROUND COMMANDS | - (C) transpose_words |
- (C) newline | - (VC) recenter_line (C-l) | - (C) scroll_down (C-v) | - (C) transpose_lines |
- (C) delete_indentation | (N++) NOTEPAD++ | - (C) scroll_up (M-v) | (C) CASE CONVERSION COMMANDS |
(C) EDIT COMMANDS | (E) PROGRAM SPECIFIC PRESETS | - (C) move_beginning_of_line (C-a) | - (C) upcase_region |
- (C) redo | (E) ERGO PRESET SELECTION | - (C) move_end_of_line (C-e) | - (C) downcase_region |
- (C) query_replace | (E) xref_go_back | <a href=”file:README.org::*- (C) beginning_of_buffer (M-<)">- (C) beginning_of_buffer (M-<) | - (C) upcase_word |
- (C) overwrite_mode | - (C) downcase_word | ||
(C) INSERT PAIRS COMMANDS | - (C) goto_line (M-g g) | - (C) capitalize_word | |
- (C) insert_parentheses | (C) REGION COMMANDS | (C) MACRO RECORDING COMMANDS | |
- (C) insert_comment | - (E) mark_whole_line (M-s ,) | (C) ADD IGNORE FRAMES | |
- (C) indent_new_comment_line | - (C) mark_whole_buffer (C-x h) | (C) ADD MOUSE EVENTS | |
(C) OTHER COMMANDS | - (C) kill_ring_save (M-w) | ||
- (C) shell | - (C) yank (C-y) | ||
- (C) shell_command | - (C) delete_char (C-d) | ||
- (C) facemenu | - (C) backward_kill_word (M-BKSP) | ||
- (C) help | - (C) kill_line (C-k) | ||
(C) SYSTEM COMMANDS | (C) NEWLINE AND INDENT COMMANDS | ||
- (C) ignore | - (C) indent_for_tab_command (C-i) | ||
- (C) repeat | (C) EDIT COMMANDS | ||
(C) UNIVERSAL ARGUMENT COMMANDS | - (C) undo_only (C-/) | ||
(C) FILES COMMANDS | - (C) search_forward (C-s) | ||
- (C) write_file | - (C) search_backward (C-r) | ||
- (C) find_file | (C) SYSTEM COMMANDS | ||
- (C) dired | - (C) set_mark_command (C-SPC) | ||
(C) WINDOWS FRAMES COMMANDS | - (C) set_c-x_command (C-x) | ||
- (C) delete_window | - (C) keyboard_quit (C-g) | ||
- (C) split_window | (C) FILES COMMANDS | ||
(C) ADD HOOKS | - (*C) save_buffer (C-x s) | ||
(C) ADD GENERIC GOTO LINE | (C) WINDOWS FRAMES COMMANDS | ||
(C) ADD KILL RING | - (*C) kill_frame (C-x c) | ||
(VC) VSCODE | - (C) next_window (C-x o) | ||
- (VC) indent_line (C-i) | - (C) suspend_frame (C-z) | ||
- (E) isearch-yank-word-or-char | (C) ADD C-X (C-x) | ||
- (C) previous_window | (VS) VISUAL STUDIO | ||
- (VS) isearch_backwards (C-r) | |||
- (VS) isearch_forwards (C-s) | |||
- (VS) comment_line (C-;) | |||
- (VS) split window vert (C-x 3) | |||
(N++) NOTEPAD++ | |||
- (N++) isearch_backwards (C-r) | |||
- (N++) isearch_forwards (C-s) | |||
- (N++) comment_line (C-;) | |||
(E) xref_find_definitions | |||
(E) xref_find_references |
WOWEE is composed of several AutoHotKey scripts, each serving a specific purpose to replicate Emacs functionalities:
The top level script to be run, contains the following scripts along with some potential ergonomic key-mappings which if not desired can be commented out:
RAlt::Control
CapsLock::Control
#Include fundamental.ahk
#Include commands.ahk
#Include keybinds-apps.ahk
#HotIf !WinActive("ahk_class Emacs")
#Include keybinds-core.ahk
#Include keybinds-init.ahk
#HotIf
This script provides a set of fundamental functions and variables that are used to implement Emacs-like commands and keybindings.
This script includes the basic implementation of Emacs commands.
This script contains simple utility functions used by the command scripts.
This script defines the default core keybindings for Emacs-like commands, which will be a fallback for any windows application.
This script defines the application specific commands, typically commands that have been remapped to accommodate the chosen commands.
Comments within the ahk file indicate the potential re-mappings.
Analogous to the init.el file or Emacs init file in which all the users bespoke keybindings will exist. An example of my preferred keybindings has been supplied.
Essential keybindings for workspace switching, quitting windows, and starting applications like Emacs and Firefox.
- **Download WOWEE**: Download the WOWEE scripts from the repository.
- **Extract Files**: Extract the files to a directory of your choice.
- **Run the Script**: Double-click `wowee.ahk` to start using WOWEE.
You can customize the keybindings by editing the `keybinds.ahk` file. Open the file in any text editor and modify the keybindings according to your preferences. Refer to the AutoHotKey documentation for the syntax and available key options.
To add new commands, you can edit the `commands.ahk` and `commands_util.ahk` files. Define your new commands and utility functions, and then bind them to keys in `keybinds.ahk`.
If you encounter any issues while using WOWEE, try the following steps:
- **Check AutoHotKey Version**: Ensure you have the latest version of AutoHotKey installed.
- **Script Errors**: If there are errors in the script, AutoHotKey will usually display a message with details. Use this information to debug and fix the issue.
- **Conflicting Programs**: Some programs might have conflicting keybindings. Try closing other programs to see if the issue is resolved.
Contributions to WOWEE are welcome! If you have suggestions for improvements or want to add new features, feel free to submit a pull request.
- Fork the repository
- Create your feature branch (`git checkout -b feature/YourFeature`)
- Commit your changes (`git commit -am ‘Add your feature’`)
- Push to the branch (`git push origin feature/YourFeature`)
- Create a new pull request
WOWEE is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to the creators of AutoHotKey and the Emacs community for their inspiration and contributions to keyboard efficiency.
For any questions or issues, please open an issue on the GitHub repository or contact the maintainer at [email@example.com].
—
Enjoy using WOWEE and bring the power of Emacs navigation to your Windows experience!