Skip to content
Andy Stewart edited this page Mar 23, 2020 · 5 revisions

Trigger (automatic):

  • open any file
  • open any directory
  • open any file pattern
  • open any directory pattern

or run only when invoked

Root directory:

  • contains a known file (e.g. Rakefile)
  • contains a known directory (e.g. .git/)
  • contains a known symlink directory (e.g. foo/ -> /some/path/)
  • contains a known symlink file (e.g. bar.txt -> /some/file.txt)
  • contains a file matching a pattern (e.g. *.sln)
  • contains a directory matching a pattern ?
  • contains a known subdirectory file (e.g. build/envset-up.sh)
  • is a known directory (e.g. foobar/)

Search:

  • first match (depth-first)
  • nearest match (breadth-first)

No root found:

  • noop
  • change to file's directory
  • change to home directory

Root found:

  • change directory (:cd)
  • change local directory (:lcd)
  • echo new directory or not

Miscellaneous

If bar is a symlinked directory:

  • expand('/foo/bar/', ':p') resolves the symlink
  • expand('/foo/bar', ':p') does not resolve the symlink
Clone this wiki locally