jamrules: use globs in install target; this is wrong, but i am too lazy to track...
[sxed.git] / config / keybinds / default.skb
blob622b1f45617e48f371f90275d4fa742aff3004f6
1 /*
2  * SXED -- sexy text editor engine, 2022
3  *
4  * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
5  * Understanding is not required. Only obedience.
6  *
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.
10  *
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.
15  *
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/>.
18  */
19 // action prefixes:
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
24 //   p: only for popups
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.
33 //ignore-it;
34 //stop-here;
35 //unbind-section "secname";
37 unbind-all;
40 // ////////////////////////////////////////////////////////////////////////// //
41 section "cursor movement" {
42   {
43     keys = "home";
44     action = "sxed_frame_move_home";
45     help = "move cursor to the beginning of the line";
46   }
47   {
48     keys = "end";
49     action = "sxed_frame_move_end";
50     help = "move cursor to the end of the line";
51   }
52   /*
53   {
54     keys = "C-a";
55     action = "sxed_frame_move_home_ca";
56     help = "move cursor to the first non-blank character of the line";
57   }
58   {
59     keys = "C-e";
60     action = "sxed_frame_move_end_ce";
61     help = "move cursor to the last non-blank character of the line";
62   }
63   */
64   {
65     keys = "left";
66     action = "sxed_frame_cursor_left";
67     help = "move cursor left by one character";
68   }
69   {
70     keys = "right";
71     action = "sxed_frame_cursor_right";
72     help = "move cursor right by one character";
73   }
74   {
75     keys = "S-left";
76     action = "sxed_frame_view_shift_left";
77     help = "shift view left";
78   }
79   {
80     keys = "S-right";
81     action = "sxed_frame_view_shift_right";
82     help = "shift view right";
83   }
84   {
85     keys = "C-left";
86     action = "sxed_frame_word_left";
87     help = "move cursor back by one word";
88   }
89   {
90     keys = "C-right";
91     action = "sxed_frame_word_right";
92     help = "move cursor forward by one word";
93   }
94   {
95     keys = "up";
96     action = "sxed_frame_cursor_up";
97     help = "move cursor to the previous line";
98   }
99   {
100     keys = "down";
101     action = "sxed_frame_cursor_down";
102     help = "move cursor to the next line";
103   }
104   {
105     keys = "C-up";
106     action = "sxed_frame_scroll_up";
107     help = "scroll view up";
108   }
109   {
110     keys = "C-down";
111     action = "sxed_frame_scroll_down";
112     help = "scroll view down";
113   }
114   {
115     keys = "pageup";
116     action = "sxed_frame_page_up";
117     help = "move one page up";
118   }
119   {
120     keys = "pagedown";
121     action = "sxed_frame_page_down";
122     help = "move one page down";
123   }
124   {
125     keys = "C-pageup";
126     action = "sxed_frame_text_top";
127     help = "move to the top of the text";
128   }
129   {
130     keys = "C-pagedown";
131     action = "sxed_frame_text_bottom";
132     help = "move to the bottom of the text";
133   }
134   {
135     keys = "C-home";
136     action = "sxed_frame_page_top";
137     help = "move to the top of the current page";
138   }
139   {
140     keys = "C-end";
141     action = "sxed_frame_page_bottom";
142     help = "move to the bottom of the current page";
143   }
144   {
145     keys = "C-l | M-l";
146     action = "sxed_frame_query_line_number";
147     help = "ask for the line number, and jump there";
148   }
149   {
150     keys = "M-S-l";
151     action = "sxed_frame_cursor_vcenter";
152     help = "center current line vertically";
153   }
154   {
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";
158   }
159   {
160     keys = "M-[";
161     action = "sxed_frame_paren_jump_left";
162     help = "jump to the matching paren, or string start";
163   }
164   {
165     keys = "M-]";
166     action = "sxed_frame_paren_jump_right";
167     help = "jump to the matching paren, or string end";
168   }
169   {
170     keys = "M-\\";
171     action = "sxed_frame_paren_jump_guess";
172     help = "try to guess the paren, and jump to the matching one";
173   }
174   {
175     keys = "C-M-[";
176     action = "sxed_frame_paren_jump_left_force";
177     help = "jump to the matching paren, or string start (skip invalid parens)";
178   }
179   {
180     keys = "C-M-]";
181     action = "sxed_frame_paren_jump_right_force";
182     help = "jump to the matching paren, or string end (skip invalid parens)";
183   }
187 // ////////////////////////////////////////////////////////////////////////// //
188 section "incremental search" {
189   {
190     keys = "esc";
191     action = "|h|sxed_frame_clear_extra_highlight";
192     help = "remove all temporary highlights";
193   }
194   {
195     keys = "C-/";
196     action = "|h|sxed_frame_incsearch_set_mode_plain";
197     help = "show incremental search prompt (plain mode)";
198   }
199   {
200     keys = "M-/";
201     action = "|h|sxed_frame_incsearch_set_mode_regexp";
202     help = "show incremental search prompt (regexp mode)";
203   }
204   {
205     keys = "M-S-/";
206     action = "|h|sxed_frame_incsearch_set_mode_word";
207     help = "show incremental search prompt (plain word mode)";
208   }
209   {
210     keys = "C-v";
211     action = "|h|sxed_frame_mb_incsearch_repeat";
212     help = "repeat last incremental search";
213   }
217 // ////////////////////////////////////////////////////////////////////////// //
218 section "bookmarks" {
219   {
220     keys = "M-i";
221     action = "|h|sxed_frame_jump_to_prev_bookmark";
222     help = "jump to the previous bookmark";
223   }
224   {
225     keys = "M-j";
226     action = "|h|sxed_frame_jump_to_next_bookmark";
227     help = "jump to the next bookmark";
228   }
229   {
230     keys = "M-m";
231     action = "|h|sxed_frame_toggle_bookmark";
232     help = "toggle bookmark on the current line";
233   }
234   {
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";
238   }
239   {
240     keys = "C-q C?-<digit>"; // hack!
241     action = "|h|sxed_frame_goto_byteofs_bookmark";
242     help = "go to invisible bookmark";
243   }
247 // ////////////////////////////////////////////////////////////////////////// //
248 section "block operations" {
249   {
250     keys = "C-spc | f3";
251     action = "sxed_frame_mark_start_stop";
252     help = "start or finish marking a block";
253   }
254   {
255     keys = "M-spc | C-f3 | C-S-f3";
256     action = "sxed_frame_mark_reset";
257     help = "reset (unmark) marked block";
258   }
259   {
260     keys = "S-f3";
261     action = "sxed_frame_mark_expand";
262     help = "expand marked block";
263   }
264   {
265     keys = "C-ins";
266     action = "sxed_frame_block_clipcopy";
267     help = "copy marked block to the internal clipboard";
268   }
269   /*
270   {
271     keys = "S-del";
272     action = "sxed_frame_block_clipcut";
273     help = "move marked block to the internal clipboard";
274   }
275   */
276   {
277     keys = "M-S-c";
278     action = "sxed_frame_block_clipcopyx11";
279     help = "move marked block to the X11 clipboard (via 'xsel' external command)";
280   }
281   {
282     keys = "f8";
283     action = "|w|sxed_frame_block_delete";
284     help = "delete marked block";
285   }
286   {
287     keys = "S-ins";
288     action = "|w|sxed_frame_block_clippaste";
289     help = "insert internal clipboard as a new marked block";
290   }
291   {
292     keys = "f6";
293     action = "|w|sxed_frame_block_move";
294     help = "move marked block";
295   }
296   {
297     keys = "f5";
298     action = "|w|sxed_frame_block_copy";
299     help = "copy marked block";
300   }
301   {
302     keys = "C-tab";
303     action = "|wt*|sxed_frame_block_indent";
304     help = "indent current block";
305   }
309 // ////////////////////////////////////////////////////////////////////////// //
310 section "WordStar-like block operations" {
311   {
312     keys = "C-k C?-w";
313     action = "|*|sxed_frame_block_write_to_temp";
314     help = "write block to temporary file";
315   }
316   {
317     keys = "C-k C?-r";
318     action = "|w|sxed_frame_block_read_from_temp";
319     help = "read block from temporary file";
320   }
321   {
322     keys = "C-k C?-h";
323     action = "sxed_frame_mark_hide_toggle";
324     help = "remove block mark";
325   }
326   {
327     keys = "C-k C?-b";
328     action = "sxed_frame_mark_start";
329     help = "start block marking";
330   }
331   {
332     keys = "C-k C?-k";
333     action = "sxed_frame_mark_stop";
334     help = "stop block marking";
335   }
336   {
337     keys = "C-k C?-i";
338     action = "|wt*|sxed_frame_block_indent";
339     help = "indent current block";
340   }
341   {
342     keys = "C-k C?-M-u";
343     action = "|wt*|sxed_frame_block_to_move_source";
344     help = "move to the place where the last block was moved";
345   }
346   {
347     keys = "C-k C?-u";
348     action = "|wt*|sxed_frame_block_unindent";
349     help = "indent current block";
350   }
351   {
352     keys = "C-k C?-y";
353     action = "|w|sxed_frame_block_delete";
354     help = "delete marked block";
355   }
356   {
357     keys = "C-k C?-m";
358     action = "|w|sxed_frame_block_move";
359     help = "move marked block";
360   }
361   {
362     keys = "C-k C?-c";
363     action = "|w|sxed_frame_block_copy_cursor_at_end";
364     help = "copy marked block";
365   }
366   {
367     keys = "C-k C?-v";
368     action = "|w|sxed_frame_block_clippaste";
369     help = "insert internal clipboard as a new marked block";
370   }
371   {
372     keys = "C-k C?-x";
373     action = "sxed_frame_block_clipcut";
374     help = "move marked block to the internal clipboard";
375   }
376   /*
377   {
378     keys = "C-k C?-[";
379     action = "|w|sxed_frame_block_clippaste";
380     help = "insert internal clipboard as a new marked block";
381   }
382   {
383     keys = "C-k C?-]";
384     action = "sxed_frame_block_clipcopy";
385     help = "copy marked block to the internal clipboard";
386   }
387   */
389   {
390     keys = "C-q C?-b";
391     action = "sxed_frame_block_goto_start";
392     help = "go to the start of the block";
393   }
394   {
395     keys = "C-q C?-k";
396     action = "sxed_frame_block_goto_end";
397     help = "go to the end of the block";
398   }
402 // ////////////////////////////////////////////////////////////////////////// //
403 section "tabulation setup" {
404   {
405     keys = "C-q C?-t";
406     action = "|t|sxed_frame_query_tab_size";
407     help = "set tab size";
408   }
409   {
410     keys = "C-k C?-t";
411     action = "|t|sxed_frame_keybind_script";
412     help = "toggle visual tabs mode";
413     arg0str = "self.visual_tabs = !self.visual_tabs; self.dirty = true;";
414   }
415   {
416     keys = "C-q C?-i";
417     action = "|t|sxed_frame_keybind_script";
418     help = "toggle autoindent mode";
419     arg0str = "self.autoindent = !self.autoindent;";
420   }
421   {
422     keys = "C-q tab";
423     action = "|t|sxed_frame_keybind_script";
424     help = "insert tab char";
425     arg0str = "self.insert_utf8(\"\\t\");";
426   }
429 // ////////////////////////////////////////////////////////////////////////// //
430 section "undo/redo" {
431   {
432     keys = "M-u";
433     action = "|w|sxed_frame_undo";
434     help = "perform \"undo\" action";
435   }
436   {
437     keys = "C-z";
438     action = "|w|sxed_frame_undo";
439     help = "perform \"undo\" action";
440   }
441   {
442     keys = "M-r";
443     action = "|w|sxed_frame_redo";
444     help = "perform \"redo\" action";
445   }
446   {
447     keys = "C-M-S-u";
448     action = "sxed_frame_clear_undo";
449     help = "wipe undo/redo history";
450   }
453 // ////////////////////////////////////////////////////////////////////////// //
454 section "text modification" {
455   {
456     keys = "ent";
457     action = "|wh|sxed_frame_autoindent_electro";
458     help = "insert new line with smart autoindent";
459   }
460   {
461     keys = "M-ent";
462     action = "|wh|sxed_frame_autoindent_simple";
463     help = "insert new line with simple autoindent";
464   }
465   {
466     keys = "S-ent";
467     action = "|wh|sxed_frame_autoindent_forced";
468     help = "insert new line with forced autoindent";
469   }
470   {
471     keys = "C-ent";
472     action = "|wh|sxed_frame_autoindent_none";
473     help = "insert new line without autoindent";
474   }
475   {
476     keys = "del | C-g";
477     action = "|w|sxed_frame_delete_char";
478     help = "delete characted under cursor";
479   }
480   {
481     keys = "bs | C-h";
482     action = "|w|sxed_frame_delete_char_back";
483     help = "delete characted before the cursor";
484   }
485   {
486     keys = "C-bs | C-w";
487     action = "|w|sxed_frame_delete_word_back";
488     help = "delete word before the cursor";
489   }
490   {
491     keys = "M-bs";
492     action = "|w|sxed_frame_delete_word_back_unindent";
493     help = "delete word before the cursor, or unindent";
494   }
495   {
496     keys = "C-y | C-S-y";
497     action = "|w|sxed_frame_delete_line";
498     help = "delete current line";
499   }
500   {
501     keys = "tab";
502     action = "|wt|sxed_frame_tab_indent";
503     help = "insert indenting spaces";
504   }
505   {
506     keys = "M-tab";
507     action = "|wh|sxed_frame_do_autocompletion";
508     help = "autocomplete current word for text frame";
509   }
510   {
511     keys = "M-tab";
512     action = "|wm|sxed_frame_do_autocompletion_filename";
513     help = "autocomplete filename for minibuffer";
514   }
515   {
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";
519   }
522 // ////////////////////////////////////////////////////////////////////////// //
523 section "miscelaneous" {
524   {
525     keys = "C-k S-1";
526     action = "|t|sxed_frame_toggle_readonly";
527     help = "toggle read-only flag for the current buffer (NOT FRAME!)";
528   }
529   {
530     keys = "C-k S-0";
531     action = "|t|sxed_frame_toggle_line_highlight";
532     help = "toggle line highlighting flag for the current frame";
533   }
534   {
535     keys = "C-k M-0";
536     action = "sxed_frame_toggle_global_line_highlight";
537     help = "toggle global line highlighting option";
538   }
539   {
540     keys = "C-q C?-h | M-q M?-h";
541     action = "|wt|sxed_frame_insert_function_header";
542     help = "insert function header comment";
543   }
544   {
545     keys = "C-q C?-j | M-q M?-j";
546     action = "|wt|sxed_frame_insert_tearline_comment";
547     help = "insert tearline comment";
548   }
549   {
550     keys = "C-q C?-f";
551     action = "|h|sxed_frame_incsearch_cursor_word";
552     help = "incremental search word under cursor";
553   }
555   {
556     keys = "M-e";
557     action = "sxed_frame_show_encoding_popup";
558     help = "select text encoding";
559   }
561   {
562     keys = "f2";
563     action = "|t|sxed_frame_save";
564     help = "save text frame";
565   }
567   {
568     keys = "S-f2";
569     action = "|t|sxed_frame_save_all";
570     help = "save all modified text frames";
571   }
573   {
574     keys = "C-k C-s";
575     action = "|t|sxed_frame_save_new_name";
576     help = "save current frame with name prompt";
577   }
579   {
580     keys = "M-S-f12";
581     action = "|t|sxed_frame_force_save";
582     //.help = "save text frame state";
583     help = "<hidden>";
584   }
586   {
587     keys = "f4 | M-r";
588     action = "|t|sxed_frame_show_replace_prompt";
589     help = "show search-and-replace prompt";
590   }
592   {
593     keys = "M-x M?-n";
594     action = "|h|sxed_frame_toggle_line_numbers";
595     help = "toggle line numbers";
596   }
599 // ////////////////////////////////////////////////////////////////////////// //
600 section "application keybinds" {
601   // M-x
602   {
603     keys = "M-x M?-c";
604     action = "sxed_app_command";
605     help = "quit application";
606     arg0 = XACT_Quit;
607   }
608   {
609     keys = "M-x M?-q";
610     action = "sxed_app_command";
611     help = "quit application";
612     arg0 = XACT_Quit;
613   }
615   {
616     keys = "M-x M-d";
617     action = "|t|sxed_app_command";
618     help = "duplicate frame";
619     arg0 = XACT_DupFrame;
620   }
621   {
622     keys = "M-x C-del";
623     action = "|h|sxed_app_command";
624     help = "close frame";
625     arg0 = XACT_CloseFrame;
626   }
627   {
628     keys = "M-x M?-m";
629     action = "|t|sxed_app_command";
630     help = "maximize/unmaximize frame";
631     arg0 = XACT_ToggleMaximize;
632   }
633   /*
634   {
635     keys = "M-x M?-/ | M-x M?-f1";
636     action = "|t|sxed_app_command";
637     help = "show help";
638     arg0 = XACT_ShowKeybinds;
639   }
640   */
642   // M-x
643   /*
644   {
645     keys = "M-x M-u";
646     action = "sxed_app_command";
647     //.help = "(debug) show undo log";
648     help = "<hidden>";
649     arg0 = XACT_ShowUndoLog;
650   }
651   */
652   {
653     keys = "M-x M-l";
654     action = "sxed_app_command";
655     help = "show message log";
656     arg0 = XACT_ShowMessageLog;
657   }
659   // no prefixes
660   {
661     keys = "M-S-ins";
662     action = "sxed_app_command";
663     help = "paste primary X11 selection";
664     arg0 = XACT_SelPastePrimary;
665   }
666   {
667     keys = "M-S-v";
668     action = "sxed_app_command";
669     help = "paste X11 clipboard selection";
670     arg0 = XACT_SelPasteClipboard;
671   }
672   {
673     keys = "M-0 | M-ins | M-grave";
674     action = "|h|sxed_app_command";
675     help = "show frame list popup";
676     arg0 = XACT_FrameList;
677   }
680 // ////////////////////////////////////////////////////////////////////////// //
681 section "project commands" {
682   {
683     keys = "M-f9";
684     action = "|t|sxed_app_command";
685     help = "compile project";
686     arg0 = XACT_RunCompile;
687   }
688   {
689     keys = "C-f9";
690     action = "|t|sxed_app_command";
691     help = "run project";
692     arg0 = XACT_RunProject;
693   }
694   {
695     keys = "S-f9";
696     action = "|t|sxed_app_command";
697     help = "build project";
698     arg0 = XACT_RunBuild;
699   }
701   // C-q
702   {
703     keys = "C-q M-f9";
704     action = "|t|sxed_app_command";
705     help = "edit project compile command";
706     arg0 = XACT_QueryRunCompile;
707   }
708   {
709     keys = "C-q C-f9";
710     action = "|t|sxed_app_command";
711     help = "edit project run command";
712     arg0 = XACT_QueryRunProject;
713   }
714   {
715     keys = "C-q S-f9";
716     action = "|t|sxed_app_command";
717     help = "edit project build command";
718     arg0 = XACT_QueryRunBuild;
719   }
723 // ////////////////////////////////////////////////////////////////////////// //
724 section "project grep" {
725   {
726     keys = "M-q f";
727     action = "|t|sxed_app_command";
728     help = "grep last used pattern";
729     arg0 = XACT_ProjectFindAgain;
730   }
731   {
732     keys = "M-q C-f";
733     action = "|t|sxed_app_command";
734     help = "grep word under cursor";
735     arg0 = XACT_ProjectFindWord;
736   }
737   {
738     keys = "M-q M-f";
739     action = "|t|sxed_app_command";
740     help = "grep declaration under cursor";
741     arg0 = XACT_ProjectFindDecl;
742   }
743   {
744     keys = "M-q S-f";
745     action = "|t|sxed_app_command";
746     help = "grep prompt";
747     arg0 = XACT_ProjectFindQuery;
748   }
752 // ////////////////////////////////////////////////////////////////////////// //
753 section "dvcs commits" {
754   {
755     keys = "C-k C?-ent";
756     action = "|t|sxed_app_command";
757     help = "commit project";
758     arg0 = XACT_Commit;
759   }
760   {
761     keys = "C-k C?-M-ent";
762     action = "|t|sxed_app_command";
763     help = "commit and push project";
764     arg0 = XACT_CommitPush;
765   }
769 // ////////////////////////////////////////////////////////////////////////// //
770 section "frame switching" {
771   {
772     keys = "M-x M-p";
773     action = "sxed_app_command";
774     help = "previous frame";
775     arg0 = XACT_PrevFrame;
776   }
777   {
778     keys = "M-x M-n";
779     action = "sxed_app_command";
780     help = "next frame";
781     arg0 = XACT_NextFrame;
782   }
783   /*
784   {
785     keys = "S-M-up";
786     action = "sxed_app_command";
787     help = "prevous frame";
788     arg0 = XACT_PrevFrame;
789   }
790   {
791     keys = "S-M-down";
792     action = "sxed_app_command";
793     help = "next frame";
794     arg0 = XACT_NextFrame;
795   }
796   */
800 // ////////////////////////////////////////////////////////////////////////// //
801 section "track switching" {
802   {
803     keys = "M-x M-b";
804     action = "sxed_app_command";
805     help = "previous track";
806     arg0 = XACT_PrevTrack;
807   }
808   {
809     keys = "M-x M-f";
810     action = "sxed_app_command";
811     help = "next track";
812     arg0 = XACT_NextTrack;
813   }
814   {
815     keys = "C-M-up";
816     action = "sxed_app_command";
817     help = "prevous track";
818     arg0 = XACT_PrevTrack;
819   }
820   {
821     keys = "C-M-down";
822     action = "sxed_app_command";
823     help = "next track";
824     arg0 = XACT_NextTrack;
825   }
829 // ////////////////////////////////////////////////////////////////////////// //
830 section "newbie commands" {
831   {
832     keys = "f1";
833     action = "|t|sxed_app_command";
834     help = "show help";
835     arg0 = XACT_ShowKeybinds;
836   }
840 // ////////////////////////////////////////////////////////////////////////// //
841 section "just blockers" {
842   // stop it to send '\x7f'
843   {
844     keys = "S-del";
845     action = "sxed_action_noop";
846     help = "<hidden>";
847   }
851 section "miscelaneous" [backend:tty] {
852   {
853     keys = "M-9";
854     action = "sxed_force_screen_repaint";
855     help = "<hidden>";
856   }
860 // ////////////////////////////////////////////////////////////////////////// //
862 section "script test" {
863   {
864     keys = "M-f10";
865     action = "|t|sxed_frame_keybind_script";
866     help = "script test";
867     arg0str = "self.buffer.insert(self.cursor_byteofs, \"!TEST!\\n\");";
868   }