1- *eval.txt* For Vim version 7.3. Last change: 2013 Jan 23
1+ *eval.txt* For Vim version 7.3. Last change: 2013 Feb 20
22
33
44 VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1777,7 +1777,8 @@ get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
17771777get( {dict} , {key} [, {def} ]) any get item {key} from {dict} or {def}
17781778getbufline( {expr} , {lnum} [, {end} ])
17791779 List lines {lnum} to {end} of buffer {expr}
1780- getbufvar( {expr} , {varname} ) any variable {varname} in buffer {expr}
1780+ getbufvar( {expr} , {varname} [, {def} ])
1781+ any variable {varname} in buffer {expr}
17811782getchar( [expr] ) Number get one character from the user
17821783getcharmod( ) Number modifiers for the last typed character
17831784getcmdline() String return the current command-line
@@ -1798,12 +1799,14 @@ getpos( {expr}) List position of cursor, mark, etc.
17981799getqflist() List list of quickfix items
17991800getreg( [{regname} [, 1]]) String contents of register
18001801getregtype( [{regname} ]) String type of register
1801- gettabvar( {nr} , {varname} ) any variable {varname} in tab {nr}
1802- gettabwinvar( {tabnr} , {winnr} , {name} )
1802+ gettabvar( {nr} , {varname} [, {def} ])
1803+ any variable {varname} in tab {nr} or {def}
1804+ gettabwinvar( {tabnr} , {winnr} , {name} [, {def} ])
18031805 any {name} in {winnr} in tab page {tabnr}
18041806getwinposx() Number X coord in pixels of GUI Vim window
18051807getwinposy() Number Y coord in pixels of GUI Vim window
1806- getwinvar( {nr} , {varname} ) any variable {varname} in window {nr}
1808+ getwinvar( {nr} , {varname} [, {def} ])
1809+ any variable {varname} in window {nr}
18071810glob( {expr} [, {nosuf} [, {list} ]])
18081811 any expand file wildcards in {expr}
18091812globpath( {path} , {expr} [, {flag} ])
@@ -3143,7 +3146,7 @@ getbufline({expr}, {lnum} [, {end}])
31433146 Example: >
31443147 :let lines = getbufline(bufnr("myfile"), 1, "$")
31453148
3146- getbufvar({expr} , {varname} ) *getbufvar()*
3149+ getbufvar({expr} , {varname} [, {def} ] ) *getbufvar()*
31473150 The result is the value of option or local buffer variable
31483151 {varname} in buffer {expr} . Note that the name without "b:"
31493152 must be used.
@@ -3153,8 +3156,8 @@ getbufvar({expr}, {varname}) *getbufvar()*
31533156 doesn't work for a global variable, window-local variable or
31543157 window-local option.
31553158 For the use of {expr} , see | bufname() | above.
3156- When the buffer or variable doesn't exist an empty string is
3157- returned, there is no error message.
3159+ When the buffer or variable doesn't exist {def} or an empty
3160+ string is returned, there is no error message.
31583161 Examples: >
31593162 :let bufmodified = getbufvar(1, "&mod")
31603163 :echo "todo myvar = " . getbufvar("todo", "myvar")
@@ -3431,26 +3434,30 @@ getregtype([{regname}]) *getregtype()*
34313434 <CTRL-V> is one character with value 0x16.
34323435 If {regname} is not specified, | v:register | is used.
34333436
3434- gettabvar({tabnr} , {varname} ) *gettabvar()*
3437+ gettabvar({tabnr} , {varname} [, {def} ] ) *gettabvar()*
34353438 Get the value of a tab-local variable {varname} in tab page
34363439 {tabnr} . | t:var |
34373440 Tabs are numbered starting with one.
34383441 Note that the name without "t:" must be used.
3442+ When the tab or variable doesn't exist {def} or an empty
3443+ string is returned, there is no error message.
34393444
3440- gettabwinvar({tabnr} , {winnr} , {varname} ) *gettabwinvar()*
3445+ gettabwinvar({tabnr} , {winnr} , {varname} [, {def} ] ) *gettabwinvar()*
34413446 Get the value of window-local variable {varname} in window
34423447 {winnr} in tab page {tabnr} .
34433448 When {varname} starts with "&" get the value of a window-local
34443449 option.
3450+ When {varname} is empty a dictionary with all window-local
3451+ variables is returned.
3452+ Note that {varname} must be the name without "w:".
34453453 Tabs are numbered starting with one. For the current tabpage
34463454 use | getwinvar() | .
34473455 When {winnr} is zero the current window is used.
34483456 This also works for a global option, buffer-local option and
34493457 window-local option, but it doesn't work for a global variable
34503458 or buffer-local variable.
3451- When {varname} is empty a dictionary with all window-local
3452- variables is returned.
3453- Note that {varname} must be the name without "w:".
3459+ When the tab, window or variable doesn't exist {def} or an
3460+ empty string is returned, there is no error message.
34543461 Examples: >
34553462 :let list_is_on = gettabwinvar(1, 2, '&list')
34563463 :echo "myvar = " . gettabwinvar(3, 1, 'myvar')
@@ -3465,7 +3472,7 @@ getwinposy() The result is a Number, which is the Y coordinate in pixels of
34653472 the top of the GUI Vim window. The result will be -1 if the
34663473 information is not available.
34673474
3468- getwinvar({winnr} , {varname} ) *getwinvar()*
3475+ getwinvar({winnr} , {varname} [, {def} ] ) *getwinvar()*
34693476 Like | gettabwinvar() | for the current tabpage.
34703477 Examples: >
34713478 :let list_is_on = getwinvar(2, '&list')
0 commit comments