Mercurial > vim
comparison runtime/doc/eval.txt @ 7615:228ff048db20 v7.4.1107
commit https://github.com/vim/vim/commit/da440d21a6b94d7f525fa7be9b1417c78dd9aa4c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 16 21:27:23 2016 +0100
patch 7.4.1107
Problem: Vim can create a directory but not delete it.
Solution: Add an argument to delete() to make it possible to delete a
directory, also recursively.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Jan 2016 21:30:05 +0100 |
parents | 3012eaddb6b2 |
children | befbed72da87 |
comparison
equal
deleted
inserted
replaced
7614:427b35579737 | 7615:228ff048db20 |
---|---|
1 *eval.txt* For Vim version 7.4. Last change: 2016 Jan 15 | 1 *eval.txt* For Vim version 7.4. Last change: 2016 Jan 16 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
916 :let l = mylist[4:4] " List with one item | 916 :let l = mylist[4:4] " List with one item |
917 :let l = mylist[:] " shallow copy of a List | 917 :let l = mylist[:] " shallow copy of a List |
918 | 918 |
919 Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an | 919 Using expr8[expr1] or expr8[expr1a : expr1b] on a |Funcref| results in an |
920 error. | 920 error. |
921 | |
922 Watch out for confusion between a namespace and a variable followed by a colon | |
923 for a sublist: > | |
924 mylist[n:] " uses variable n | |
925 mylist[s:] " uses namespace s:, error! | |
921 | 926 |
922 | 927 |
923 expr8.name entry in a |Dictionary| *expr-entry* | 928 expr8.name entry in a |Dictionary| *expr-entry* |
924 | 929 |
925 If expr8 is a |Dictionary| and it is followed by a dot, then the following | 930 If expr8 is a |Dictionary| and it is followed by a dot, then the following |
1792 Number checks existence of cscope connection | 1797 Number checks existence of cscope connection |
1793 cursor( {lnum}, {col} [, {off}]) | 1798 cursor( {lnum}, {col} [, {off}]) |
1794 Number move cursor to {lnum}, {col}, {off} | 1799 Number move cursor to {lnum}, {col}, {off} |
1795 cursor( {list}) Number move cursor to position in {list} | 1800 cursor( {list}) Number move cursor to position in {list} |
1796 deepcopy( {expr} [, {noref}]) any make a full copy of {expr} | 1801 deepcopy( {expr} [, {noref}]) any make a full copy of {expr} |
1797 delete( {fname}) Number delete file {fname} | 1802 delete( {fname} [, {flags}]) Number delete the file or directory {fname} |
1798 did_filetype() Number TRUE if FileType autocommand event used | 1803 did_filetype() Number TRUE if FileType autocommand event used |
1799 diff_filler( {lnum}) Number diff filler lines about {lnum} | 1804 diff_filler( {lnum}) Number diff filler lines about {lnum} |
1800 diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} | 1805 diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col} |
1801 empty( {expr}) Number TRUE if {expr} is empty | 1806 empty( {expr}) Number TRUE if {expr} is empty |
1802 escape( {string}, {chars}) String escape {chars} in {string} with '\' | 1807 escape( {string}, {chars}) String escape {chars} in {string} with '\' |
2746 Nesting is possible up to 100 levels. When there is an item | 2751 Nesting is possible up to 100 levels. When there is an item |
2747 that refers back to a higher level making a deep copy with | 2752 that refers back to a higher level making a deep copy with |
2748 {noref} set to 1 will fail. | 2753 {noref} set to 1 will fail. |
2749 Also see |copy()|. | 2754 Also see |copy()|. |
2750 | 2755 |
2751 delete({fname}) *delete()* | 2756 delete({fname} [, {flags}]) *delete()* |
2752 Deletes the file by the name {fname}. The result is a Number, | 2757 Without {flags} or with {flags} empty: Deletes the file by the |
2753 which is 0 if the file was deleted successfully, and non-zero | 2758 name {fname}. |
2754 when the deletion failed. | 2759 |
2760 When {flags} is "d": Deletes the directory by the name | |
2761 {fname}. This fails when {fname} is not empty. | |
2762 | |
2763 When {flags} is "rf": Deletes the directory by the name | |
2764 {fname} and everything in it, recursively. Be careful! | |
2765 | |
2766 The result is a Number, which is 0 if the delete operation was | |
2767 successful and -1 when the deletion failed or partly failed. | |
2768 | |
2755 Use |remove()| to delete an item from a |List|. | 2769 Use |remove()| to delete an item from a |List|. |
2756 To delete a line from the buffer use |:delete|. Use |:exe| | 2770 To delete a line from the buffer use |:delete|. Use |:exe| |
2757 when the line number is in a variable. | 2771 when the line number is in a variable. |
2758 | 2772 |
2759 *did_filetype()* | 2773 *did_filetype()* |