In an attempt to reduce cognitive load I have resurrected one of my old projects in Autohotkey. My previous version was overloaded, attempting to be an IDE, so I have removed as much a possible.
Antoine de Saint-Exupery said "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away".
- No launching of other applications (except grep)
- No CVS
- No unused shortcuts
I should remove the toolbar, but it helps me remember my context, and look great!
The script provides a bare minimum of user interface elements:
- Menus
- Toolbar
- Tabbar
- Keyboard shortcuts
- Input boxes
- File dialoges
This is the compiled version of my AHK scripted editor:
- APEditor.exe
- APEditor.dll - I have renamed from HiEdit.dll to keep the files together
- APEditor.hes - Keyword file for highlighting
- .\img*.* - Image files for the toolbar
Also uses external tools:
- %comspec%
- GrepWin.exe
- GetPlainText.exe
- Shelexec.exe
- TextDiff.exe
The script uses a very capable edit control (HiEdit.dll) with all the ususal keyboard shortcuts.
I have intercepted a few calls for my own use:
- +{Down} My_CMDCall("SelectMenu_LineDown")
- +{up} My_CMDCall("SelectMenu_LineUp")
- ^{BS} Send +^{Left}{BS}
Additional functionality is added using Autohotkey, and specifically the wrapper for the edit control (HiEdit.ahk).
Choosing the minimum set of additional functions has been interesting.
Rather than copying all the functions I have seen in other editors, I have tried to limit myself:
- Functions I regularly
- Functions that are really useful when needed.
The source code can be modified to add functionality, within the boundaries of the UI and underlying edit control. However, please note there is no way to word wrap in this control.
My added fuctions are listed below:
- Revert to disk version
- Open selected filename
- Insert template
- Insert file/filename
- Save/open local backup
- Paste plain text
- Kill to BOL/EOL
- Goto
- Mark and move
- Find and replace text
- Find regular expressions
- Find and replace in files (external tool)
- Duplicate line/block
- Delete line/block
- Move line/block up/down
- Prefix line/block
- Sort
- Trim
- Change case
- Change EOL
- Project actions
- Mouse wheel to zoom
- A few external tools
I have implemented some of my own keyboard shortcuts, and again choosing the minimum set has been interesting.