2017-09-15 28 views
0

我注意到,当我使用vim的帮助文件中的命令viw,它能够选择喜欢的字符串:intro.txtvim如何帮助文件允许使用视觉词选择来选择带句点的文本?

但是,当我创建一个基本的文件,并添加文字intro.txt并尝试选择整个字符串使用viw时,视觉选择停在.,所以我只能选择intro而不包含.txt部分。

有人可以解释为什么这是,以及如何强制vim选择整个字符串?

+0

'v iW'选择整个单词 – tinmarino

回答

1

从内置的帮助:

:help iw 
iw   "inner word", select [count] words (see |word|). 

... word

A word consists of a sequence of letters, digits and underscores, or a 
sequence of other non-blank characters, separated with white space (spaces, 
tabs, <EOL>). This can be changed with the 'iskeyword' option. An empty line 
is also considered to be a word. 

... 'iskeyword'

'iskeyword' 'isk' string (Vim default for MS-DOS and Win32: 
         "@,48-57,_,128-167,224-235" 
        otherwise: "@,48-57,_,192-255" 
       Vi default: "@,48-57,_") 
      local to buffer 
      {not in Vi} 
Keywords are used in searching and recognizing with many commands: 
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See 
'isfname' for a description of the format of this option. For C 
programs you could use "a-z,A-Z,48-57,_,.,-,>". 
For a help file it is set to all non-blank printable characters except 
'*', '"' and '|' (so that CTRL-] on a command finds the help for that 
command).