-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.krsrc
943 lines (754 loc) · 28 KB
/
.krsrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
#!krsrc dummy tag
# macro branching:
# +----------+-----------------------------------------------+
# | Operator | Action/Effect |
# +----------+-----------------------------------------------+
# | +>label | Branch to label if last function yields TRUE |
# | ->label | Branch to label if last function yields FALSE |
# | =>label | Branch unconditionally to label |
# | :>label | Define label |
# +----------+-----------------------------------------------+
# if label is not provided, the current macro is exited
[@startup] #***************************** === GLOBAL LOAD === *****************************
# === SWITCHES ===
#
# BOOLEAN
boxmode: YES # we like boxes!
editreadonly: NO # prevent editing of read-only files (adjunct to Clearcase,PVCS)
wordwrap: NO # NO is default
askexit: NO # YES to avoid exiting the editor by accident
softcr: YES # Get rid of funky CR response
case: NO # CASE INSENSITIVE searches
replacecase: YES # CASE SENSITIVE replaces
errprompt: YES # [allow]/prevent "press any key" sequence following error
beep:no
memusgink:yes
# langhilites:no # note that this will not affect any file loaded first at editor startup :-(
# TEXT
#tagfile:!tags
# NUMERIC
rmargin: 76
vscroll: 1
hscroll: 1
hscroll:20
vscroll:10
cursorsize:large
# luagcstep:10
# dialogtop:1
dt:= arg "dialogtop:invert" assign cancel
files:ctrl+q
exit:ctrl+4
qreplace:ctrl+5 # this key happens (20150126) to (erroneously) map to ctrl+] in ncurses
longline:alt+\
#ws:=arg "wordchars:nonwhite" assign
wc:=arg "wordchars:_" assign
wu:=arg "wordchars:-._~:/?#[]@!$&'()*+,;=%" assign
#ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
#Û Û
#Û === COLOR MACROS === Û
#Û Û
#Û Switch format: [backgndnib][foregndnib] Û
#Û Keep 'hgcolor' non-blinking!!! Û
#Û InfColor includes qreplace's locating string to be replaced Û
#Û Û
#Û Color: Blk:0 Blu:1 Grn:2 Cyn:3 Red:4 Pnk:5 Brn:6 LGr:7 Û
#Û DGr:8 LBl:9 LGr:A LCy:B LRd:C LPk:D Yel:E Wht:F (flash if bkgnd) Û
#Û Mono: Blk:0 LGr:7 ALL OTHERS = Wht ( >8 flashes if backgnd ) Û
#Û Û
#ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
colorerr : 4f
colorinf : 5e
colorinf : e0
#colornoise : 0a
colorsta : 2f
# TAB <--> SPACE conversion parameters (pertains TO MODIFIED LINES ONLY!)
realtabs:no #tabs expanded into spaces
tabwidth:4
graphic:tab # easy access to tab-insertion
tabalign:yes
realtabs:yes
ts0:=cancel arg "trailspace:no" assign
ts1:=cancel arg "trailspace:yes" assign
ta0:=cancel arg "tabalign:no" assign
ta1:=cancel arg "tabalign:yes" assign
rt0:=cancel arg "realtabs:no" assign
rt1:=cancel arg "realtabs:yes" assign
et0:=cancel arg "entab:0" assign
et1:=cancel arg "entab:1" assign
et3:=cancel arg "entab:3" assign
r0e0:=cancel rt0 et0
r0e1:=cancel rt0 et1
r1e0:=cancel rt1 et0
r1e1:=cancel rt1 et1
mfr:=cancel mfreplace
mfrx:=cancel arg arg mfreplace
bdm4:=cancel rt0 arg "blankdispmask:4" assign
unix:=cancel arg seteol
dos:=cancel arg arg seteol
# forceplateol:yes # sledgehammer
cal:=cancel arg "https://calendar.google.com/" setfile
kp:=cancel arg "https://keep.google.com/" setfile
con:=cancel arg "<console>" setfile
wr:=cancel arg "<most_recently_written_files>" setfile
here:=PwdHistFiles
# an autostart macro that changes fgcolor colors overrides the extension-specific
# color setings for the first file in a way that looks like a BUG
# autostart:=setcolor
# autostart:=kbfast
nobadeol:=replace "" nl "" nl # BUGBUG doesn't work
nobadeol:alt+0
log:=cancel arg "logflush:yes" assign arg "${K_LOGFNM}" setfile endfile
st:=savetmpfile
nl:=newline
nln:=newline <n
# tab:tab
comf:=arg "<compile>" setfile
a:=cancel arg "<ascii>" setfile
# kk:=comf arg "kk" compile
# kk_cmd:="kk.pl && regr_test"
# kk_outf:=
kk_compil:=cancel saveall arg arg kk_cmd execute <Y arg "kk_setout:shift+F5" assign
kk_setout:=cancel arg kk_outf setfile arg "kk_compil:shift+F5" assign
kk_compil:shift+F5
netstat:=comf arg "netstat -o -n -a" compile
tree:=comf arg "tree" compile
treef := comf arg "tree /f" compile
# dif := comf arg "dif" compile
dv := arg "GUI> dbgview.exe" runchild
gv := arg "CON> c:/klg/scripts/gv.bat" runchild
anno := arg "EMBSHELL> svn annotate $%" runchild
shenv := arg "EMBSHELL> set" runchild
#csort:alt+8
# quik:ctrl+a
lua:alt+L
# killall:pause
sysscripts:=arg "${K_SCRIPTS}/_system/${COMPUTERNAME}*.*" setfile
# cursor move to end (top/bottom) of current-indent zone (ctrl+shift+up/down)
mib:ctrl+shift+up
pib:ctrl+shift+down
tabs:=arg "tabconv:1" assign arg "Realtabs:yes" assign arg "now tabs" message
spcs:=arg "tabconv:0" assign arg "Realtabs:no" assign arg "now spcs" message
# TouchAll - Touch (modify benignly) all nonblank lines
TouchAll:=savecur begfile arg arg replace "^?" nl "\$0" nl restcur
noTabs:=spcs TouchAll
noSpcs:=tabs TouchAll
col1:=meta begline
colchar1 := col1 begline
cola:=meta begline begline
mv0:= begfile begline "mv -n " arg begline ppara vrepeat ppara begline "m3u"
? :=->false arg "True" message => :>false arg "False" message
! := Meta Message
show_asgn:=_spush _sdup arg _spop assign arg _spop !
c :=cancel arg "case:INVERT" show_asgn
cy:=cancel arg "case:YES" show_asgn
cn:=cancel arg "case:NO" show_asgn
um:=cancel arg "usemouse:YES" show_asgn
nm:=cancel arg "usemouse:NO" show_asgn
tell_loop:= :>again tell =>again
restcur:alt+center
# selkeymap
left:sel_s
right:sel_d
pword:sel_f
mword:sel_a
selkeymaptogl:sel_q
# https://en.wikipedia.org/wiki/Arrow_keys#HJKL_keys (vi)
left :sel_h
down :sel_j
up :sel_k
right :sel_l
# extensions
mword :shift+sel_h
ppara :shift+sel_j
mpara :shift+sel_k
pword :shift+sel_l
mak:=arg "*.mak" find
tree:=arg "." find
endlesstree:= :>start tree waitcompiledone =>start
# all:=arg "*" find
# foo:=arg "foo" find
# arg "*.cpp" find
# arg "*.bat" find
# arg "*" find
# arg "atlogin.bat" find
# arg "$(*.c|*.cpp|*.h|*.asm)|" setfile
# arg "$(*.c;*.cpp;*.h;*.asm)|" setfile
cpp:= arg arg "\s*#(if|endif|else|elif|ifdef|ifndef)" grep
testmac1:= qreplace "`" nl "'" nl <a # doesn't work: macro.cpp code looks for prompt code in nl macro code
testmac2:= qreplace "`" newline "'" newline <n # works: macro.cpp code finds prompt in inline macro code
testmac3:= qreplace "`" nln "'" nln # works: macro.cpp code finds prompt in nln macro code
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#° === GLOBAL Key Reassignments === °
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#newcancel:=cancel setwindow
#newcancel:esc
#
# FUNCTION KEYS (<F1>,<Alt+F1> & <Ctrl+F1>)
#
Nextmsg:alt+n # leave key directly assigned to nextmsg so there is easy access to nextmsg variants
# PrevMsg:=arg "-1" nextmsg
PrevMsg:alt+p
setnextmsg:=arg arg arg meta nextmsg
setnextmsg:F5
# copy:alt+/ # laptop
ldelete:alt+; # laptop
#window: `
window: F6
metanoedit:=meta noedit # only affect current file
metanoedit: F8
Meta: F9
Arg: F10
lasttext_endl:=lasttext endline
lasttext_endl:alt+d
lastselect:alt+s
mlines:shift+up
plines:shift+down
jhp:=meta mpara ppara pword savecur justify restcur down arg justify up
jhp:ctrl+J
#
# ARG & BLOCK><Clipboard functions
#
arg :num/
#tag:shift+center
ta :=arg "<textargs>" setfile
mfs:=arg "<mfspec>" setfile
mf :=mfs
mfx:=cancel arg "mffile:=" curfile assign arg "mffile updated" message
mfx:alt+m
del_no_clip:=delete
del_no_clip:del
exitsaveall:=cancel exit <A
# exitsaveall:alt+f4
clip:=cancel arg "<clipboard>" setfile
# clip:alt+y
#
# CURSOR/File movement
#
# CisQuote macro: for quoting CIS emails
cq:= " " justify left left left ">> " delete delete delete arg arg \
left left left meta ppara up vrepeat
# xbak := arg "\.kbackup" strip arg "\Backup\" strip arg "\.hg\" strip arg "\.git\" strip arg "\.svn\" strip
xbak := arg ds ".kbackup" ds strip arg ds "Backup" ds strip arg ds ".hg" ds strip arg ds ".git" ds strip
unsigned:= replace "unsigned char" nl "uint8_t" nl \
replace "unsigned short" nl "uint16_t" nl \
replace "unsigned long" nl "uint32_t" nl
# deltalogtm:alt+f8
curline2wintop:=cancel arg Plines
curline2wintop:Shift+Home
curline2winbottom:=cancel arg Mlines
curline2winbottom:Shift+End
con:=arg "<console>" setfile endfile
env:=arg "<env>" setfile
# env:Alt+E
#tag:ctrl+m
mark:ctrl+g
Refresh:Ctrl+R #File Refresh analogous to Norton Commander's 'reread disk'
# meta up = top of window# meta down = bottom of window
topOfWindow:= meta up
topOfWindow: alt+up
bottomOfWindow:= meta down
bottomOfWindow: alt+down
mpara:ctrl+up
ppara:ctrl+down
pparap:=ppara ?
pparap:shift+pgdn
mparap:=mpara ?
mparap:shift+pgup
conmsg1 := con endfile arg ">" msearch msearch down col1 # used in kc.bat!
macdone:=arg arg "macro done" message
#selword: selects the word at the cursor (or before cursor if not on a word)
selword:=pword ->eof mword arg pword => :>eof mword pword arg pword
selword:ctrl+center
selword:ctrl+space
selword:alt+ins
selword:ctrl+f10
#selindent: selects a column in the whitespace of the indent of the block in which the cursor currently resides
selindent:= mib -> cola arg pib left # mib+pib ordered so cursor left at TOP of ib (so pastes afterwards work logically)
selindent:ctrl+space
qword:=selword ldelete """""" left paste
qword:alt+q
m2f:=arg arg "{:i#}:b*\::b*{:i#}" psearch
m2sw:=arg arg replace "{:i+}:b*\::b*{:i+}" nl "$2 $1" nl
# Delete the current word and execute it
expand:=selword lasttext cancel lastselect meta sdelete lasttext execute
#expand:ctrl+space
with_nothing :=nl arg nl <Y # to complete 'replace' fxn
repeat:ctrl+enter
#recordvalue:ctrl+@
go:=arg "Testing: hit <ctrl+break> to break out" message :>begin recordvalue =>begin
# test mfgrep
#recordvalue:=arg "cache:no" assign arg "mov" mfgrep
num:="@begin(numbered)"
aligncol:alt+a
flipcase:alt+c
grep:ctrl+F3
oldgrep:=grep
oldgrep:ctrl+F4
fgrep:=fg
lblankdel:alt+o
topOfSearchlog:=arg "1" searchlog
topOfSearchlog:alt+F3
reverse:ctrl+s
swapline:alt+z
vrepeat:alt+v
MakeBox:alt+Num/
hike:25
# ctrl+bksp does not decode in ncurses ubuntu 14.04, so we remap
undo:ctrl+e
redo:ctrl+r
copy:ctrl+k
# splitcompilewnd25pct := arg "<compile>" splitwnd25pct
#mfgw:=_spush splitcompilewnd25pct arg _spop mfgrep
#mfgw:shift+F4
mfgrep:shift+F4
njustify:= justify begline
njustify:ctrl+b
# npj=NumberedParaJustify
npj:=mpara justify pword down arg justify
# remove file from <info-file>
zap:=dirty +>cant arg refresh => :>cant arg "can't remove: file is dirty" message
test2:= arg cur_h_m_s message
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#° === TOGGLERS === °
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
# obsolete because Begline now implements this exact behavior (but macro still works too!)
#toggle_begline:= Begline +> meta Begline # togl between leftmost nonblank (first) and col 0
#toggle_begline:home
asnMsg:= message arg lasttext assign
tabconvsome:=cancel arg "tabconv:1" assign arg "tabconvnone:shift+tab" assign
tabconvnone:=cancel arg "tabconv:0" assign arg "tabconvsome:shift+tab" assign
tabconvsome:shift+tab
softcrtogl:= cancel arg "softcr:invert" assign
i:=softcrtogl # mnemonic: toggle (auto)Indent
wwraptogl:= cancel arg "wordwrap:invert" assign
# wwraptogl:alt+w
#bak:=arg "backup:bak" assign arg "BAK" message
noundel_on:= cancel arg "backup: none" asnMsg arg "noundel_off:alt+q" assign
noundel_off:=cancel arg "backup: undel" asnMsg arg "noundel_on :alt+q" assign
noundel_on:alt+q
argselkeymap:ctrl+a # laptop
# box :=boxstream +>nxt boxstream :>nxt Arg "ldelete:Num-" Assign
# stream:=boxstream ->nxt boxstream :>nxt Arg "sdelete:Num-" Assign
# set_box:= box arg "BOX mode" message \
# arg "set_stream:alt+b" assign
# set_stream:=stream arg "STREAM mode" message \
# arg "set_box:alt+b" assign
# set_stream: alt+B # "initial state"
boxstream:alt+B
hoist:=cancel colchar1 arg setwindow
hoist:ctrl+H
beta:="á"
formfeed:=""
# so we don't modify the file:
#metapbal:=meta pbal +> arg "balancing {+( not found" message
#metapbal:ctrl+]
#argpbal:= arg pbal +> arg "balancing )+} not found" message
balch:ctrl+9
balln:ctrl+[
# close all windows except the one the cursor is currently in:
1window:= :>nxtwin window -> meta window =>nxtwin
1window:alt+1
1w:=1window # alias
newhelp:=cancel arg "<CMD-SWI-Keys>" setfile
newhelp:alt+h
# cur_y4md " kgoodwin "
dttag:=cur_y4md_hm " " cur_dow3
dttag:Ctrl+D
compile:ctrl+z
accbuf:=Arg "<acc>" Setfile
accum:=Copy accbuf Endfile Paste Setfile
#accum:alt+num+
#sumcol:alt+=
clrbuf:=Begfile Arg Endfile meta delete ldelete Begfile setfile
clraccbuf:=accbuf clrbuf
pybp:="import pdb; pdb.set_trace()" # see https://github.com/spiside/pdb-tutorial#the-5-pdb-commands-that-will-leave-you-speechless
pdbhelp:=cancel arg "https://github.com/spiside/pdb-tutorial#the-5-pdb-commands-that-will-leave-you-speechless" setfile
python_insert_breakpoint:= pybp pdbhelp
index:=Arg "<maintain-deleted>" setfile Arg arg "!ix/d|sort +1" paste
#compileCurrFile:=cancel saveall arg compile arg "<compile>" setfile
#compileCurrFile:F12
#copymsgs:=copy arg "<compile>" setfile begfile endfile ->paste begfile arg endfile :>paste paste nextmsg
#copymsgs:F12
# FILE edit check
rdonly:=meta noedit +>edtble Arg "File is EDITABLE" ! =>end :>edtble Arg "File is EDITABLE" ! :>end meta noedit
bcc:= "/* " # C comments
ecc:=endline " */"
c2ansi:=replace "/*" nl "//" nl lastselect replace "*/" nl arg <y nl
# c2ansi:alt+y
cliptext:alt+y
##########################################################################################
#
# http://www.sfwriter.com/wordstar.htm sel-mode
#
# sel-mode:=arg " "
# sel-mode:tab
#
# WordStar adopted ^E, ^S, ^D, and ^X. Again, looking at a typewriter keyboard
# makes the logic of this plain. These four keys are arranged in a diamond under
# the left hand:
#
# E
# S D
# X
# up:sel_e
# down:sel_x
# left:sel_s
# right:sel_d
#
# Such positional, as opposed to alphabetic, mnemonics form a large part of the
# WordStar interface. Additional cursor movement commands are clustered around
# the E/S/D/X diamond:
#
# W E R
# A S D F
# Z X C
# mword:sel_a
# pword:sel_f
# mlines:sel_w
# plines:sel_z
# mpage:sel_r
# ppage:sel_c
#
# ^A and ^F, on the home typing row, move the cursor left and right by words. ^W
# and ^Z, to the left of the cursor-up and cursor-down commands, scroll the screen
# up and down by single lines. ^R and ^C, to the right of the cursor-up and
# cursor-down commands, scroll the screen up and down a page at a time (a "page"
# in the computer sense of a full screen of text).
#
##########################################################################################
# quik:ctrl+' # experimental version of an old ws.dll extension
mrvnote:=cancel Arg "${K_NOTES_DIR:-${HOME:-${USERPROFILE}}\klg\pers}" SwitchToMostRecentlyViewedFileInTree
mrvnote:Alt+2
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#° === QUICK FILE ACCESS === °
#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
#
# Alt+3 NO META: CURRENT FILENAME->prompt META: FULL PATH OF CURRENT FILE->prompt
# Gives you the name of the current file on the prompt line
# (meta gets you the FULL PATH, no meta gives you just the filename)
# edf:=meta +>lcl arg curfile =>rl :>lcl arg curfilename curfileext :>rl cancel lasttext endline
edf:=arg curfile endline
edf:Alt+3
notesdnm:="${K_NOTES_DIR:-${HOME:-${USERPROFILE}}/my/repos/pers}/"
kdb:=arg notesdnm "*.kdb" setfile
tslog:=endfile emacsnewl begline cur_y4md_hm " " cur_dow3
worklog:=cancel Arg notesdnm "work.kdb" SetFile
worklog:= meta arg cur_y4 "_wk" cur_woy ".log" SetFile -> tslog
# worklog:Alt+4
searchhomeserver:Alt+4
ddgrg:ctrl+6
diary:=cancel Arg "${K_DIARY_FILE:-${K_NOTES_DIR:-${HOME:-${USERPROFILE}}/my/repos/pers/daily_notes.kdb}}${K_NOTES_DIR:+/daily_notes.kdb}" SetFile -> tslog
diary:Alt+5
exts :=arg "%.[^.\\]+$" matches
#*************************************************************************
recbegin:= cancel arg "<record>" splitwnd25pct arg "endRecording:alt+r" assign lasttext message record
endRecording:=record 1window arg "recbegin:alt+r" assign
recbegin:alt+r
#endRecording:=record 1window arg "recbegin:alt+r" assign
#recbegin:alt+r
zkeys:=arg "z_key_assignments" initialize
#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
cp_to_mf := cancel begfile arg endfile copy mf endfile paste
wcchasm := arg "*.h|" setfile cp_to_mf \
arg "*.i|" setfile cp_to_mf \
arg "*.c|" setfile cp_to_mf \
arg "*.asm|" setfile cp_to_mf \
arg "*.config|" setfile cp_to_mf \
mfx
filter_srcs := begfile begline \
arg "\.kbackup" strip \
arg "\Doxyfile" strip \
arg "\UTEST\" strip \
arg "\SSA_UnitTest\" strip \
arg "\UnitTests\" strip \
arg "\TargetTests\" strip \
arg arg "%.vcproj$" strip \
arg arg "%.sln$" strip \
arg arg "%.libs?$" strip \
arg arg "%.a?a?a$" strip \
mfx setfile
stripdotdirs := cancel arg arg "[/\]%..+[/\]" strip
s.d := stripdotdirs
srcs := arg "<srcs>" ww filter_srcs arg "case:yes" assign
srcs_rl := arg "<srcs_rl>" ww filter_srcs
#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
ftab:ctrl+tab
cd2file:=cancel arg meta curfilepath setfile # set cwd to dir of current file
cd:=cd2file invalidate_tags
# cd:=cd2file dropfile invalidate_tags # preferred, but dropfile has not been written yet
tf:=cancel readtagsfile -> arg "<tagged-files>" setfile
eth:= cancel arg "http://www.speedtest.net/" setfile \
cancel Arg notesdnm "etheric.kdb" setfile endfile emacsnewl begline cur_y4md "_" cur_hms " ping,down,up = mS, Mbs, Mbs (from my laptop using Ubiquiti WLAN)"
#
# ALT+#key (Alt+1, ..., Alt+9, Alt+0)
#
# initfilemenu:Alt+1
# systemfilemenu:Alt+2
[menu]
menu:alt+m # allframes = MACRO> arg arg "[0-9][0-9][0-9][rt]x" grep
listmenu:=arg "Lists/Logs" menu
# listmenu:alt+L
pseudomenu:=arg "Pseudo" menu
pseudomenu:alt+,
[os.win32]
# Windows OEM charset:
# 0xF9 (centered dot, strong)
# 0xFA (centered dot, faint)
trailspace:no
traildisp: 0xFA
# tabdisp: <
# tabdisp: -
# tabdisp: ^
# tabdisp: *
# tabdisp: >
tabdisp: 0xF9
# savescreen:ctrl+k
towinclip:ctrl+num+
resize:alt+w
usemouse:yes
# arg:tab # this breaks Linux/X paste which types literal chars into the editor
ds:="\"
[os.linux]
brightfg:yes
ds:="/"
trailspace:no
traildisp: ?
# tabdisp: -
# tabdisp: <
# tabdisp: ^
tabdisp: >
cmdn:=arg arg "^cmd\d" grep
grepm4:=arg "./test/_m4ex:" grep
[z_key_assignments] # base on historical_scans_fair_use\Z-cleaned.TXT
arg: ctrl+x
assign: ctrl+6
backtab: shift+tab
begline: end
cancel: ctrl+c
cdelete: bksp
cdelete: ctrl+h
compile: ctrl+u
curdate: alt+d
# curday: unassigned
# curfileext: unassigned
# curfilenam: unassigned
curtime: alt+t
# curuser: unassigned
down: down
emacscdel: ctrl+bksp
# emacsnewl: unassigned
endline: pgdn
exit: f9
files: f1 # Z name: information
home: home
initialize: f2
# insertmode: ctrl+n
ldelete: ctrl+f
left: left
linsert: ctrl+d
mark: ctrl+p
meta: esc
mlines: ctrl+w
mpage: ctrl+q
mpara: ctrl+pgup
msearch: ctrl+e
# mword: unassigned
newline: enter
newline: ctrl+m
pbal: ctrl+v
copy: ctrl+k # Z name: pick
plines: ctrl+t
ppage: ctrl+l
ppara: ctrl+pgdn
psearch: ctrl+r
# push: ctrl+z # Z: run command text in shell
paste: ctrl+g # Z name put
# pword: unassigned
qreplace: ctrl+enter
qreplace: ctrl+j
# quote: unassigned
refresh: f10
replace: ctrl+o
# restcur: unassigned
right: right
# savecur: unassigned # Z name savecurs
sdelete: ctrl+s
setfile: ctrl+b
setwindow: ctrl+]
sinsert: ctrl+a
tab: tab
tab: ctrl+i
up: up
window: ctrl+y
#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
#ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
#Û === FILE EXTENSION TAGS === Û
#ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
#ÛColor: Blk:0 Blu:1 Grn:2 Cyn:3 Red:4 Pnk:5 Brn:6 LGr:7 Û
#Û DGr:8 LBl:9 LGr:A LCy:B LRd:C LPk:D Yel:E Wht:F (BRIGHT if bkgnd)Û
#ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
[ftype:krsrc]
wordchars:_
hljoinchars: :.
[ftype:unknown] # USED IF NO EXISTING FILE-EXTENSION TAGS MATCH
wordchars:_
hljoinchars:_.
[ftype:markdown]
wordchars:_-/.:
[ftype:log]
wordchars:_-/.:
[ftype:cmake]
wordchars:_-.
[ftype:sprintascii]
wordchars:_
hljoinchars: :.
wordwrap:yes
rmargin:77
[ftype:sql]
[ftype:msbatch]
wordchars:$_
hljoinchars: :.
tabwidth:8
[ftype:wildcard] # wildcard expansion
wordchars:_
hljoinchars:_
wucminlen:2
[ftype:pseudo] # wildcard expansion
wordchars:_
hljoinchars:_
[ftype:lua]
wordchars:_
hljoinchars: :.
rmargin:80
[ftype:bash]
wordchars:_
hljoinchars: .
[ftype:tex]
wordchars:_
rmargin:132
[ftype:expect]
wordchars:_
hljoinchars: .
rmargin:80
[ftype:perl]
wordchars:@$%
hljoinchars: .>
rmargin:80
[ftype:make]
wordchars:_
hljoinchars:_
#graphic:tab # using GNU make, we need ability to insert literal tabs
tabwidth:8
entab:leading # ... whitespace converted to tabs
[.cod]
wordchars:_
tabwidth:8
hl:=arg arg "(?-i)^\s+(if|else|for|while|do).*$" searchall
[.list]
[.journl]
jentry:=endfile begline cur_y2md " " cur_hms " "
jentry:alt+j
[ftype:pascal]
wordchars:_
hljoinchars: .^
rmargin:100
[ftype:modula2]
wordchars:_
hljoinchars: .
[ftype:asm]
wordchars:_
hljoinchars: .
call:=savecur arg "call" searchall restcur
rmargin:100
[ftype:xml]
delims: <
[ftype:python]
wordchars:_
hljoinchars: .
wucminlen:1
[ftype:diff]
wordchars:_
hljoinchars:_
[ftype:pwrshell]
wordchars:_-
[ftype:clang]
wordchars:_
hljoinchars: :.>
wucminlen:1
#dquc:alt+4
#IdentDelim:,.:#()[]{}<>'"+-*/%&|^$#@!=
#tabwidth:3
tabwidth:4
# fxh:=arg arg "!fxnhdr" paste
# flh:=arg arg "!flhdr" paste
rmargin:80
# decb:=replace "for (" nl "for(" nl replace "if (" nl "if(" nl replace "while (" nl "while(" nl
#
# this elegant macro causes the name of the include file to be
# inserted into the include file (at the current cursor position)
#
# Fixed: this is because "arg execute" takes a NULLEOL arg
# 21-Apr-1993 klg Changed "execute" attribute to NULLEOW
#
#include:= arg arg "[<\"]" psearch cancel right savecur arg arg "[>\"]" psearch arg restcur setfile <N
#- Expand macros:
#- newblock:=begline down tab linsert "}" begline linsert "{"
#- for :=right backtab "for( " savecur "init# while# eachTime )" newblock restcur
#- while:=right backtab "while( )" left savecur newblock restcur
#- if:=right backtab "if( )" left savecur newblock restcur
#- else:=right backtab "else" newblock
l0:= arg arg "^[~ \t]" grep
fnhd:= arg arg "^(:i:b)*:i\(" grep # finds all function decl lines
nwblock:=tab linsert "}" begline linsert "{"
nwblock:alt+]
# bcc:alt+,
# ecc:alt+.
[.txt]
nofor:=cancel replace "" nl "'" nl replace "" nl """ nl replace "" nl """ nl
rmargin:80
join:= begline endline arg delete
join:num*
nxtspceol:=arg arg "\s$" psearch
nxtspceol:num/
joinallspeceol:= :>again nxtspceol -> join =>again
[ftype:kdb]
rmargin:80
# mfspec_:= "%~dp0*%~x0" works but stickiness confuses tags-file (<tagged-files>)-based mfgrep behavior.
[ftype:awk]
wordchars:_
hljoinchars:_
#IdentDelim:,.:#()[]{}<>'"+-*/%&|^$#@!=
rmargin:100
[.fclog]
tmd:=arg arg "^\d{8}:\d{6}.\d{6}" grep
[.tabbed]
tabwidth:3
realtabs:yes
tabconv:2
tabalign:yes
[test]
#
# GetMac - Load a file of macros or assignments.
#
# Usage: Arg 'file' GetMac where <file> is the base name of
# a file in the INIT directory
#
GetMac := cancel lasttext begline "${INIT}" endline ".MAC" \
setfile <n +>Ok lasttext begline \
"Can't find \"" endline "\"" message => \
:>Ok begfile arg endfile assign -> arg refresh
# given
# ------------------------------------------
# See
#
# this that the other
# and more still
# ------------------------------------------
#
# I want
# ------------------------------------------
# See this that the other and more still
# ------------------------------------------
#
see:= arg arg "See$" psearch -> arg ppara endline endline justify ppara
see:alt+f