;*
;**** Zed - configuration file for X-window
;*
;*  ^=control key, #=shift key, @=alt key

set font 8x13bold

;*
;* ***** Cursor movement *****
;*

key \ff1B    e_escape   ; Esc     - escape command

key \wFF54   c_down     ; Down ;*  Arrows - move cursor
key \wff52   c_up       ; Up
key \ff53    c_right    ; Right
key \ff51    c_left     ; Left

key \ff56    p_down     ;*  PgDn   - move cursor down one page
key \ff55    p_up       ;*  PgUp   - move cursor up one page
key \ff57    g_eol      ;*  End    - goto end of line
key \wFF60   g_eol      ; End HP
key \ff50    g_sol      ;*  Home   - goto start of line

key \04000071\04000073 g_sol       ;*  ^Q^S   - goto start of line
key \04000071\04000064 g_eol       ;*  ^Q^D   - goto end of line
key \04000071\04000065 g_sos       ;*  ^Q^E   - goto start of screen
key \04000071\04000078 g_eos       ;*  ^Q^X   - goto end of screen
key \04000071\04000072 g_sof       ;*  ^Q^R   - goto start of file
key \04000071\04000063 g_eof       ;*  ^Q^C   - goto end of file
key \04000071\04000062 g_sob       ;*  ^Q^B   - goto start of block
key \04000071\0400006B g_eob       ;*  ^Q^K   - goto end of block
key \04000071\04000074 g_c2sos     ;*  ^Q^T   - current to start of screen
key \04000071\04000076 g_c2eos     ;*  ^Q^V   - current to end of screen
key \04000071\04000067 g_c2mos     ;*  ^Q^G   - current to middle of screen
key \04000071\0400006C g_line      ;*  ^Q^L   - goto line #
key \04000071[         g_parent    ;*  ^Q [   - goto parenthesis
key \04000071]         g_parent    ;*  ^Q ]   - goto parenthesis
key \04000071\04000075 g_function  ;*  ^Q^U   - goto C function
key \0400006B0         g_set0      ;*  ^K 0   - set mark 0
key \0400006B1         g_set1      ;*  ^K 1   - set mark 1
key \0400006B2         g_set2      ;*  ^K 2   - set mark 2
key \0400006B3         g_set3      ;*  ^K 3   - set mark 3
key \040000710         g_go0       ;*  ^Q 0   - goto mark 0
key \040000711         g_go1       ;*  ^Q 1   - goto mark 1
key \040000712         g_go2       ;*  ^Q 2   - goto mark 2
key \040000713         g_go3       ;*  ^Q 3   - goto mark 3
key \wFFC7             g_menu      ;*  F10    - menu
key \wFFBE   f_select "<h" e_enter ;*  F1     - open help window

key \0400FF55   g_sof      ;*  ^PgUp  - goto start of file
key \0400FF56   g_eof      ;*  ^PgDn  - goto end of file
key \0400FF50   g_sos      ;*  ^Home  - goto start of screen
key \0400FF57   g_eos      ;*  ^End   - goto end of screen
key \0400FF51   g_pwr      ;*  ^Left  - goto previus word
key \0400FF53   g_nwr      ;*  ^Right - goto next word
key \0400FF52   g_sdown    ;*  ^Up    - scroll down
key \0400FF54   g_sup      ;*  ^Down  - scroll up
key \0400FF60   g_eos      ; ^End   - goto end of screen HP

; block extension by cursor

key \0100FF54   b_setpnt c_down  b_cresize ; #Down
key \0100FF52   b_setpnt c_up    b_cresize ; #Up
key \0100FF53   b_setpnt c_right b_cresize ; #Right
key \0100FF51   b_setpnt c_left  b_cresize ; #Left
key \0100FF56   b_setpnt p_down  b_cresize ; #PgDn
key \0100FF55   b_setpnt p_up    b_cresize ; #PgUp
key \0100FF57   b_setpnt g_eol   b_cresize ; #End
key \0100FF60   b_setpnt g_eol   b_cresize ; #End HP
key \0100FF50   b_setpnt g_sol   b_cresize ; #Home

key \0500FF55   b_setpnt g_sof   b_cresize ; #^PgUp  - goto start of file
key \0500FF56   b_setpnt g_eof   b_cresize ; #^PgDn  - goto end of file
key \0500FF50   b_setpnt g_sos   b_cresize ; #^Home  - goto start of screen
key \0500FF57   b_setpnt g_eos   b_cresize ; #^End   - goto end of screen
key \0500FF60   b_setpnt g_eos   b_cresize ; #^End   - goto end of screen HP
key \0500FF51   b_setpnt g_pwr   b_cresize ; #^Left  - goto previus word
key \0500FF53   b_setpnt g_nwr   b_cresize ; #^Right - goto next word
key \0500FF52   b_setpnt g_sdown b_cresize ; #^Up    - scroll down
key \0500FF54   b_setpnt g_sup   b_cresize ; #^Down  - scroll up

;*
;* ***** Editing *****
;*

key \wFFFF     e_canc    ;*  Canc   - delete character under the cursor
key \1000FF73  e_canc    ; Canc HP
key \wFF08     e_bkspc   ;*  BackSpace - delete character at the left of the cursor
key \FF0D      e_enter   ; Enter
key \04000079  e_delline ;*  ^Y     - delete row
key \wFF63     l_instog  ;*  Ins    - toggle insert/overwrite mode
key \1000FF72  l_instog  ; Ins  - toggle insert/overwrite HP

key \0400006B\04000064 e_deleol   ;*  ^K^D   - delete from cursor to EOL
key \0400006B\0400006A e_restore  ;*  ^K^J   - restore line
key \0400006B\04000075 b_resdelb  ;*  ^K^U   - unerase line
key \0400006B\04000074 f_killtab  ;*  ^K^T   - kill all tab in current file

key \04000063\04000063 e_putcode  ;*  ^C^C   - insert coded codes (enter ends)
key \04000063\04000069 e_inscode  ;*  ^C^I   - insert codes (enter ends)
key \04000063\04000068 e_hexcode  ;*  ^C^H   - insert hex code(s)

key \08000031          e_toupper  ;*  @1     - char toupper
key \08000032          e_tolower  ;*  @2     - char tolower
key \08000033          e_flipcase ;*  @3     - char flip case
key \04000071\04000070 l_autosave ;*  ^Q^P   - set autosave
key \0800FF0D          e_senter   ;*  @Enter - soft enter
key \0400FF08          e_deind    ;*  ^BackSpace - deindent row

;*
;* ***** File Selector *****
;*

key \04000061  e_openall ;*  ^A     - open all files
key \0400006E  e_hexopen ;*  ^N     - open file in binary mode
key \04000074  e_roopen  ;*  ^T     - open file in readonly mode

;*
;* ***** Macro *****
;*

key \04000073\04000073 e_stmacro  ;*  ^S^S   - start macro
key \04000073\04000072 e_recmacro ;*  ^S^R   - record macro
key \04000073\04000061 e_abmacro  ;*  ^S^A   - abort macro
key \04000073\04000077 e_wrmacro  ;*  ^S^W   - write macro

;*
;* ***** File/Window *****
;*

key \wFFBF             f_savefile   ;*  F2     - save file
key \0400006B\04000073 f_savefile   ;*  ^K^S   - save file
key \04000066\04000073 f_savefile   ;*  ^F^S   - save file
key \04000066\04000074 f_savemodif  ;*  ^F^T   - save all file
key \0400006b\04000078 f_savefile  w_qquit  ;*  ^K^X   - save/exit single file
key \0400006B\0400007A f_savemodif w_qquita ;*  ^K^Z   - saveall modified/exitall

key \wFFC0             f_fileld    ;*  F3     - open file
key \04000066\0400006F f_fileld    ;*  ^F^O   - open file
key \04000066\04000075 f_filesb    ;*  ^F^U   - file substitution
key \0400006B\04000071 w_qquit     ;*  ^K^Q   - query quit
key \04000066\04000072 f_qreload   ;*  ^F^R   - file reopen with query

