1. let foo = 'bar'
  2. let foo = 1
  3. echo foo

option

  1. set textwidth=80
  2. " 使用前缀 & 表明引用的是 option ,而不是 variable 。
  3. echo &textwidth
  4. " 使用定义变量的方式来改变 option 的值。
  5. let &textwidth = 80
  6. " 80
  7. set textwidth?

local option

  1. let &l:number = 1

register

  1. let @a = 'Hello!'

scope


  1. " 定义一个 buffer 范围内的变量 hello
  2. let b:hello = 'world'
  3. echo b:hello