Skip to content

Conversation

masakiq
Copy link

@masakiq masakiq commented Aug 3, 2025

Add strip_path_prefix configuration option to remove specified prefixes from file paths in telescope displays. This is useful when running in containers where file paths contain unwanted prefixes that clutter the display.

  • Add strip_path_prefix config option with documentation
  • Implement path prefix stripping in gen_from_quickfix
  • Use vim.pesc for safe pattern escaping
  • Default value is nil (no stripping)

Example usage: strip_path_prefix = "/app/"

modified: lua/telescope/config.lua
modified: lua/telescope/make_entry.lua

Description

Please include a summary of the change and which issue is fixed. Please also
include relevant motivation and context

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list relevant details about your configuration

  • Test A
  • Test B

Configuration:

  • Neovim version (nvim --version):
  • Operating system and version:

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

Add strip_path_prefix configuration option to remove specified
prefixes from file paths in telescope displays. This is useful
when running in containers where file paths contain unwanted
prefixes that clutter the display.

- Add strip_path_prefix config option with documentation
- Implement path prefix stripping in gen_from_quickfix
- Use vim.pesc for safe pattern escaping
- Default value is nil (no stripping)

Example usage: strip_path_prefix = "/app/"

modified:   lua/telescope/config.lua
modified:   lua/telescope/make_entry.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant