Mary Bernard's Customization and Programming NotesKeyboard Customization Examples |
|
Here are a few examples, taken from my own keyboard customizations. `##' stands for a number in the keyboard table.
You can move the cursor to the previous phrase and next phrase, and highlight them, but in NB.KBD you can't delete or backdelete by phrase. Here are key definitions that let you do it:
; Backdelete phrase ##=yd,xd,df,pw,bx,s,e,b, , ,^,S,^,S,^,O,^,R,^,O,^,T,q2,cl,nw,df,rd
; Delete Phrase ##=yd,xd,df,bx,s,e, , ,^,S,^,S,^,O,^,R,^,O,^,T,q2,df,rd
The lines beginning with semicolons are comments. It's very useful to comment your changes.
NB zooms window size in 5% increments. To zoom in and out by 1% increments, you could add these two keys, and perhaps a third to return to 100% view (these are from J-P Takala):
##=bx,z,o,o,m, ,-,1,q2 ##=bx,z,o,o,m, ,+,1,q2 ##=bx,z,o,o,m, ,1,0,0,q2
To abandon a file without getting a message box asking if you want to save it:
##=bx,a,b,q2
To remove all hard page breaks from cursor position to end of file (and end by saying so, on the action line)
##=bx,c,i, ,/,*,P,G,*,/,/,q2,bc,P,G, ,c,o,d,e,s, ,r,e,m,o,v,e,d, ,f,r,o,m, ,h,e,r,e, ,t,o, ,e,n,d, ,o,f, ,f,i,l,e
To remove the punctuation mark at end of the word preceding the current word (e.g., change `keys, and' to `keys and'—useful if you do a lot of rewriting)
##=ql,qr,bc,s,e,b, , ,wa,ws,xc,qr,rc,qr,ch
Put a semicolon or comma at end of the word preceding the current word (e.g., changes `keys and' to `keys; and'). Can be used with any punctuation, but `co' must be used instead of an actual comma, since keyboard tables use commas as separators.
semicolon: ##=ql,qr,bc,s,e,b, , ,wa,ws,xc,qr,rc,;,qr,ch comma: ##=ql,qr,bc,s,e,b, , ,wa,ws,xc,qr,rc,co,qr,ch
Copy highlighted material to adjacent window; undefine in this one ##=as,cp,yd,as,gt,xd
See the CPG chapter on keyboard customization for more detailed coverage of the subject.
|