@@ -194,40 +194,31 @@ echo "0xA" + 1 # Number
194194# Variables
195195# ###########
196196
197- var b_my_var = 1 # Local to current buffer
198- var w_my_var = 1 # Local to current window
199- var t_my_var = 1 # Local to current tab page
200- var g_my_var = 1 # Global variable
201- var l_my_var = 1 # Local to current function
202- var s_my_var = 1 # Local to current script file
203- var a_my_arg = 1 # Function argument
204-
205- # The Vim scope is read-only
206- echo true # Special built-in Vim variables
197+ var b:my_var = 1 # Local to current buffer
198+ var w:my_var = 1 # Local to current window
199+ var t:my_var = 1 # Local to current tab page
200+ var g:my_var = 1 # Global variable
207201
208202# Access special Vim memory like variables
209203var @a = 'Hello' # Register
210204var $PATH='' # Environment variable
211205var &textwidth = 79 # Option
212- var &l_textwidth = 79 # Local option
213- var &g_textwidth = 79 # Global option
206+ var &l:textwidth = 79 # Local option
207+ var &g:textwidth = 79 # Global option
214208
215209# Access scopes as dictionaries
216210echo b: # All buffer variables
217211echo w: # All window variables
218212echo t: # All tab page variables
219213echo g: # All global variables
220- echo l: # All local variables
221- echo s: # All script variables
222- echo a: # All function arguments
223214echo v: # All Vim variables
224215
225216# Constant variables
226217const x = 10 # Constant
227218
228219# Function reference variables
229220var IsString = {x -> type(x) == type('')} # Global
230- var s_isNumber = {x -> type(x) == type(0)} # Local
221+ var isNumber = {x -> type(x) == type(0)} # Local
231222
232223# Multiple value binding
233224var [x, y] = [1, 2]
@@ -448,5 +439,5 @@ endif
448439var g_loaded_my_plugin = true
449440
450441# Default values
451- var s_greeting = get(g:, 'my_plugin_greeting', 'Hello')
442+ var greeting = get(g:, 'my_plugin_greeting', 'Hello')
452443```
0 commit comments