Skip to content

Add autocmd for DirChangedPre to enable doing some work before the cwd changes #9721

@rmagatti

Description

@rmagatti

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.

As the plugin author of https://github.com/rmagatti/auto-session/ I'd like to be able to do some session related work before the cwd changes.

In the context of this issue for example rmagatti/auto-session#102 when :cd is called, I'd like to be able to save the current session and clear the current session tracking from the plugin before the cwd changes. Then on DirChanged I'd want to evaluate if the now current cwd has a mapped session or not. Today I can only do the DirChanged portion of this.

Describe the solution you'd like

Ideally I'd have a DirChangedPre to work with. It would be an autocmd called right before the actual cwd change.

Describe alternatives you've considered**

Right now there's no real alternative. At least not one that enables me to save the session before anything happens to the cwd. The only real workaround is stopping the plugin from tracking the current session when a DirChanged happens, but that isn't really enough.

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions