;*
;**** Zed - configuration file for local-linux-terminal
;*
;*  ^=control key, #=shift key, @=alt key

set shiftlinux  on      ; enable shiftstatus capture
set ansi 3              ; use linux terminal scroll capability
set indcfg 0x111

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

key \1B&t    e_escape   ; Esc     - escape command

key \u1B[B   c_down     ; Down ;*  Arrows - move cursor
key \u1B[A   c_up       ; Up
key \u1B[C   c_right    ; Right
key \u1B[D   c_left     ; Left

key \u1B[6\u7E p_down       ;*  PgDn   - move cursor down one page
key \u1B[5\u7E p_up         ;*  PgUp   - move cursor up one page
key \u1B[4\u7E g_eol        ;*  End    - goto end of line
key \u1B[1\u7E g_sol        ;*  Home   - goto start of line

key \w0211\w0213 g_sol      ;*  ^Q^S   - goto start of line
key \w0211\w0204 g_eol      ;*  ^Q^D   - goto end of line
key \w0211\w0205 g_sos      ;*  ^Q^E   - goto start of screen
key \w0211\w0218 g_eos      ;*  ^Q^X   - goto end of screen
key \w0211\w0212 g_sof      ;*  ^Q^R   - goto start of file
key \w0211\w0203 g_eof      ;*  ^Q^C   - goto end of file
key \w0211\w0202 g_sob      ;*  ^Q^B   - goto start of block
key \w0211\w020B g_eob      ;*  ^Q^K   - goto end of block
key \w0211\w0214 g_c2sos    ;*  ^Q^T   - current to start of screen
key \w0211\w0216 g_c2eos    ;*  ^Q^V   - current to end of screen
key \w0211\w0207 g_c2mos    ;*  ^Q^G   - current to middle of screen
key \w0211\w020C g_line     ;*  ^Q^L   - goto line #
key \w0211\w045B g_parent   ;*  ^Q [   - goto parenthesis
key \w0211\w045D g_parent   ;*  ^Q ]   - goto parenthesis
key \w0211\w0215 g_function ;*  ^Q^U   - goto C function
key \w020B0      g_set0     ;*  ^K 0   - set mark 0
key \w020B1      g_set1     ;*  ^K 1   - set mark 1
key \w020B2      g_set2     ;*  ^K 2   - set mark 2
key \w020B3      g_set3     ;*  ^K 3   - set mark 3
key \w02110      g_go0      ;*  ^Q 0   - goto mark 0
key \w02111      g_go1      ;*  ^Q 1   - goto mark 1
key \w02112      g_go2      ;*  ^Q 2   - goto mark 2
key \w02113      g_go3      ;*  ^Q 3   - goto mark 3
key \u1B[21\u7E  g_menu     ;*  F10    - menu
key \u1B[[A      f_select "<h" e_enter ;*  F1     - open help window

key \w021B\w025B\w0235\w027E g_sof ;*  ^PgUp  - goto start of file
key \w021B\w025B\w0236\w027E g_eof ;*  ^PgDn  - goto end of file
key \w021B\w025B\w0231\w027E g_sos ;*  ^Home  - goto start of screen
key \w021B\w025B\w0234\w027E g_eos ;*  ^End   - goto end of screen
key \w021B\w025B\w0244   g_pwr     ;*  ^Left  - goto previus word
key \w021B\w025B\w0243   g_nwr     ;*  ^Right - goto next word
key \w021B\w025B\w0241   g_sdown   ;*  ^Up    - scroll down
key \w021B\w025B\w0242   g_sup     ;*  ^Down  - scroll up

; block extension by cursor

key \w011B[B     b_setpnt c_down  b_cresize ; #Down
key \w011B[A     b_setpnt c_up    b_cresize ; #Up
key \w011B[C     b_setpnt c_right b_cresize ; #Right
key \w011B[D     b_setpnt c_left  b_cresize ; #Left
key \w011B[6\u7E b_setpnt p_down  b_cresize ; #PgDn
key \w011B[5\u7E b_setpnt p_up    b_cresize ; #PgUp
key \w011B[4\u7E b_setpnt g_eol   b_cresize ; #End
key \w011B[1\u7E b_setpnt g_sol   b_cresize ; #Home

key \w031B\w025B\w0235\w027E b_setpnt g_sof b_cresize ; #^PgUp
key \w031B\w025B\w0236\w027E b_setpnt g_eof b_cresize ; #^PgDn
key \w031B\w025B\w0231\w027E b_setpnt g_sos b_cresize ; #^Home
key \w031B\w025B\w0234\w027E b_setpnt g_eos b_cresize ; #^End
key \w031B\w025B\w0244       b_setpnt g_pwr b_cresize ; #^Left
key \w031B\w025B\w0243       b_setpnt g_nwr b_cresize ; #^Right
key \w031B\w025B\w0241     b_setpnt g_sdown b_cresize ; #^Up
key \w031B\w025B\w0242       b_setpnt g_sup b_cresize ; #^Down

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

key \u0d       e_enter   ; Enter
key \u1B[3\u7E e_canc    ;*  Canc   - delete character under the cursor
key \w007F     e_bkspc   ;*  BackSpace - delete character at the left of the cursor
key \w0219     e_delline ;*  ^Y     - delete row
key \u1B[2\u7E l_instog  ;*  Ins    - toggle insert/overwrite mode

key \w020B\w0204 e_deleol   ;*  ^K^D   - delete from cursor to EOL
key \w020B\w020A e_restore  ;*  ^K^J   - restore line
key \w020B\w0215 b_resdelb  ;*  ^K^U   - unerase line
key \w020B\w0214 f_killtab  ;*  ^K^T   - kill all tab in current file

key \0203\0203   e_putcode  ;*  ^C^C   - insert coded codes (enter ends)
key \w0203\w0209 e_inscode  ;*  ^C^I   - insert codes (enter ends)
key \w0203\w0208 e_hexcode  ;*  ^C^H   - insert hex code

key \w041B\w0431 e_toupper  ;*  @1     - char toupper
key \w041B\w0432 e_tolower  ;*  @2     - char tolower
key \w041B\w0433 e_flipcase ;*  @3     - char flip case
key \w0211\w0210 l_autosave ;*  ^Q^P   - set autosave
key \w041B\w040D e_senter   ;*  @Enter - soft enter
key \w021F       e_deind    ;*  ^BackSpace - deindent row

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

key \w0201     e_openall ;*  ^A     - open all files
key \w020E     e_hexopen ;*  ^N     - open file in binary mode
key \w0214     e_roopen  ;*  ^T     - open file in readonly mode

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

key \w0213\w0213 e_stmacro  ;*  ^S^S   - start macro
key \w0213\w0212 e_recmacro ;*  ^S^R   - record macro
key \w0213\w0201 e_abmacro  ;*  ^S^A   - abort macro
key \w0213\w0217 e_wrmacro  ;*  ^S^W   - write macro

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

key \u1B[[B      f_savefile   ;*  F2     - save file
key \w020B\w0213 f_savefile   ;*  ^K^S   - save file
key \w0206\w0213 f_savefile   ;*  ^F^S   - save file
key \w0206\w0214 f_saveall    ;*  ^F^T   - save all file
key \w020B\w0218 f_savefile  w_qquit  ;*  ^K^X   - save/exit single file
key \w020B\w021A f_savemodif w_qquita ;*  ^K^Z   - saveall modified/exitall

key \u1B[[C      f_fileld     ;*  F3     - open file
key \w0206\w020F f_fileld     ;*  ^F^O   - open file
key \w0206\w0215 f_filesb     ;*  ^F^U   - file substitution
key \w020B\w0211 w_qquit      ;*  ^K^Q   - query quit
key \w0206\w0212 f_qreload    ;*  ^F^R   - file reopen with query

key \w020B\w0205 f_chname     ;*  ^K^E   - change filename
key \w0206\w0205 f_chname     ;*  ^F^E   - change filename
key \w0211\w0211 w_qquita     ;*  ^Q^Q   - quit all with query
key \w0206\w020E w_bufnext    ;*  ^F^N   - select next buffer
key \w0206\w0210 w_bufprev    ;*  ^F^P   - select previous buffer
key \w0206\w020D w_bufsel     ;*  ^F^M   - select buffer

key \u1B[[E w_zoom            ;*  F5     - zoom/unzoom window
key \w0217\w021A w_zoom       ;*  ^W^Z   - zoom/unzoom window
key \w0217\w0215 w_zoomq      ;*  ^W^U   - set unique window/buffer
key \w0217\w0208 w_hide       ;*  ^W^H   - window hide

key \w0217\w0213 w_split      ;*  ^W^S   - split window & ask filename to load
key \w0217\w0212 w_winres     ;*  ^W^R   - resize window
key \w0217\w020E w_winnext    ;*  ^W^N   - select next window
key \w0217\w0210 w_winprev    ;*  ^W^P   - select previous window

key \w0203\w0212 f_cconfig    ;*  ^C^R   - reload config file
key \w0203\w0201 f_aconfig    ;*  ^C^A   - add file to config

key \w041B\w0478  w_qquita    ;*  @X     - quit all with query
key \w041B\w0430  w_bufsel    ;*  @0     - select buffer
key \w041B\w0466d f_shell e_enter e_enter  ;*  @F D   - os shell
key \w041B\w0466o f_shell     ;*  @F O   - os shell with parameter

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

key \w0211\w0206 s_search   ;*  ^Q^F   - start search
key \w0211\w0201 s_replace  ;*  ^Q^A   - start replace
key \w0211\w0209 s_isearch  ;*  ^Q^I   - start interactive search
key \w020C       s_sagain   ;*  ^L     - redo search/replace

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

;*  #cursor_movement - create/extend block

key \w020B\w0202 b_begin     ;*  ^K^B   - set start of block
key \w020B\w020B b_end       ;*  ^K^K   - set end of block
key \w020B\w020E b_toggle    ;*  ^K^N   - toggle column/normal block type
key \w020B\w0208 b_hide      ;*  ^K^H   - hide/unhide block
key \w020B\w020C b_ldrag     ;*  ^K^L   - drag mode line on/off
key \w020B\w0201 b_cdrag     ;*  ^K^A   - drag mode char on/off
key \w020B\w0219 b_blockdel  ;*  ^K^Y   - block delete
key \w020B\w0203 b_clphere b_clpcopy b_clppstd b_clpzero ;*  ^K^C   - copy block
key \w020B\w0216 b_clphere b_clpcut  b_clppstd b_clpzero ;*  ^K^V   - move block
key \w020B\w0212 b_clpdel b_clpload e_entwait b_clppstd  ;*  ^K^R   - block read
key \w020B\w0217 b_clpdel b_clpcopy b_clpsave e_entwait b_clpdel ;*  ^K^W   - block write
key \w020B\w0206 b_fill      ;*  ^K^F   - block fill
key \w020B\w0209 b_indent    ;*  ^K^I   - indent C block
key \w041B\w045B\w0443 b_shr ;*  @right - block shift right
key \w041B\w045B\w0444 b_shl ;*  @left  - block shift left

key \w020B\w0210 b_clpdel                       ;*  ^K^P   - delete clipboard
key \w011B[3\u7E b_clpdel b_clpcut              ;*  #Canc  - clip cut
key \w021B\w025B\w0232\w027E b_clpdel b_clpcopy ;*  ^Ins   - clip copy
key \w041B\w045B\w0432\w047E b_clpcopy          ;*  @Ins   - clip copy/add
key \w041B\w045B\w0433\w047E      b_clpcut      ;*  @Canc  - clip cut/add
key \w011B[2\u7E b_clppaste                     ;*  #Ins   - clip paste
key \w021B\w025B\w0233\w027E b_blockdel         ;*  ^Canc  - block delete

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

key \w041B\w045B\w0441 g_prevpar ;*  @up    - goto previous paragraph
key \w041B\w045B\w0442 g_nextpar ;*  @down  - goto next paragraph
key \w020F\w0212 j_rmargin       ;*  ^O^R   - set right margin
key \w020F\w020C j_lmargin       ;*  ^O^L   - set left margin
key \w020F\w0209 j_indent        ;*  ^O^I   - set first row indent
key \w020F\w0201 j_soft          ;*  ^O^A   - transform return in soft return
key \w020F\w0208 j_hard          ;*  ^O^H   - transform return in hard return
key \w020F\w0210 j_allhard       ;*  ^O^P   - transform all return in hard return
key \w0202 j_soft c_down         ;*  ^B     - add line to paragraph
key \w020F\w0202 j_soft c_down   ;*  ^O^B   - add line to paragraph
key \w020F\w0203 j_center        ;*  ^O^C   - center row
key \w020F\w0204 j_right         ;*  ^O^D   - align row to right
key \w020F\w0213 j_left          ;*  ^O^S   - align row to left
key \w020F\w0206 j_format        ;*  ^O^F   - format row
key \w020F\w020A j_justif        ;*  ^O^J   - justify row
key \w020F\w020B j_dejust        ;*  ^O^K   - de-justify row
key \w020F\w020F l_doctog        ;*  ^O^O   - toggle document mode on/off
key \w020F\w0207 j_block2par     ;*  ^O^G   - create a paragraph within block
key \w0212 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 \w047B "{"  ; @k
key \w047D "}"  ; @l
key \w045B "["  ; (@gr)
key \w045D "]"  ; (@gr)+
key \w0440 "@"  ; (@gr)
key \w0423 "#"  ; (@gr)
key \w047E "~"  ; @/
key \w0460 "`"  ; @`
key \w04F9 ""  ; (@gr)

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

key \w041B\w0469 g_sol e_enter c_up "#include <>" c_left ;*  @I     - include
key \w041B\w0474 g_sol e_enter c_up \    ;*  @T     - separator (C)
                 "/**********************************" \
                 "*****************************************/" c_down g_sol
key \w041B\w0475 "unsigned "             ;*  @U     - unsigned
key \w041B\w0476 "void "                 ;*  @V     - void
key \w041B\w046D "\;" c_down c_left      ;*  @M     - comment row (asm)
key \u1B[20\u7E f_savemodif w_winsave f_select "errs" e_roopen \
                f_shell "make" e_enter "%i" e_enter w_wingoto ;*  F9     - execute make
key \w021B\w025B\w025B\w0241 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
  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

