Scamx is an experimental modal editing mechanism designed for Emacs. It introduces a modularized, multi-layered approach that integrates seamlessly with default Emacs keybindings, avoiding modifier keys and focusing solely on essential commands. Scamx is crafted to deliver a streamlined and functional modal editing experience within the Emacs environment. As mathematical principles dictate, only mapping matters and those powerful functions are just out there.
(use-package scamx
:ensure t
:vc (:url "https://github.com/MagiFeeney/scamx/")
:config
(electric-pair-mode)
)There are four major modes: normal, X, convert, and visit, where some minor modes, such as isearch, are wrapped into them. The normal mode serves as a base for basic navigation and modes invoking. And X mode is sequence commands with a prefix "x". Convert mode "c" is bolder compared to normal mode, and visit mode "v" navigates, views and manages buffer or window.
x fopen a file.x ssave bufferx csave and close emacsx zminimize windowx hselect whole bufferx <tab>indent regionx (start macrox )end macrox ecall macrox [backward pagex ]forward pagex *calculatorx bswitch to bufferx llist all buffersx kkill bufferx jdired jumpx xexchange point and markx SPCpop to mark commandx nduplicate linex ESCrepeat complex commandx .eval last sexpx :eval expressionx =adjust text scalex \copy current file path to kill ringx ~shutdown the computerx oorg mode map (e.g. org mode or org-roam commands)x mset mode map (e.g. eshell, python ...)
/M-xxX modecconvert modevvisit mode`motion mode?help modegcancel selection or exit minibufferamove beginning of lineemove end of lineddelete forward one char or delete region if selectedhdelete backward one char or delete region if selectediinsertoopen belowOopen abovennext linepprevious linefforward charbbackward charjnewline (a.k.a <return>)mback to indentationsisearch forward minor modekkill line at point or kill region if selectedwcopyyyankuundorredotselect to charzzap up to charZzap to charqquit current bufferQgoto linelrecenter top bottom\delete horizontal space=mark wordSPCset mark command!shell command$ispell word%query replace;comment line'comment or uncomment region<backspace>kill whole line,mark inside pairs dwim.mark outside pairs dwim ((), {}, [], "", '')
/M-xgback to normal modenforward paragraphpbackward paragraphfforward wordbbackward worddkill word or delete region if selectedhbackward kill word or delete region if selectedkkill paragraph or kill region if selectedwcopyyyankuundorredoabackward kill sexpjraise sexpekill sexp(backward list)forward list[backward sexp]forward sexp{backward up list}forward up list<move beginning of defun>move end of defun=mark sexp,mark defunsallow one key in Normal mode be executed
gback to normal modellast buffernnext bufferpprevious bufferfother windowbprevious window any framecclone buffersscratch bufferdscroll page downDscroll other page downuscroll page upUscroll other page upescroll line downascroll line uprrevert buffer0delete window1delete other windows=balance windowsmminimize windowMmaximize window|split window horizontally_split window vertically+bold enlarge window horizontally-bold shrink window horizontallywswap windowjmove cursor on top, center or bottom of the screen(tear off window)delete frame- If you have installed package
ace-window, then you can further have:tselect window
[mc/mark-previous-like-this]mc/mark-next-like-this<mc/skip-to-previous-like-this>mc/skip-to-next-like-this:mc/mark-all-like-this"mc/edit-lines@mc/mark-all-words-like-this#mc/mark-all-in-region
ggback to normal mode
? kdescribe key? cdescribe key briefly? fdescribe function? mdescribe mode? \describe input method? bdescribe bindings? pdescribe package? ttutorial? ddebugging tutorial? eview *Messages* buffer? rfind manual? iinfo overview? ssearch for command? vsearch by keyword? C-qquick toggle? ?further options? qquit help,
To view commands from X mode, you can type x followed by ?.
When enter into the minibuffer, it is by default at the insert mode. Once you have finished typing, you can call gg to leave insert mode, then use the regular navigation commands such as n or p to select the candidates. If you have finished selection, you can use <return> to abort the minibuffer, or just use g to leave if it needs to be stopped.
If you want to loop through the history, you can use n or p in convert mode instead.
Visit mode also applies to the minibuffer, which means you can move back-and-forth between buffers and the minibuffer.
Isearch forward is wrapped into an additional layer. Once it is invoked with the s key, it prompts at the minibuffer to enter the string to be searched. Hitting return then marks the finish of the input process. After that, you can use the familiar navigation commands n or p to loop through all candidate in the buffer. When s is pressed again, you can enter a new string to search. Otherwise, you can go back to the normal state with g. You can also simply leave the input string blank followed by the return. With g, you can directly leave.
Please check the full set up in scamx-anchor.el.
- You can hit
SPCtwice to set mark, and then usex SPCto return back to the position. - The convert mode can be invoked on top of the current mark, use whatever commands needed, then revert back to normal mode while keeping the mark.
-can be combined with directional commands, i.e.- tselect backward to a char,- kkill backward a line.
- In visit mode, it may occasionally not handle the buffer
*Messages*properly when navigating previous or next buffer at first attempt. - Command conflicts would be observed in one-key oriented mode i.e. dired-mode, image-mode and magit-mode etc.
Now you can switch between those modes and scamx, by entering into the normal mode with g and reverting back with `. When g conflicts with revert buffer, you can alternatively use r in visit mode.
- Add more functions to convert mode (i.e. up-list, kill-sexp).
- Integrate with multiple-cursors.
- Merge meow of things command series into generalized zap command in a dwim style.
- Allow one command in the normal mode be excuted in the convert mode (like
ctrl-oin vim).
- Motion mode as buffer-wise.
- Improve selection of inside and outside of balanced expressions.