forked from commiyou/zsh-editing-workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zew
73 lines (58 loc) · 2.96 KB
/
zew
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
# Displays help on Zew provided actions. Lines are 72 characters long
autoload colors
colors
local h1="$fg_bold[magenta]"
local h2="$fg_bold[green]"
local h3="$fg_bold[blue]"
local h4="$fg_bold[yellow]"
local rst="$reset_color"
local LESS_bkp="$LESS"
export LESS="-iRX"
less <<<"
${h1}Key Bindings${rst}
Zew provides organized key bindings for various command line editing
features, and also provides some of the features (not existing in all
Zsh versions, or having limitations or bugs). Original features are used
to make user not depart from mainstream Zsh.
The key bindings are below. Original features are marked by
blue color set on the key shortcut:
1. ${h2}Alt-w${rst} - delete a ${h4}shell word${rst} (what's a shell word is explained in
following section)
2. ${h2}Alt-t${rst} - transpose (swap) ${h4}shell words${rst}
3. ${h3}Alt-m${rst} - copy previous ${h4}shell word${rst}, or word before that, etc. when
used multiple times
4. ${h3}Alt-M${rst} - just copy previous ${h4}shell word${rst} without iterating to
previous ones
5. ${h3}Alt-.${rst} - copy last ${h4}shell word${rst} from previous line, or line before
that, etc. when used multiple times; can be combined with
${h3}Alt-m${rst}
6. ${h3}Ctrl-W${rst} - delete word according to configured ${h4}word style${rst} (what's the
style is explained in following section)
7. ${h3}Alt-r${rst} - transpose (swap) words according to configured ${h4}word style${rst}
(cursor needs to be placed on beginning of word to swap)
8. ${h3}Alt-/${rst} - complete ${h4}some word${rst} from history (explained in next section)
9. ${h2}Alt-h/H${rst} - complete ${h4}shell word${rst} from history (custom version)
10. ${h3}Ctrl-J${rst} - break line
11. ${h3}Ctrl-_${rst} - undo
${h1}Definitions${rst}
A ${h4}shell word${rst} is a text that Zsh would see as single segment. For example
\$(( i + 1 )) is a single shell word.
A ${h4}word style${rst} defines a way Zsh recognizes segments (words) of text in
commands that want to use the style information. The style can be
configured in zew.conf to be one of:
- bash words are built up of alphanumeric characters only
- normal as in normal shell operation: word characters are
alphanumeric characters plus any characters present in the
string given by the parameter \$WORDCHARS
- shell words are complete shell command arguments, possibly
including complete quoted strings, or any tokens special to
the shell
- whitespace words are any set of characters delimited by whitespace
- default restore the default settings; this is the same as 'normal'
with default \$WORDCHARS
${h4}Some word${rst} is in general a sophisticated word, but not a shell word,
because of limitations in Zsh history word completion. ${h4}Some word${rst} is
rather not build from special characters, it works well for normal
characters.
"
export LESS="$LESS_bkp"