home *** CD-ROM | disk | FTP | other *** search
- #!c:sksh
-
- #*************************************************************************
- # This function sets vi-mode editing
- #*************************************************************************
-
- if [ "$1" = '-?' ]
- then
- echo 'Usage:' $(basename $0)
- echo ' (sets command line editing to vi mode)'
- return
- fi
-
- [ "$SIZE" = 'normal' ] ||
- echo "This command does not operate with Tiny_SKsh." && return 2
-
- options -e # turn on command line editing
-
- setmap -r # reset the keymap
-
- setmap -n 1
- setmap -e 1 2
-
- setmap -m 0 BOL GK0
- setmap -m 1 EOL GK0
- setmap -m 2 RHT GK0
- setmap -m 3 BOL ISM '#' PIO ACC
-
- setmap 0 27 @1 8 BS 9 CC1 12 RDL 155 @3 127 DEL 20 SPC
-
- setmap 1 k UP j DN h LFT l RHT x DEL 10 ACC 13 ACC i @0 a '!2' \
- d @2 27 CC1 $ EOL \^ BOL \/ SRH 155 @3 n SRH 8 BS w FWW \
- W FWW b BKW B BKW - UP + DN D KEL R TIM _ ILP \* CC3 12 RDL \
- = CC2 X BS 127 DEL A '!1' I '!0' '#' '!3' p YNK 49 ERC \
- 50 ERC 51 ERC 52 ERC 53 ERC 54 ERC 55 ERC 56 ERC 57 ERC
-
- setmap 2 w DLW $ KEL d ZAP c DEL
-
- setmap 3 A UP B DN C RHT D LFT T HOL S TOL ' ' @4 \
- 48 FNK 49 FNK 50 FNK 51 FNK 52 FNK 53 FNK 54 FNK \
- 55 FNK 56 FNK 57 FNK
-
- setmap 4 A BKW @ FWW
-
- echo "\nCommand line editing set to vi mode.\n"
-