@@ -1783,16 +1783,23 @@ charidx({string}, {idx} [, {countcc} [, {utf16}]])
17831783 Return type: | Number |
17841784
17851785
1786- chdir({dir} ) *chdir()*
1787- Change the current working directory to {dir} . The scope of
1788- the directory change depends on the directory of the current
1789- window:
1790- - If the current window has a window-local directory
1791- (| :lcd | ), then changes the window local directory.
1792- - Otherwise, if the current tabpage has a local
1793- directory (| :tcd | ) then changes the tabpage local
1794- directory.
1795- - Otherwise, changes the global directory.
1786+ chdir({dir} [, {scope} ]) *chdir()*
1787+ Changes the current working directory to {dir} . The scope of
1788+ the change is determined as follows:
1789+ If {scope} is not present, the current working directory is
1790+ changed to the scope of the current directory:
1791+ - If the window local directory (| :lcd | ) is set, it
1792+ changes the current working directory for that scope.
1793+ - Otherwise, if the tab page local directory (| :tcd | ) is
1794+ set, it changes the current directory for that scope.
1795+ - Otherwise, changes the global directory for that scope.
1796+
1797+ If {scope} is present, changes the current working directory
1798+ for the specified scope:
1799+ "window" Changes the window local directory. | :lcd |
1800+ "tabpage" Changes the tab page local directory. | :tcd |
1801+ "global" Changes the global directory. | :cd |
1802+
17961803 {dir} must be a String.
17971804 If successful, returns the previous working directory. Pass
17981805 this to another chdir() to restore the directory.
0 commit comments