key \0400006B\04000065 f_chname    ;*  ^K^E   - change filename
key \04000066\04000065 f_chname    ;*  ^F^E   - change filename
key \04000071\04000071 w_qquita    ;*  ^Q^Q   - quit all with query
key \04000066\0400006E w_bufnext   ;*  ^F^N   - select next buffer
key \04000066\04000070 w_bufprev   ;*  ^F^P   - select previous buffer
key \04000066\0400006D w_bufsel    ;*  ^F^M   - select buffer

key \wFFC2 w_zoom                  ;*  F5     - zoom/unzoom window
key \04000077\0400007A w_zoom      ;*  ^W^Z   - zoom/unzoom window
key \04000077\04000075 w_zoomq     ;*  ^W^U   - set unique window/buffer
key \04000077\04000068 w_hide      ;*  ^W^H   - window hide

key \04000077\04000073 w_split     ;*  ^W^S   - split window & ask filename to load
key \04000077\04000072 w_winres    ;*  ^W^R   - resize window
key \04000077\0400006E w_winnext   ;*  ^W^N   - select next window
key \04000077\04000070 w_winprev   ;*  ^W^P   - select previous window

key \04000063\04000072 f_cconfig   ;*  ^C^R   - reload config file
key \04000063\04000061 f_aconfig   ;*  ^C^A   - add file to config

key \08000078  w_qquita            ;*  @X     - quit all with query
key \0800006F  w_bufsel            ;*  @0     - select buffer
key \08000066d f_shell e_enter e_enter  ;*  @F D   - os shell
key \08000066o f_shell             ;*  @F O   - os shell with parameter

;*
;* ***** Search/Replace *****
;*

key \04000071\04000066 s_search   ;*  ^Q^F   - start search
key \04000071\04000061 s_replace  ;*  ^Q^A   - start replace
key \04000071\04000069 s_isearch  ;*  ^Q^I   - start interactive search
key \0400006C          s_sagain   ;*  ^L     - redo search/replace

;*
;* ***** Block *****
;*

;*  #cursor_movement - create/extend block

key \0400006B\04000062 b_begin    ;*  ^K^B   - set start of block
key \0400006B\0400006B b_end      ;*  ^K^K   - set end of block
key \0400006B\0400006E b_toggle   ;*  ^K^N   - toggle column/normal block type
key \0400006B\04000068 b_hide     ;*  ^K^H   - hide/unhide block
key \0400006B\0400006C b_ldrag    ;*  ^K^L   - drag mode line on/off
key \0400006B\04000061 b_cdrag    ;*  ^K^A   - drag mode char on/off
key \0400006B\04000079 b_blockdel ;*  ^K^Y   - block delete
key \0400006B\04000063 b_clphere b_clpcopy b_clppstd b_clpzero ;*  ^K^C   - copy block
key \0400006B\04000076 b_clphere b_clpcut  b_clppstd b_clpzero ;*  ^K^V   - move block
key \0400006B\04000072 b_clpdel b_clpload e_entwait b_clppstd  ;*  ^K^R   - block read
key \0400006B\04000077 b_clpdel b_clpcopy b_clpsave e_entwait b_clpdel ;*  ^K^W   - block write
key \0400006B\04000066 b_fill     ;*  ^K^F   - block fill
key \0400006B\04000069 b_indent   ;*  ^K^I   - indent C block
key \0800FF53          b_shr      ;*  @right - block shift right
key \0800FF51          b_shl      ;*  @left  - block shift left

key \04000063\04000065 b_clphere b_clpcopy b_clpexportd b_clpzero ;*  ^C^E   - block export to Xwindow
key \04000063\04000070 b_clphere b_clpimport b_clppstd b_clpzero ;*  ^C^P   - block import from Xwindow
;key \0400006B\04000074 b_clpexport; ^K^T  - export clipboard
;key \0400006B\0400006F b_clpimport; ^K^O  - import clipboard

key \0400006B\04000070 b_clpdel   ;*  ^K^P   - delete clipboard
key \0100FFFF b_clpdel b_clpcut   ;*  #Canc  - clip cut
key \0400FF63 b_clpdel b_clpcopy  ;*  ^Ins   - clip copy
key \0800FF63 b_clpcopy           ;*  @Ins   - clip copy/add
key \0800FFFF b_clpcut            ;*  @Canc  - clip cut/add
key \0100FF63 b_clppaste          ;*  #Ins   - clip paste
key \0400FFFF b_blockdel          ;*  ^Canc  - block delete

