2 * SXED -- sexy text editor engine, 2022
4 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
5 * Understanding is not required. Only obedience.
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 3 of the License ONLY.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 // !: must have selected and finalized block
21 // *: must have a block (either finalized, or in process)
22 // m: only for minibuffers
23 // t: only for text frames
25 // h: any frame that can host minibuffers
26 // w: only mutable frames
27 // prefixes are enclosed in '|'
28 // i.e. "|!|sxed_frame_block_move"
30 // no, i won't tell you about available actions. deal with it.
35 //unbind-section "secname";
40 // ////////////////////////////////////////////////////////////////////////// //
41 section "cursor movement" {
44 action = "sxed_frame_move_home";
45 help = "move cursor to the beginning of the line";
49 action = "sxed_frame_move_end";
50 help = "move cursor to the end of the line";
55 action = "sxed_frame_move_home_ca";
56 help = "move cursor to the first non-blank character of the line";
60 action = "sxed_frame_move_end_ce";
61 help = "move cursor to the last non-blank character of the line";
66 action = "sxed_frame_cursor_left";
67 help = "move cursor left by one character";
71 action = "sxed_frame_cursor_right";
72 help = "move cursor right by one character";
76 action = "sxed_frame_view_shift_left";
77 help = "shift view left";
81 action = "sxed_frame_view_shift_right";
82 help = "shift view right";
86 action = "sxed_frame_word_left";
87 help = "move cursor back by one word";
91 action = "sxed_frame_word_right";
92 help = "move cursor forward by one word";
96 action = "sxed_frame_cursor_up";
97 help = "move cursor to the previous line";
101 action = "sxed_frame_cursor_down";
102 help = "move cursor to the next line";
106 action = "sxed_frame_scroll_up";
107 help = "scroll view up";
111 action = "sxed_frame_scroll_down";
112 help = "scroll view down";
116 action = "sxed_frame_page_up";
117 help = "move one page up";
121 action = "sxed_frame_page_down";
122 help = "move one page down";
126 action = "sxed_frame_text_top";
127 help = "move to the top of the text";
131 action = "sxed_frame_text_bottom";
132 help = "move to the bottom of the text";
136 action = "sxed_frame_page_top";
137 help = "move to the top of the current page";
141 action = "sxed_frame_page_bottom";
142 help = "move to the bottom of the current page";
146 action = "sxed_frame_query_line_number";
147 help = "ask for the line number, and jump there";
151 action = "sxed_frame_cursor_vcenter";
152 help = "center current line vertically";
155 keys = "M-S-; | M-S-'";
156 action = "sxed_frame_ensure_better_cursor_visibility";
157 help = "scroll view a little if the cursor is near the edge of the view";
161 action = "sxed_frame_paren_jump_left";
162 help = "jump to the matching paren, or string start";
166 action = "sxed_frame_paren_jump_right";
167 help = "jump to the matching paren, or string end";
171 action = "sxed_frame_paren_jump_guess";
172 help = "try to guess the paren, and jump to the matching one";
176 action = "sxed_frame_paren_jump_left_force";
177 help = "jump to the matching paren, or string start (skip invalid parens)";
181 action = "sxed_frame_paren_jump_right_force";
182 help = "jump to the matching paren, or string end (skip invalid parens)";
187 // ////////////////////////////////////////////////////////////////////////// //
188 section "incremental search" {
191 action = "|h|sxed_frame_clear_extra_highlight";
192 help = "remove all temporary highlights";
196 action = "|h|sxed_frame_incsearch_set_mode_plain";
197 help = "show incremental search prompt (plain mode)";
201 action = "|h|sxed_frame_incsearch_set_mode_regexp";
202 help = "show incremental search prompt (regexp mode)";
206 action = "|h|sxed_frame_incsearch_set_mode_word";
207 help = "show incremental search prompt (plain word mode)";
211 action = "|h|sxed_frame_mb_incsearch_repeat";
212 help = "repeat last incremental search";
217 // ////////////////////////////////////////////////////////////////////////// //
218 section "bookmarks" {
221 action = "|h|sxed_frame_jump_to_prev_bookmark";
222 help = "jump to the previous bookmark";
226 action = "|h|sxed_frame_jump_to_next_bookmark";
227 help = "jump to the next bookmark";
231 action = "|h|sxed_frame_toggle_bookmark";
232 help = "toggle bookmark on the current line";
235 keys = "C-k C?-<digit>"; // hack!
236 action = "|h|sxed_frame_set_byteofs_bookmark";
237 help = "set invisible bookmark at the current cursor position";
240 keys = "C-q C?-<digit>"; // hack!
241 action = "|h|sxed_frame_goto_byteofs_bookmark";
242 help = "go to invisible bookmark";
247 // ////////////////////////////////////////////////////////////////////////// //
248 section "block operations" {
251 action = "sxed_frame_mark_start_stop";
252 help = "start or finish marking a block";
255 keys = "M-spc | C-f3 | C-S-f3";
256 action = "sxed_frame_mark_reset";
257 help = "reset (unmark) marked block";
261 action = "sxed_frame_mark_expand";
262 help = "expand marked block";
266 action = "sxed_frame_block_clipcopy";
267 help = "copy marked block to the internal clipboard";
272 action = "sxed_frame_block_clipcut";
273 help = "move marked block to the internal clipboard";
278 action = "sxed_frame_block_clipcopyx11";
279 help = "move marked block to the X11 clipboard (via 'xsel' external command)";
283 action = "|w|sxed_frame_block_delete";
284 help = "delete marked block";
288 action = "|w|sxed_frame_block_clippaste";
289 help = "insert internal clipboard as a new marked block";
293 action = "|w|sxed_frame_block_move";
294 help = "move marked block";
298 action = "|w|sxed_frame_block_copy";
299 help = "copy marked block";
303 action = "|wt*|sxed_frame_block_indent";
304 help = "indent current block";
309 // ////////////////////////////////////////////////////////////////////////// //
310 section "WordStar-like block operations" {
313 action = "|*|sxed_frame_block_write_to_temp";
314 help = "write block to temporary file";
318 action = "|w|sxed_frame_block_read_from_temp";
319 help = "read block from temporary file";
323 action = "sxed_frame_mark_hide_toggle";
324 help = "remove block mark";
328 action = "sxed_frame_mark_start";
329 help = "start block marking";
333 action = "sxed_frame_mark_stop";
334 help = "stop block marking";
338 action = "|wt*|sxed_frame_block_indent";
339 help = "indent current block";
343 action = "|wt*|sxed_frame_block_to_move_source";
344 help = "move to the place where the last block was moved";
348 action = "|wt*|sxed_frame_block_unindent";
349 help = "indent current block";
353 action = "|w|sxed_frame_block_delete";
354 help = "delete marked block";
358 action = "|w|sxed_frame_block_move";
359 help = "move marked block";
363 action = "|w|sxed_frame_block_copy_cursor_at_end";
364 help = "copy marked block";
368 action = "|w|sxed_frame_block_clippaste";
369 help = "insert internal clipboard as a new marked block";
373 action = "sxed_frame_block_clipcut";
374 help = "move marked block to the internal clipboard";
379 action = "|w|sxed_frame_block_clippaste";
380 help = "insert internal clipboard as a new marked block";
384 action = "sxed_frame_block_clipcopy";
385 help = "copy marked block to the internal clipboard";
391 action = "sxed_frame_block_goto_start";
392 help = "go to the start of the block";
396 action = "sxed_frame_block_goto_end";
397 help = "go to the end of the block";
402 // ////////////////////////////////////////////////////////////////////////// //
403 section "tabulation setup" {
406 action = "|t|sxed_frame_query_tab_size";
407 help = "set tab size";
411 action = "|t|sxed_frame_keybind_script";
412 help = "toggle visual tabs mode";
413 arg0str = "self.visual_tabs = !self.visual_tabs; self.dirty = true;";
417 action = "|t|sxed_frame_keybind_script";
418 help = "toggle autoindent mode";
419 arg0str = "self.autoindent = !self.autoindent;";
423 action = "|t|sxed_frame_keybind_script";
424 help = "insert tab char";
425 arg0str = "self.insert_utf8(\"\\t\");";
429 // ////////////////////////////////////////////////////////////////////////// //
430 section "undo/redo" {
433 action = "|w|sxed_frame_undo";
434 help = "perform \"undo\" action";
438 action = "|w|sxed_frame_undo";
439 help = "perform \"undo\" action";
443 action = "|w|sxed_frame_redo";
444 help = "perform \"redo\" action";
448 action = "sxed_frame_clear_undo";
449 help = "wipe undo/redo history";
453 // ////////////////////////////////////////////////////////////////////////// //
454 section "text modification" {
457 action = "|wh|sxed_frame_autoindent_electro";
458 help = "insert new line with smart autoindent";
462 action = "|wh|sxed_frame_autoindent_simple";
463 help = "insert new line with simple autoindent";
467 action = "|wh|sxed_frame_autoindent_forced";
468 help = "insert new line with forced autoindent";
472 action = "|wh|sxed_frame_autoindent_none";
473 help = "insert new line without autoindent";
477 action = "|w|sxed_frame_delete_char";
478 help = "delete characted under cursor";
482 action = "|w|sxed_frame_delete_char_back";
483 help = "delete characted before the cursor";
487 action = "|w|sxed_frame_delete_word_back";
488 help = "delete word before the cursor";
492 action = "|w|sxed_frame_delete_word_back_unindent";
493 help = "delete word before the cursor, or unindent";
496 keys = "C-y | C-S-y";
497 action = "|w|sxed_frame_delete_line";
498 help = "delete current line";
502 action = "|wt|sxed_frame_tab_indent";
503 help = "insert indenting spaces";
507 action = "|wh|sxed_frame_do_autocompletion";
508 help = "autocomplete current word for text frame";
512 action = "|wm|sxed_frame_do_autocompletion_filename";
513 help = "autocomplete filename for minibuffer";
516 keys = "C-k C?-e | C-q C?-y";
517 action = "|w|sxed_frame_delete_to_end_of_line";
518 help = "delete text to the end of the current line";
522 // ////////////////////////////////////////////////////////////////////////// //
523 section "miscelaneous" {
526 action = "|t|sxed_frame_toggle_readonly";
527 help = "toggle read-only flag for the current buffer (NOT FRAME!)";
531 action = "|t|sxed_frame_toggle_line_highlight";
532 help = "toggle line highlighting flag for the current frame";
536 action = "sxed_frame_toggle_global_line_highlight";
537 help = "toggle global line highlighting option";
540 keys = "C-q C?-h | M-q M?-h";
541 action = "|wt|sxed_frame_insert_function_header";
542 help = "insert function header comment";
545 keys = "C-q C?-j | M-q M?-j";
546 action = "|wt|sxed_frame_insert_tearline_comment";
547 help = "insert tearline comment";
551 action = "|h|sxed_frame_incsearch_cursor_word";
552 help = "incremental search word under cursor";
557 action = "sxed_frame_show_encoding_popup";
558 help = "select text encoding";
563 action = "|t|sxed_frame_save";
564 help = "save text frame";
569 action = "|t|sxed_frame_save_all";
570 help = "save all modified text frames";
575 action = "|t|sxed_frame_save_new_name";
576 help = "save current frame with name prompt";
581 action = "|t|sxed_frame_force_save";
582 //.help = "save text frame state";
588 action = "|t|sxed_frame_show_replace_prompt";
589 help = "show search-and-replace prompt";
594 action = "|h|sxed_frame_toggle_line_numbers";
595 help = "toggle line numbers";
599 // ////////////////////////////////////////////////////////////////////////// //
600 section "application keybinds" {
604 action = "sxed_app_command";
605 help = "quit application";
610 action = "sxed_app_command";
611 help = "quit application";
617 action = "|t|sxed_app_command";
618 help = "duplicate frame";
619 arg0 = XACT_DupFrame;
623 action = "|h|sxed_app_command";
624 help = "close frame";
625 arg0 = XACT_CloseFrame;
629 action = "|t|sxed_app_command";
630 help = "maximize/unmaximize frame";
631 arg0 = XACT_ToggleMaximize;
635 keys = "M-x M?-/ | M-x M?-f1";
636 action = "|t|sxed_app_command";
638 arg0 = XACT_ShowKeybinds;
646 action = "sxed_app_command";
647 //.help = "(debug) show undo log";
649 arg0 = XACT_ShowUndoLog;
654 action = "sxed_app_command";
655 help = "show message log";
656 arg0 = XACT_ShowMessageLog;
662 action = "sxed_app_command";
663 help = "paste primary X11 selection";
664 arg0 = XACT_SelPastePrimary;
668 action = "sxed_app_command";
669 help = "paste X11 clipboard selection";
670 arg0 = XACT_SelPasteClipboard;
673 keys = "M-0 | M-ins | M-grave";
674 action = "|h|sxed_app_command";
675 help = "show frame list popup";
676 arg0 = XACT_FrameList;
680 // ////////////////////////////////////////////////////////////////////////// //
681 section "project commands" {
684 action = "|t|sxed_app_command";
685 help = "compile project";
686 arg0 = XACT_RunCompile;
690 action = "|t|sxed_app_command";
691 help = "run project";
692 arg0 = XACT_RunProject;
696 action = "|t|sxed_app_command";
697 help = "build project";
698 arg0 = XACT_RunBuild;
704 action = "|t|sxed_app_command";
705 help = "edit project compile command";
706 arg0 = XACT_QueryRunCompile;
710 action = "|t|sxed_app_command";
711 help = "edit project run command";
712 arg0 = XACT_QueryRunProject;
716 action = "|t|sxed_app_command";
717 help = "edit project build command";
718 arg0 = XACT_QueryRunBuild;
723 // ////////////////////////////////////////////////////////////////////////// //
724 section "project grep" {
727 action = "|t|sxed_app_command";
728 help = "grep last used pattern";
729 arg0 = XACT_ProjectFindAgain;
733 action = "|t|sxed_app_command";
734 help = "grep word under cursor";
735 arg0 = XACT_ProjectFindWord;
739 action = "|t|sxed_app_command";
740 help = "grep declaration under cursor";
741 arg0 = XACT_ProjectFindDecl;
745 action = "|t|sxed_app_command";
746 help = "grep prompt";
747 arg0 = XACT_ProjectFindQuery;
752 // ////////////////////////////////////////////////////////////////////////// //
753 section "dvcs commits" {
756 action = "|t|sxed_app_command";
757 help = "commit project";
761 keys = "C-k C?-M-ent";
762 action = "|t|sxed_app_command";
763 help = "commit and push project";
764 arg0 = XACT_CommitPush;
769 // ////////////////////////////////////////////////////////////////////////// //
770 section "frame switching" {
773 action = "sxed_app_command";
774 help = "previous frame";
775 arg0 = XACT_PrevFrame;
779 action = "sxed_app_command";
781 arg0 = XACT_NextFrame;
786 action = "sxed_app_command";
787 help = "prevous frame";
788 arg0 = XACT_PrevFrame;
792 action = "sxed_app_command";
794 arg0 = XACT_NextFrame;
800 // ////////////////////////////////////////////////////////////////////////// //
801 section "track switching" {
804 action = "sxed_app_command";
805 help = "previous track";
806 arg0 = XACT_PrevTrack;
810 action = "sxed_app_command";
812 arg0 = XACT_NextTrack;
816 action = "sxed_app_command";
817 help = "prevous track";
818 arg0 = XACT_PrevTrack;
822 action = "sxed_app_command";
824 arg0 = XACT_NextTrack;
829 // ////////////////////////////////////////////////////////////////////////// //
830 section "newbie commands" {
833 action = "|t|sxed_app_command";
835 arg0 = XACT_ShowKeybinds;
840 // ////////////////////////////////////////////////////////////////////////// //
841 section "just blockers" {
842 // stop it to send '\x7f'
845 action = "sxed_action_noop";
851 section "miscelaneous" [backend:tty] {
854 action = "sxed_force_screen_repaint";
860 // ////////////////////////////////////////////////////////////////////////// //
862 section "script test" {
865 action = "|t|sxed_frame_keybind_script";
866 help = "script test";
867 arg0str = "self.buffer.insert(self.cursor_byteofs, \"!TEST!\\n\");";