|
1 | | -*eval.txt* For Vim version 8.1. Last change: 2019 Apr 21 |
| 1 | +*eval.txt* For Vim version 8.1. Last change: 2019 Apr 27 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -2398,6 +2398,7 @@ has({feature}) Number |TRUE| if feature {feature} supported |
2398 | 2398 | has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key} |
2399 | 2399 | haslocaldir([{winnr} [, {tabnr}]]) |
2400 | 2400 | Number |TRUE| if the window executed |:lcd| |
| 2401 | + or |:tcd| |
2401 | 2402 | hasmapto({what} [, {mode} [, {abbr}]]) |
2402 | 2403 | Number |TRUE| if mapping to {what} exists |
2403 | 2404 | histadd({history}, {item}) String add an item to a history |
@@ -4918,9 +4919,28 @@ getcwd([{winnr} [, {tabnr}]]) |
4918 | 4919 | directory. See also |haslocaldir()|. |
4919 | 4920 |
|
4920 | 4921 | With {winnr} and {tabnr} return the local current directory of |
4921 | | - the window in the specified tab page. |
| 4922 | + the window in the specified tab page. If {winnr} is -1 return |
| 4923 | + the working directory of the tabpage. |
| 4924 | + If {winnr} is zero use the current window, if {tabnr} is zero |
| 4925 | + use the current tabpage. |
| 4926 | + Without any arguments, return the working directory of the |
| 4927 | + current window. |
4922 | 4928 | Return an empty string if the arguments are invalid. |
4923 | 4929 |
|
| 4930 | + Examples: > |
| 4931 | + " Get the working directory of the current window |
| 4932 | + :echo getcwd() |
| 4933 | + :echo getcwd(0) |
| 4934 | + :echo getcwd(0, 0) |
| 4935 | + " Get the working directory of window 3 in tabpage 2 |
| 4936 | + :echo getcwd(3, 2) |
| 4937 | + " Get the global working directory |
| 4938 | + :echo getcwd(-1) |
| 4939 | + " Get the working directory of tabpage 3 |
| 4940 | + :echo getcwd(-1, 3) |
| 4941 | + " Get the working directory of current tabpage |
| 4942 | + :echo getcwd(-1, 0) |
| 4943 | +< |
4924 | 4944 | getfsize({fname}) *getfsize()* |
4925 | 4945 | The result is a Number, which is the size in bytes of the |
4926 | 4946 | given file {fname}. |
@@ -5478,16 +5498,39 @@ has_key({dict}, {key}) *has_key()* |
5478 | 5498 | an entry with key {key}. Zero otherwise. |
5479 | 5499 |
|
5480 | 5500 | haslocaldir([{winnr} [, {tabnr}]]) *haslocaldir()* |
5481 | | - The result is a Number, which is 1 when the window has set a |
5482 | | - local path via |:lcd|, and 0 otherwise. |
| 5501 | + The result is a Number: |
| 5502 | + 1 when the window has set a local directory via |:lcd| |
| 5503 | + 2 when the tab-page has set a local directory via |:tcd| |
| 5504 | + 0 otherwise. |
5483 | 5505 |
|
5484 | 5506 | Without arguments use the current window. |
5485 | 5507 | With {winnr} use this window in the current tab page. |
5486 | 5508 | With {winnr} and {tabnr} use the window in the specified tab |
5487 | 5509 | page. |
5488 | 5510 | {winnr} can be the window number or the |window-ID|. |
| 5511 | + If {winnr} is -1 it is ignored and only the tabpage is used. |
5489 | 5512 | Return 0 if the arguments are invalid. |
| 5513 | + Examples: > |
| 5514 | + if haslocaldir() == 1 |
| 5515 | + " window local directory case |
| 5516 | + elseif haslocaldir() == 2 |
| 5517 | + " tab-local directory case |
| 5518 | + else |
| 5519 | + " global directory case |
| 5520 | + endif |
5490 | 5521 |
|
| 5522 | + " current window |
| 5523 | + :echo haslocaldir() |
| 5524 | + :echo haslocaldir(0) |
| 5525 | + :echo haslocaldir(0, 0) |
| 5526 | + " window n in current tab page |
| 5527 | + :echo haslocaldir(n) |
| 5528 | + :echo haslocaldir(n, 0) |
| 5529 | + " window n in tab page m |
| 5530 | + :echo haslocaldir(n, m) |
| 5531 | + " tab page m |
| 5532 | + :echo haslocaldir(-1, m) |
| 5533 | +< |
5491 | 5534 | hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* |
5492 | 5535 | The result is a Number, which is 1 if there is a mapping that |
5493 | 5536 | contains {what} in somewhere in the rhs (what it is mapped to) |
@@ -10555,7 +10598,7 @@ ttyin input is a terminal (tty) |
10555 | 10598 | ttyout output is a terminal (tty) |
10556 | 10599 | unix Unix version of Vim. *+unix* |
10557 | 10600 | unnamedplus Compiled with support for "unnamedplus" in 'clipboard' |
10558 | | -user_commands User-defined commands. |
| 10601 | +user_commands User-defined commands. (always true) |
10559 | 10602 | vcon Win32: Virtual console support is working, can use |
10560 | 10603 | 'termguicolors'. Also see |+vtp|. |
10561 | 10604 | vertsplit Compiled with vertically split windows |:vsplit|. |
|
0 commit comments