key \1100FF73 b_clpdel b_clpcut   ; #Canc - clip cut HP
key \1800FF73 b_clpcut            ; @Canc - clip cut/add HP
key \1100FF72 b_clppaste          ; #Ins  - clip paste HP
key \1400FF73 b_blockdel          ; ^Canc - block del HP
key \1800FF72 b_clpcopy           ; @Ins  - clip copy/add HP
key \1400FF72 b_clpdel b_clpcopy  ; ^Ins  - clip copy HP

;*
;* ***** Document mode *****
;*

key \0800FF52 g_prevpar              ;*  @up    - goto previous paragraph
key \0800FF54 g_nextpar              ;*  @down  - goto next paragraph
key \0400006F\04000072 j_rmargin     ;*  ^O^R   - set right margin
key \0400006F\0400006C j_lmargin     ;*  ^O^L   - set left margin
key \0400006F\04000069 j_indent      ;*  ^O^I   - set first row indent
key \0400006F\04000061 j_soft        ;*  ^O^A   - transform return in soft return
key \0400006F\04000068 j_hard        ;*  ^O^H   - transform return in hard return
key \0400006F\04000070 j_allhard     ;*  ^O^P   - transform all return in hard return
key \04000062 j_soft c_down          ;*  ^B     - add line to paragraph
key \0400006F\04000062 j_soft c_down ;*  ^O^B   - add line to paragraph
key \0400006F\04000063 j_center      ;*  ^O^C   - center row
key \0400006F\04000064 j_right       ;*  ^O^D   - align row to right
key \0400006F\04000073 j_left        ;*  ^O^S   - align row to left
key \0400006F\04000066 j_format      ;*  ^O^F   - format row
key \0400006F\0400006A j_justif      ;*  ^O^J   - justify row
key \0400006F\0400006B j_dejust      ;*  ^O^K   - de-justify row
key \0400006F\0400006F l_doctog      ;*  ^O^O   - toggle document mode on/off
key \0400006F\04000067 j_block2par   ;*  ^O^G   - create a paragraph within block
key \04000072 j_quoterem j_dejust j_format j_justif j_quoteres ;*  ^R     - re-format paragraph

;*
;* ***** Special File Selectors *****
;*

;*  <C     - select the clipboard
;*  <D     - select the delete buffer
;*  <E     - select the system-wide configuration
;*  <G     - select the local configuration
;*  <H     - create the help
;*  <I     - select one of the buffer not visualized

;*
;* ***** Symbols for OS shell *****
;*

;*  %t : path of the current file
;*  %f : name of the current file (without path and extension)
;*  %e : extension of the current file
;*  %n : complete name of the file (without path)
;*  %w : word where the cursor was.
;*  %v : as %w but of the previous window (saved with w_winsave)
;*  %p : pause before return to Zed
;*  %r : pause before return to zed if the shell returns an error
;*  %s : save all modified buffers before executing the shell
;*  %k : as %s but when the shell terminates execution, all modified files are
;*       reloaded. Not usable with %i or %a.
;*  %x : write "Type exit to return to Zed" before executing the shell
;*  %i : stdout and stderr of the command executed are redirected throw a pipe
;*       in the current buffer. This is erased before the execution of the
;*       shell.
;*  %a : as %i, but the buffer is not erased (append)
;*  %o : executes the command in background (UNIX only)
;*  %d : drive of the current file (MS-DOS only)

; **********************************************************************
; **********************************************************************
; **********************************************************************

; macro per la tastiera italiana (macros for italian keyboard)

key \2000007B "{"  ; @k
key \2000007D "}"  ; @l
key \2000005B "["  ; (@gr)
key \2000005D "]"  ; (@gr)+
key \20000040 "@"  ; (@gr)
key \20000023 "#"  ; (@gr)
key \2000007E "~"  ; @/
key \20000060 "`"  ; @'

; macro pro-tex

