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:
@@ -270,18 +270,19 @@ telescope.setup({opts}) *telescope.setup()*
|
||||
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`.
|
||||
@@ -306,6 +307,21 @@ telescope.setup({opts}) *telescope.setup()*
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user