Skip to content

:unlet $FOOBAR #1116

@LucHermitte

Description

@LucHermitte

When an environment variable isn't set, exists() return false. We can assign a value to the variable with :let, after which point it exists. But we can't revert to an non-existent state (related to unsetenv (3C))

call assert_false(exists('$FOOBAR'))
let $FOOBAR = 1
call assert_true(exists('$FOOBAR'))
unlet $FOOBAR
call assert_false(exists('$FOOBAR'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions