aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-07 05:21:39 +0800
committerGitHub <noreply@github.com>2022-02-07 05:21:39 +0800
commite2466d84bc818c8e61751972b501551aab07d13c (patch)
treee0a70770c74c482b3e22d380bddb8ce31a8ede4c /runtime/doc/builtin.txt
parentf0699f43566cd3e5f7fbc4d1e2802c610b5bfa5c (diff)
parentd65ee129143fedd43178c9be52095b5d2d06b5c2 (diff)
downloadrneovim-e2466d84bc818c8e61751972b501551aab07d13c.tar.gz
rneovim-e2466d84bc818c8e61751972b501551aab07d13c.tar.bz2
rneovim-e2466d84bc818c8e61751972b501551aab07d13c.zip
Merge pull request #17305 from zeertzjq/vim-8.2.1741
vim-patch:8.2.1741: pathshorten() only supports using one character
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index c68e86462d..56bc8bfb3e 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -314,7 +314,7 @@ nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
nr2char({expr}[, {utf8}]) String single char with ASCII/UTF-8 value {expr}
nvim_...({args}...) any call nvim |api| functions
or({expr}, {expr}) Number bitwise OR
-pathshorten({expr}) String shorten directory names in a path
+pathshorten({expr} [, {len}]) String shorten directory names in a path
perleval({expr}) any evaluate |perl| expression
pow({x}, {y}) Float {x} to the power of {y}
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
@@ -5204,13 +5204,17 @@ or({expr}, {expr}) *or()*
< Can also be used as a |method|: >
:let bits = bits->or(0x80)
-pathshorten({path}) *pathshorten()*
+pathshorten({expr} [, {len}]) *pathshorten()*
Shorten directory names in the path {path} and return the
result. The tail, the file name, is kept as-is. The other
- components in the path are reduced to single letters. Leading
- '~' and '.' characters are kept. Example: >
+ components in the path are reduced to {len} letters in length.
+ If {len} is omitted or smaller than 1 then 1 is used (single
+ letters). Leading '~' and '.' characters are kept. Examples: >
:echo pathshorten('~/.config/nvim/autoload/file1.vim')
< ~/.c/n/a/file1.vim ~
+>
+ :echo pathshorten('~/.config/nvim/autoload/file2.vim', 2)
+< ~/.co/nv/au/file2.vim ~
It doesn't matter if the path exists or not.
Can also be used as a |method|: >