;key \uE8 "\`e"
;key \uE9 "\'e"
;key \uEC "\`"
;key \uF2 "\`o"
;key \uEC "\`"
;key \uE0 "\`a"
;key \2000007E "\`u"

;*
;* ***** Macro for C/asm *****
;*

key \08000069 g_sol e_enter c_up "#include <>" c_left ;*  @I     - include
key \0800006B "{"
key \0800006C "}"
key \08000074 g_sol e_enter c_up \    ;*  @T     - separator (C)
           "/**********************************" \
           "*****************************************/" c_down g_sol
key \08000075 "unsigned "             ;*  @U     - unsigned
key \08000076 "void "                 ;*  @V     - void
key \0800006D "\;" c_down c_left      ;*  @M     - comment row
;key \wFFBE f_shell "man" e_enter "%w" e_enter ; F1 chiama man keywork
key \wFFC6 f_savemodif w_winsave w_split "errs" e_enter \
              f_shell "make" e_enter "zedx%i" e_enter w_wingoto ;*  F9     - execute make
key \0400FFBE w_winsave f_select "man" e_roopen \
                f_shell "man" e_enter "%i%v" e_enter w_wingoto ;*  ^F1    - man page on word

menu *File
 menu *Load
  item new_*Buffer  f_fileld
  item new_*Window  w_split
  item *Reload      f_qreload
  item same_b*Uffer f_filesb
 endmenu
 menu *Save
  item *File  f_savefile
  item *All   f_saveall
  item save/*Quit  f_savefile w_qquit
  item change_*Name f_chname
 endmenu
 menu close/*Quit
  item quit_*File  w_qquit
  item save/*Quit  f_savefile w_qquit
  item quit_*All   w_qquita
 endmenu
 menu os_shell
  item shell f_shell e_enter e_enter
 endmenu
endmenu
menu *Buffer
 item *Next     w_bufnext
 item *Previous w_bufprev
 item *Select   w_bufsel
 item close_*Others w_zoomq
endmenu
menu *Window
 item *Zoom/unzoom w_zoom
 item *Hide        w_hide
 item *Split       w_split
 item *Resize      w_winres
 item *Next        w_winnext
 item *Previous    w_winprev
endmenu
menu *Goto
 item start_of_line g_sol
 item end_of_line   g_eol
 item start_of_screen g_sos
 item end_of_screen g_eos
 item start_of_file g_sof
 item end_of_file g_eof
 item start_of_block g_sob
 item end_of_block g_eob
 item line_# g_line
 item *Parentesis g_parent
 item *C_function g_function
 item previous_paragraph g_prevpar
 item next_paragraph g_nextpar
 item mark_0 g_go0
 item mark_1 g_go1
 item mark_2 g_go2
 item mark_3 g_go3
 item set_mark_0 g_set0
 item set_mark_1 g_set1
 item set_mark_2 g_set2
 item set_mark_3 g_set3
endmenu
menu *Scroll
 item current_to_start_of_screen g_c2sos
 item current_to_end_of_screen g_c2eos
 item current_to_middle_of_screen g_c2mos
 item scroll_up g_sup
 item scroll_down g_sdown
endmenu
menu *Editing
 item *Delete_line e_delline
 item delete_to_*Eol e_deleol
 item *Restore_line e_restore
 item *Unerase_line b_resdelb
 item insert_*Coded e_putcode
 item insert_c*Ode  e_inscode
 item insert_*Hex   e_hexcode
 item de*Indent e_deind
 item char_to*Upper e_toupper
 item char_to*Lower e_tolower
 item char_*Flipcase e_flipcase
 menu *Search
  item *Search s_search
  item *Interactive s_isearch
  item *Replace s_replace
  item redo_*Last s_sagain
 endmenu
 menu *Macro
  item *Start e_stmacro
  item *Record e_recmacro
  item *Abort e_abmacro
  item *Write_to_file e_wrmacro
  item *Reload_config_file f_cconfig
 endmenu
 menu *Block
  item set_*Begin b_begin
  item set_*End   b_end
  item toggle_*Type b_toggle
  item *Hide b_hide
  item drag_line b_ldrag
  item drag_char b_cdrag
  item *Delete b_blockdel
  item *Copy b_clphere b_clpcopy b_clppstd b_clpzero
  item *Move b_clphere b_clpcut  b_clppstd b_clpzero
  item *Read b_clpdel b_clpload e_entwait b_clppstd
  item *Write b_clpdel b_clpcopy b_clpsave e_entwait b_clpdel
  item *Fill b_fill
  item c_*Indent b_indent
  item shift_*Right b_shr
  item shift_*Left b_shl
  item to*Upper b_toupper
  item tolo*Wer b_tolower
  item fli*P_case b_flipcase
  menu clipb*Oard
   item *Delete b_clpdel
   item *Save   b_clpsave
   item *Load   b_clpload
   item set_*Begin b_clphere
   item set_*Real_start b_clpzero
   item *Copy_to b_clpcopy
   item c*Ut_to b_clpcut
   item *Paste_from b_clppaste
   item p*Aste_del b_clppstd
   item *Export b_clpexport
   item *Import b_clpimport
  endmenu
 endmenu
endmenu
menu *Document
 menu *Set_margin
  item *Right j_rmargin
  item *Left j_lmargin
  item *Indent j_indent
 endmenu
 item ret_to_*Ghost j_soft
 item ret_to_*True j_hard
 item *All_true j_allhard
 item add_*Line j_soft c_down
 menu *Alignment
  item *Center_row j_center
  item *Right_row j_right
  item *Left_row j_left
 endmenu
 item *Format_row j_format
 item *Justify_row j_justif
 item *Dejusttify j_dejust
 item *Rejust_paragraph j_dejust j_format j_justif
endmenu
menu *C_program
 item *Block_indent b_indent
 item *Goto_function g_function
 item #*Include g_sol e_enter c_up "#include <>" c_left
 item *Comment g_sol e_enter c_up \
           "/**********************************" \
           "*****************************************/" c_down g_sol
 item *Unsigned "unsigned"
 item *Void "void"
 item *Make f_savemodif w_winsave w_split "errs" e_enter \
           f_shell "make" e_enter "%i" e_enter w_wingoto
