Vim:单词与单词 [英] Vim: word vs WORD

查看:23
本文介绍了Vim:单词与单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 Vim,无法理解 wordWORD 之间的区别.

I'm learning Vim and can't wrap my head around the difference between word and WORD.

我从 Vim 手册中得到了以下内容.

I got the following from the Vim manual.

一个单词由一系列字母、数字和下划线组成,或者一个其他非空白字符序列,以空格分隔(空格,制表符,).这可以用'iskeyword'改变选项.空行也被认为是一个词.

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, ). This can be changed with the 'iskeyword' option. An empty line is also considered to be a word.

一个 WORD 由一系列非空白字符组成,用空白.空行也被认为是一个 WORD.

A WORD consists of a sequence of non-blank characters, separated with white space. An empty line is also considered to be a WORD.

我觉得wordWORD 是一回事.它们都是由空格分隔的非空白字符序列.一个空行可以被认为是 wordWORD.

I feel word and WORD are just the same thing. They are both a sequence of non-blank chars separated with white spaces. An empty line can be considered as both word and WORD.

问题:
它们之间有什么区别?
为什么/什么时候有人会使用 WORD 而不是 word?

我已经完成了 Google 和 SO 搜索,但是他们的搜索引擎将 WORD 解释为只是 word 所以这就像我在搜索 Vim wordvs word,当然找不到任何有用的东西.

I've already done Google and SO search, but their search-engine interpret WORD as just word so it's like I'm searching for Vim word vs word and of course won't find anything useful.

推荐答案

  • 单词总是由空格分隔.
  • 一个词由非关键字字符分隔,这些字符是可配置的.空白字符不是关键字,通常其他字符(如 ()[],-)也不是.因此,一个词通常比一个词小;word-navigation 的粒度更细.
    • A WORD is always delimited by whitespace.
    • A word is delimited by non-keyword characters, which are configurable. Whitespace characters aren't keywords, and usually other characters (like ()[],-) aren't, neither. Therefore, a word usually is smaller than a WORD; the word-navigation is more fine-grained.
    • This "stuff" is not-so difficult!
      wwww  wwwww  ww www ww wwwwwwwww    " (key)words, delimiters are non-keywords: "-! and whitespace
      WWWW WWWWWWW WW WWWWWW WWWWWWWWWW   " WORDS, delimiters are whitespace only
      

      这篇关于Vim:单词与单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