feat(entry_maker): add 'filename_first' option for path_display (#3010)

* Initial commit

* Fixes issue with find_files where devicons where disabled

* Fixes issue with vimgrep where devicons where disabled

* Fixes trailing space for path with only a file name

* Adds test for reverse path_display

* Refactors reverse to filename_first

* Adds tests

* Fixes highlighting

* Fixes linting issues

* Uses trim function

* Fixes issue with highlighting

* Moves local function to utils

* Removes redundant code

* Adds highlighting for gen_from_buffer

* fix formatting

---------

Co-authored-by: alycklama <>
Co-authored-by: James Trew <j.trew10@gmail.com>
This commit is contained in:
Anton
2024-04-20 06:21:35 +02:00
committed by GitHub
parent 10d57f38f5
commit a4432dfb9b
5 changed files with 155 additions and 40 deletions

View File

@@ -304,18 +304,19 @@ append(
Determines how file paths are displayed.
path_display can be set to an array with a combination of:
- "hidden" hide file names
- "tail" only display the file name, and not the path
- "absolute" display absolute paths
- "smart" remove as much from the path as possible to only show
the difference between the displayed paths.
Warning: The nature of the algorithm might have a negative
performance impact!
- "shorten" only display the first character of each directory in
the path
- "truncate" truncates the start of the path when the whole path will
not fit. To increase the gap between the path and the edge,
set truncate to number `truncate = 3`
- "hidden" hide file names
- "tail" only display the file name, and not the path
- "absolute" display absolute paths
- "smart" remove as much from the path as possible to only show
the difference between the displayed paths.
Warning: The nature of the algorithm might have a negative
performance impact!
- "shorten" only display the first character of each directory in
the path
- "truncate" truncates the start of the path when the whole path will
not fit. To increase the gap between the path and the edge,
set truncate to number `truncate = 3`
- "filename_first" shows filenames first and then the directories
You can also specify the number of characters of each directory name
to keep by setting `path_display.shorten = num`.
@@ -340,6 +341,21 @@ append(
will give a path like:
`al/beta/gamma/de`
path_display can also be set to 'filename_first' to put the filename
in front.
path_display = {
"filename_first"
},
The directory structure can be reversed as follows:
path_display = {
filename_first = {
reverse_directories = true
}
},
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