summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLuke Kershaw <35707277+l-kershaw@users.noreply.github.com>2021-11-14 09:37:15 +0000
committerGitHub <noreply@github.com>2021-11-14 09:37:15 +0000
commit729492406ec3b545c4ecf2beadf7bd30c81e70e4 (patch)
treeca01ef0d8f5392326bf1df6817464d9166635bb1 /doc
parentb2f16c788ec0f1c72a500c67f5ad93d08a646b30 (diff)
feat: `exclude` option for `shorten` in `path_display` (#1429)
* feat: allow excluding positions for `shorten` in `path_display` * [docgen] Update doc/telescope.txt skip-checks: true Co-authored-by: Github Actions <actions@github>
Diffstat (limited to 'doc')
-rw-r--r--doc/telescope.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/telescope.txt b/doc/telescope.txt
index bc02489..54691a6 100644
--- a/doc/telescope.txt
+++ b/doc/telescope.txt
@@ -207,6 +207,20 @@ telescope.setup({opts}) *telescope.setup()*
Similarly, `path_display.shorten = 2` will give a path like:
`al/be/ga/delta.txt`
+ You can also further customise the shortening behaviour by
+ setting `path_display.shorten = { len = num, exclude = list }`,
+ where `len` acts as above, and `exclude` is a list of positions
+ that are not shortened. Negative numbers in the list are considered
+ relative to the end of the path.
+ e.g. for a path like
+ `alpha/beta/gamma/delta.txt`
+ setting `path_display.shorten = { len = 1, exclude = {1, -1} }`
+ will give a path like:
+ `alpha/b/g/delta.txt`
+ setting `path_display.shorten = { len = 2, exclude = {2, -2} }`
+ will give a path like:
+ `al/beta/gamma/de`
+
path_display can also be set to 'hidden' string to hide file names
path_display can also be set to a function for custom formatting of