> temporarily changing directory is used widely in plugins, maybe a function > form is better: > > ``` > function chdir(path, mode = 0) > ``` > > It will change current directory to `path`, and returns the previous path for > success, empty string for failure. When mode is zero (by default), it behaves > like normal `cd` command, otherwise it will take care of window/tab local > directory like `ecd`. > > And life will be much easier with `chdir()`: > > ```VimL > let previous = chdir(somewhere, 1) > ... > chdir(previous) > ``` > > No need for "exe" statement, no need for "fnameescape" too.
True. I think we can drop the extra argument and always take care of local directories. Otherwise the existing :cd command can be used. Or we get a discussion that the argument should be "global", "local", "tab" or "auto". I don't think we need that. -- Q: How does a UNIX Guru pick up a girl? A: look; grep; which; eval; nice; uname; talk; date; /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
