ZLE中单词的定义(zsh)

Ame*_*ina 3 zsh

我在 zsh 中遇到了以下两个片段:

片段 1:

autoload select-word-style
select-word-style shell
Run Code Online (Sandbox Code Playgroud)

片段 2:

setopt shwordsplit
Run Code Online (Sandbox Code Playgroud)

我的问题是,它们之间有什么区别?(即他们做什么?)

另外,zsh 文档中是否有关键字索引?(例如,我无法轻松找到有关这两个片段的文档信息)。

如果这样的索引不存在,除了微不足道的 Google 搜索或在此站点上询问之外,是否有人对如何查找有关shwordsplit或等关键字的文档有任何建议select-word-style

pol*_*ial 5

最好的方法是 zshall(1),它包含有关这些和所有 zsh 功能的文档,并且可以在您最喜欢的寻呼机中轻松搜索(少即是多):

 $ 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.
Run Code Online (Sandbox Code Playgroud)

[…]

   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'.)      
Run Code Online (Sandbox Code Playgroud)

     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.
Run Code Online (Sandbox Code Playgroud)