Je suis tombé sur les deux extraits suivants dans zsh:
Extrait 1:
autoload select-word-style select-word-style shell
Extrait 2:
setopt shwordsplit
Ma question est, quelle est la différence entre eux? (Que font-ils?)
En outre, existe-t-il un index par mot key sur la documentation zsh ? (par exemple, je ne trouvais pas facilement d'informations sur la documentation concernant ces deux extraits).
Si un tel index n'existe pas, est-ce que quelqu'un a des suggestions, autres que les searchs sortingviales de Google ou demandant sur ce site, sur comment find la documentation sur des mots-keys tels que shwordsplit
ou select-word-style
?
La meilleure façon est zshall (1), qui contient de la documentation sur ces deux fonctions zsh et qui peut être facilement recherché dans votre pager favori (less, c'est plus):
$ man zshall zsh -x -o shwordsplit scr runs the script scr, setting the XTRACE option by the corresponding letter `-x' and the SH_WORD_SPLIT option by name.
[…]
SH_WORD_SPLIT (-y) <K> <S> Causes field splitting to be performed on unquoted parameter expansions. Note that this option has nothing to do with word splitting. (See the section `Parameter Expansion'.)
et
The simplest way of configuring the functions is to use select-word-style, which can either be called as a normal function with the appropriate argument, or invoked as a user-defined widget that will prompt for the first character of the word style to be used. The first time it is invoked, the eight -match functions will automatically replace the builtin versions, so they do not need to be loaded explicitly.