2014-12-26 61 views
1

我的問題很簡單,縮寫在vim兩句話:有沒有辦法在vi來縮寫由空間分隔的兩個單詞只使用ab命令是否可能逃離太空角色?是否有可能通過使用命令AB

在stackoverflow我發現只有這個one,但所有的答案都使用替代命令。我也試過:

:ab word1<space>word2 replaceWord

,卻徒勞無功(產生錯誤)

回答

3

不幸的是,這是不可能的。

:help :abbreviate

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

這是因爲只有三種類型的縮寫(仍然: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$" 
相關問題