Skip to content

Windows Operating With Emacs Enhancements, Allows Emacs-like commands and keybinds in Windows and is based on EWOW -- Emacs Way of Operating Windows

License

Notifications You must be signed in to change notification settings

captainflasmr/wowee

Repository files navigation

README of wowee

img/WOWEE---Windows-Operating-With-Emacs-Enhancements_banner.jpg

Summary

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.

Whats New

v0.3.4 <2024-07-19>

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()

v0.3.3 <2024-07-01>

A little support for Notepad++:

  • isearch
  • comment line

v0.3.2 <2024-07-01>

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.

v0.3.1 <2024-06-30>

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

v0.3.0 <2024-06-28>

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

v0.2.0 <2024-06-26>

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)

v0.1.0 <2024-06-19>

Initial version

Quick Start / Installation / Usage

  1. **Install AutoHotKey**: Download and install AutoHotKey from [AutoHotKey’s official website](https://www.autohotkey.com/).
  2. **Run WOWEE**: Double-click on the `wowee.ahk` script to start WOWEE. Once running, Emacs commands will be available in your Windows environment.
  3. **Quit WOWEE**: To quit WOWEE, right-click the AutoHotKey icon in the task tray and select “Exit.”

Features

  • 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

Development

(a) Ergonomic keyboard layout options

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!

(a) Bindings bespoke to individual applications

  • 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.

Foibles

  1. 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
  2. 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.

Applications

The applications I am currently looking to support are the following:

  • Visual Studio
  • VSCode
  • NotePad++

kanban

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!

TODODOINGDONEIGNORE
(C) REGION COMMANDS(VS) VISUAL STUDIO(C) MOTION COMMANDS(C) JUMPING AROUND COMMANDS
- (C) mark_word- (VS) recenter_line (C-l)- (C) forward_char (C-f)- (C) scroll_left
- (C) yank_pop- (VS) indent_line (C-i)- (C) backward_char (C-b)- (C) scroll_right
- (C) kill_region(VC) VSCODE- (C) forward_word (M-f)(C) NEWLINE AND INDENT COMMANDS
- (C) delete_backward_char- (VC) isearch_backwards (C-r)- (C) backward_word (M-b)- (C) open_line
- (C) kill_word- (VC) isearch_forwards (C-s)- (C) next_line (C-n)(C) EDIT COMMANDS
- (C) kill_whole_line- (VC) comment_line (C-;)- (C) previous_line (C-p)- (C) transpose_chars
(C) NEWLINE AND INDENT COMMANDS- (VC) recenter_line (C-l)(C) JUMPING AROUND COMMANDS- (C) transpose_words
- (C) newline(N++) NOTEPAD++- (C) scroll_down (C-v)- (C) transpose_lines
- (C) delete_indentation(E) PROGRAM SPECIFIC PRESETS- (C) scroll_up (M-v)(C) CASE CONVERSION COMMANDS
(C) EDIT COMMANDS(E) ERGO PRESET SELECTION- (C) move_beginning_of_line (C-a)- (C) upcase_region
- (C) redo(E) xref_go_back- (C) move_end_of_line (C-e)- (C) downcase_region
- (C) query_replace<a href=”file:README.org::*- (C) beginning_of_buffer (M-<)">- (C) beginning_of_buffer (M-<)- (C) upcase_word
- (C) overwrite_mode- (C) downcase_word
- (E) isearch-yank-word-or-char- (C) goto_line (M-g g)- (C) capitalize_word
(C) INSERT PAIRS COMMANDS(C) REGION COMMANDS(C) MACRO RECORDING COMMANDS
- (C) insert_parentheses- (E) mark_whole_line (M-s ,)(C) ADD IGNORE FRAMES
- (C) insert_comment- (C) mark_whole_buffer (C-x h)(C) ADD MOUSE EVENTS
- (C) indent_new_comment_line- (C) kill_ring_save (M-w)
(C) OTHER COMMANDS- (C) yank (C-y)
- (C) shell- (C) delete_char (C-d)
- (C) shell_command- (C) backward_kill_word (M-BKSP)
- (C) facemenu- (C) kill_line (C-k)
- (C) help(C) NEWLINE AND INDENT COMMANDS
(C) SYSTEM COMMANDS- (C) indent_for_tab_command (C-i)
- (C) ignore(C) EDIT COMMANDS
- (C) repeat- (C) undo_only (C-/)
(C) UNIVERSAL ARGUMENT COMMANDS- (C) search_forward (C-s)
(C) FILES COMMANDS- (C) search_backward (C-r)
- (C) write_file(C) SYSTEM COMMANDS
- (C) find_file- (C) set_mark_command (C-SPC)
- (C) dired- (C) set_c-x_command (C-x)
(C) WINDOWS FRAMES COMMANDS- (C) keyboard_quit (C-g)
- (C) delete_window(C) FILES COMMANDS
- (C) split_window- (*C) save_buffer (C-x s)
- (C) previous_window(C) WINDOWS FRAMES COMMANDS
(C) ADD HOOKS- (*C) kill_frame (C-x c)
(C) ADD GENERIC GOTO LINE- (C) next_window (C-x o)
(C) ADD KILL RING- (C) suspend_frame (C-z)
(VC) VSCODE(C) ADD C-X (C-x)
- (VC) indent_line (C-i)(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

Configuration

WOWEE is composed of several AutoHotKey scripts, each serving a specific purpose to replicate Emacs functionalities:

wowee.ahk

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

fundamental.ahk

This script provides a set of fundamental functions and variables that are used to implement Emacs-like commands and keybindings.

commands.ahk

This script includes the basic implementation of Emacs commands.

commands_util.ahk

This script contains simple utility functions used by the command scripts.

keybinds-core.ahk

This script defines the default core keybindings for Emacs-like commands, which will be a fallback for any windows application.

keybinds-apps.ahk

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.

keybinds-init.ahk

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.

Installation and Setup

  1. **Download WOWEE**: Download the WOWEE scripts from the repository.
  2. **Extract Files**: Extract the files to a directory of your choice.
  3. **Run the Script**: Double-click `wowee.ahk` to start using WOWEE.

Customization

Editing Keybindings

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.

Adding New Commands

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`.

Troubleshooting

If you encounter any issues while using WOWEE, try the following steps:

  1. **Check AutoHotKey Version**: Ensure you have the latest version of AutoHotKey installed.
  2. **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.
  3. **Conflicting Programs**: Some programs might have conflicting keybindings. Try closing other programs to see if the issue is resolved.

Contributing

Contributions to WOWEE are welcome! If you have suggestions for improvements or want to add new features, feel free to submit a pull request.

  1. Fork the repository
  2. Create your feature branch (`git checkout -b feature/YourFeature`)
  3. Commit your changes (`git commit -am ‘Add your feature’`)
  4. Push to the branch (`git push origin feature/YourFeature`)
  5. Create a new pull request

License

WOWEE is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements

Special thanks to the creators of AutoHotKey and the Emacs community for their inspiration and contributions to keyboard efficiency.

Contact

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!

ROADMAP

(C) MOTION COMMANDS

- (C) forward_char (C-f)

- (C) backward_char (C-b)

- (C) forward_word (M-f)

- (C) backward_word (M-b)

- (C) next_line (C-n)

- (C) previous_line (C-p)

(C) JUMPING AROUND COMMANDS

- (C) scroll_down (C-v)

- (C) scroll_up (M-v)

- (C) move_beginning_of_line (C-a)

- (C) move_end_of_line (C-e)

- (C) beginning_of_buffer (M-<)

- (C) end_of_buffer (M->)

- (C) goto_line (M-g g)

(C) JUMPING AROUND COMMANDS

- (C) scroll_left

- (C) scroll_right

(C) REGION COMMANDS

- (C) mark_word

- (C) yank_pop

- (C) kill_region

- (C) delete_backward_char

- (C) kill_word

- (C) kill_whole_line

(C) REGION COMMANDS

- (E) mark_whole_line (M-s ,)

- (C) mark_whole_buffer (C-x h)

- (C) kill_ring_save (M-w)

- (C) yank (C-y)

- (C) delete_char (C-d)

- (C) backward_kill_word (M-BKSP)

- (C) kill_line (C-k)

(C) NEWLINE AND INDENT COMMANDS

- (C) newline

- (C) delete_indentation

(C) NEWLINE AND INDENT COMMANDS

- (C) open_line

(C) NEWLINE AND INDENT COMMANDS

- (C) indent_for_tab_command (C-i)

(C) EDIT COMMANDS

- (C) redo

- (C) query_replace

- (C) overwrite_mode

(C) EDIT COMMANDS

- (C) transpose_chars

- (C) transpose_words

- (C) transpose_lines

(C) EDIT COMMANDS

- (C) undo_only (C-/)

- (C) search_forward (C-s)

- (C) search_backward (C-r)

- (E) isearch-yank-word-or-char

(C) CASE CONVERSION COMMANDS

- (C) upcase_region

- (C) downcase_region

- (C) upcase_word

- (C) downcase_word

- (C) capitalize_word

(C) INSERT PAIRS COMMANDS

- (C) insert_parentheses

- (C) insert_comment

- (C) indent_new_comment_line

(C) OTHER COMMANDS

- (C) shell

- (C) shell_command

- (C) facemenu

- (C) help

(C) SYSTEM COMMANDS

- (C) ignore

- (C) repeat

(C) SYSTEM COMMANDS

- (C) set_mark_command (C-SPC)

- (C) set_c-x_command (C-x)

- (C) keyboard_quit (C-g)

(C) UNIVERSAL ARGUMENT COMMANDS

(C) MACRO RECORDING COMMANDS

(C) FILES COMMANDS

- (C) write_file

- (C) find_file

- (C) dired

(C) FILES COMMANDS

- (*C) save_buffer (C-x s)

(C) WINDOWS FRAMES COMMANDS

- (C) delete_window

- (C) split_window

(C) WINDOWS FRAMES COMMANDS

- (*C) kill_frame (C-x c)

- (C) next_window (C-x o)

- (C) previous_window

- (C) suspend_frame (C-z)

(C) ADD HOOKS

(C) ADD IGNORE FRAMES

(C) ADD GENERIC GOTO LINE

(C) ADD KILL RING

(C) ADD MOUSE EVENTS

(C) ADD C-X (C-x)

(VS) VISUAL STUDIO

- (VS) isearch_backwards (C-r)

- (VS) isearch_forwards (C-s)

- (VS) comment_line (C-;)

- (VS) split window vert (C-x 3)

(VS) VISUAL STUDIO

- (VS) recenter_line (C-l)

- (VS) indent_line (C-i)

(VC) VSCODE

- (VC) indent_line (C-i)

(VC) VSCODE

- (VC) isearch_backwards (C-r)

- (VC) isearch_forwards (C-s)

- (VC) comment_line (C-;)

- (VC) recenter_line (C-l)

(N++) NOTEPAD++

(N++) NOTEPAD++

- (N++) isearch_backwards (C-r)

- (N++) isearch_forwards (C-s)

- (N++) comment_line (C-;)

(E) PROGRAM SPECIFIC PRESETS

(E) ERGO PRESET SELECTION

(E) xref_find_definitions

(E) xref_go_back

(E) xref_find_references

About

Windows Operating With Emacs Enhancements, Allows Emacs-like commands and keybinds in Windows and is based on EWOW -- Emacs Way of Operating Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published