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_redo";
439 help = "perform \"redo\" action";
444 action = "|w|sxed_frame_undo";
445 help = "perform \"undo\" action";
449 action = "|w|sxed_frame_redo";
450 help = "perform \"redo\" action";
455 action = "sxed_frame_clear_undo";
456 help = "wipe undo/redo history";
460 // ////////////////////////////////////////////////////////////////////////// //
461 section "text modification" {
464 action = "|wh|sxed_frame_autoindent_electro";
465 help = "insert new line with smart autoindent";
469 action = "|wh|sxed_frame_autoindent_simple";
470 help = "insert new line with simple autoindent";
474 action = "|wh|sxed_frame_autoindent_forced";
475 help = "insert new line with forced autoindent";
479 action = "|wh|sxed_frame_autoindent_none";
480 help = "insert new line without autoindent";
484 action = "|w|sxed_frame_delete_char";
485 help = "delete characted under cursor";
489 action = "|w|sxed_frame_delete_char_back";
490 help = "delete characted before the cursor";
494 action = "|w|sxed_frame_delete_word_back";
495 help = "delete word before the cursor";
499 action = "|w|sxed_frame_delete_word_back_unindent";
500 help = "delete word before the cursor, or unindent";
503 keys = "C-y | C-S-y";
504 action = "|w|sxed_frame_delete_line";
505 help = "delete current line";
509 action = "|wt|sxed_frame_tab_indent";
510 help = "insert indenting spaces";
514 action = "|wh|sxed_frame_do_autocompletion";
515 help = "autocomplete current word for text frame";
519 action = "|wm|sxed_frame_do_autocompletion_filename";
520 help = "autocomplete filename for minibuffer";
523 keys = "C-k C?-e | C-q C?-y";
524 action = "|w|sxed_frame_delete_to_end_of_line";
525 help = "delete text to the end of the current line";
529 // ////////////////////////////////////////////////////////////////////////// //
530 section "miscelaneous" {
533 action = "|t|sxed_frame_toggle_readonly";
534 help = "toggle read-only flag for the current buffer (NOT FRAME!)";
538 action = "|t|sxed_frame_toggle_line_highlight";
539 help = "toggle line highlighting flag for the current frame";
543 action = "sxed_frame_toggle_global_line_highlight";
544 help = "toggle global line highlighting option";
547 keys = "C-q C?-h | M-q M?-h";
548 action = "|wt|sxed_frame_insert_function_header";
549 help = "insert function header comment";
552 keys = "C-q C?-j | M-q M?-j";
553 action = "|wt|sxed_frame_insert_tearline_comment";
554 help = "insert tearline comment";
558 action = "|h|sxed_frame_incsearch_cursor_word";
559 help = "incremental search word under cursor";
564 action = "sxed_frame_show_encoding_popup";
565 help = "select text encoding";
570 action = "|t|sxed_frame_save";
571 help = "save text frame";
576 action = "|t|sxed_frame_save_all";
577 help = "save all modified text frames";
582 action = "|t|sxed_frame_save_new_name";
583 help = "save current frame with name prompt";
588 action = "|t|sxed_frame_force_save";
589 //.help = "save text frame state";
595 action = "|t|sxed_frame_show_replace_prompt";
596 help = "show search-and-replace prompt";
601 action = "|h|sxed_frame_toggle_line_numbers";
602 help = "toggle line numbers";
606 // ////////////////////////////////////////////////////////////////////////// //
607 section "application keybinds" {
611 action = "sxed_app_command";
612 help = "quit application";
617 action = "sxed_app_command";
618 help = "quit application";
624 action = "|t|sxed_app_command";
625 help = "duplicate frame";
626 arg0 = XACT_DupFrame;
630 action = "|h|sxed_app_command";
631 help = "close frame";
632 arg0 = XACT_CloseFrame;
636 action = "|t|sxed_app_command";
637 help = "maximize/unmaximize frame";
638 arg0 = XACT_ToggleMaximize;
642 keys = "M-x M?-/ | M-x M?-f1";
643 action = "|t|sxed_app_command";
645 arg0 = XACT_ShowKeybinds;
653 action = "sxed_app_command";
654 //.help = "(debug) show undo log";
656 arg0 = XACT_ShowUndoLog;
661 action = "sxed_app_command";
662 help = "show message log";
663 arg0 = XACT_ShowMessageLog;
669 action = "sxed_app_command";
670 help = "paste primary X11 selection";
671 arg0 = XACT_SelPastePrimary;
675 action = "sxed_app_command";
676 help = "paste X11 clipboard selection";
677 arg0 = XACT_SelPasteClipboard;
680 keys = "M-0 | M-ins | M-grave";
681 action = "|h|sxed_app_command";
682 help = "show frame list popup";
683 arg0 = XACT_FrameList;
687 // ////////////////////////////////////////////////////////////////////////// //
688 section "project commands" {
691 action = "|t|sxed_app_command";
692 help = "compile project";
693 arg0 = XACT_RunCompile;
697 action = "|t|sxed_app_command";
698 help = "run project";
699 arg0 = XACT_RunProject;
703 action = "|t|sxed_app_command";
704 help = "build project";
705 arg0 = XACT_RunBuild;
711 action = "|t|sxed_app_command";
712 help = "edit project compile command";
713 arg0 = XACT_QueryRunCompile;
717 action = "|t|sxed_app_command";
718 help = "edit project run command";
719 arg0 = XACT_QueryRunProject;
723 action = "|t|sxed_app_command";
724 help = "edit project build command";
725 arg0 = XACT_QueryRunBuild;
730 // ////////////////////////////////////////////////////////////////////////// //
731 section "project grep" {
734 action = "|t|sxed_app_command";
735 help = "grep last used pattern";
736 arg0 = XACT_ProjectFindAgain;
740 action = "|t|sxed_app_command";
741 help = "grep word under cursor";
742 arg0 = XACT_ProjectFindWord;
746 action = "|t|sxed_app_command";
747 help = "grep declaration under cursor";
748 arg0 = XACT_ProjectFindDecl;
752 action = "|t|sxed_app_command";
753 help = "grep prompt";
754 arg0 = XACT_ProjectFindQuery;
759 // ////////////////////////////////////////////////////////////////////////// //
760 section "dvcs commits" {
763 action = "|t|sxed_app_command";
764 help = "commit project";
768 keys = "C-k C?-M-ent";
769 action = "|t|sxed_app_command";
770 help = "commit and push project";
771 arg0 = XACT_CommitPush;
776 // ////////////////////////////////////////////////////////////////////////// //
777 section "frame switching" {
780 action = "sxed_app_command";
781 help = "previous frame";
782 arg0 = XACT_PrevFrame;
786 action = "sxed_app_command";
788 arg0 = XACT_NextFrame;
793 action = "sxed_app_command";
794 help = "prevous frame";
795 arg0 = XACT_PrevFrame;
799 action = "sxed_app_command";
801 arg0 = XACT_NextFrame;
807 // ////////////////////////////////////////////////////////////////////////// //
808 section "track switching" {
811 action = "sxed_app_command";
812 help = "previous track";
813 arg0 = XACT_PrevTrack;
817 action = "sxed_app_command";
819 arg0 = XACT_NextTrack;
823 action = "sxed_app_command";
824 help = "prevous track";
825 arg0 = XACT_PrevTrack;
829 action = "sxed_app_command";
831 arg0 = XACT_NextTrack;
836 // ////////////////////////////////////////////////////////////////////////// //
837 section "newbie commands" {
840 action = "|t|sxed_app_command";
842 arg0 = XACT_ShowKeybinds;
847 // ////////////////////////////////////////////////////////////////////////// //
848 section "just blockers" {
849 // stop it to send '\x7f'
852 action = "sxed_action_noop";
858 section "miscelaneous" [backend:tty] {
861 action = "sxed_force_screen_repaint";
867 // ////////////////////////////////////////////////////////////////////////// //
869 section "script test" {
872 action = "|t|sxed_frame_keybind_script";
873 help = "script test";
874 arg0str = "self.buffer.insert(self.cursor_byteofs, \"!TEST!\\n\");";