endmenu

; ***************************************************************************
; ***************************************************************************
; ***************************************************************************

; mouse configuration

; button 1/2/3 - define(normal)/copy/define(column) internal ZED block

key \00111101 m_gotowin                     ; goto within window button 1
key \00111001 m_gotozed                     ; goto other window button 1

key \00111111 b_fhide b_setnorm             ; drag start button 1
key \00111121 b_setpnt m_gotowin  b_cresize ; dragging button 1

key \00111102 m_gotowin                     ; goto within window button 2
key \00111002 m_gotozed                     ; goto other window button 2
key \00111152 m_gotowin b_clphere b_clpcopy b_clppstd b_clpzero ; button 2 copy block

key \00111103 m_gotowin                     ; goto within window button 3
key \00111003 m_gotozed                     ; goto other window button 3

key \00111113 b_fhide b_setnorm b_toggle    ; drag start button
key \00111123 b_setpnt m_gotowin  b_cresize ; dragging button 3

; shift+button 1/2/3 -
;   define-export(normal)/import-paste X-clipboard block/define-export(column)

key \01111101 m_gotowin                     ; goto within window #button 1
key \01111001 m_gotozed                     ; goto other window #button 1

key \01111111 b_fhide b_setnorm             ; drag start #button 1
key \01111121 b_setpnt m_gotowin  b_cresize ; dragging #button 1
key \01111141 b_clphere b_clpcopy b_clpexportd b_clpzero ; release #button 1 - export Xblock

key \01111102 m_gotowin                     ; goto within window #button 2
key \01111002 m_gotozed                     ; goto other window #button 2
key \01111152 b_clphere b_clpimport b_clppstd b_clpzero ; release button 2 - import Xblock

key \01111103 m_gotowin                     ; goto within window button 3
key \01111003 m_gotozed                     ; goto other window button 3

key \01111113 b_fhide b_setnorm b_toggle    ; drag start #button 3
key \01111123 b_setpnt m_gotowin  b_cresize ; dragging #button 3
key \01111143 b_clphere b_clpcopy b_clpexportd b_clpzero ; release #button 3 - export Xblock

