2

私の質問は簡単です: ...Is it possible to escape the space characterのコマンドのみを使用して、スペースで区切られた 2 つの単語を短縮する方法はありますか?abvi

スタックオーバーフローではこれしか見つかりませんでしたが、すべての回答は置換コマンドを使用していました。私も試しました:

:ab word1<space>word2 replaceWord

しかし無駄だった (エラーが発生した)

4

2 に答える 2

3

実際にエミュレートできます。

word2その前にあるものをチェックする略語を定義する必要があります。'\' で始まる略語について詳しく説明しましたが、同じです (前の行の最後の単語をテストする必要がある場合を除いて)。

于 2014-12-27T10:44:48.943 に答える
3

残念ながら、それは不可能です。

から:help :abbreviate:

Examples of strings that cannot be abbreviations: "a.b", "#def", "a b", "_$r"

これは、略語が 3 種類しかないためです (まだ から:help):

full-id   The "full-id" type consists entirely of keyword characters (letters
      and characters from 'iskeyword' option).  This is the most common
      abbreviation.

      Examples: "foo", "g3", "-1"

end-id    The "end-id" type ends in a keyword character, but all the other
      characters are not keyword characters.

      Examples: "#i", "..f", "$/7"

non-id    The "non-id" type ends in a non-keyword character, the other
      characters may be of any type, excluding space and tab.  {this type
      is not supported by Vi}

      Examples: "def#", "4/7$"
于 2014-12-26T23:06:29.623 に答える