Lists

Array or some other data structure

Vimscript lists are ordered, nested. Run the following command:

:echo ['foo', 3, 'bar'] :echo ['foo', [3, 'bar']]

Indexing

Slicing

Concatenation

Exercises

Read :help List. All of it. Notice the capital L.

Read :help add().

Read :help len().

Read :help get().

Read :help index().

Read :help join().

Read :help reverse().

Skim :help functions to find some other list-related functions I haven't mentioned yet. Run :match Keyword /\clist/ to case-insensitively highlight the word list to make it easier to find what you're looking for.

Last updated

Was this helpful?