Skip to content

Context-aware frecency: Local workspace files should show relative paths and get higher ranking #338

@t0w2

Description

@t0w2

Description:

• Plugin: nvim-telescope/telescope-frecency.nvim
• When using frecency globally (without workspace filter), files from the current workspace show absolute paths
• There's no visual distinction between local workspace files and files from other projects
• All files are ranked the same regardless of whether they're in the current workspace

Expected behavior:

• Files in the current workspace should show relative paths (e.g., src/file.lua instead of /home/user/project/src/file.lua)
• Files in the current workspace should get higher ranking/score than files from other workspaces
• This provides visual distinction and prioritizes files relevant to the current context

Use case:

• When working on a project, I want to quickly find files I've opened recently
• I want to easily distinguish between files in my current project vs files from other projects
• Files in my current project are more relevant and should appear higher in the list

Suggested implementation:

• Detect current working directory (workspace)
• When displaying results, show relative paths for files in current workspace, absolute paths for others
• Apply a ranking boost to files in current workspace (e.g., multiply score by 1.5 or add bonus points)
• Make this behavior optional via configuration (e.g., context_aware = true)

Example:

• Current workspace: /home/user/project/
• Global frecency results should show:
• src/main.py (local workspace, higher rank)
• src/utils.py (local workspace, higher rank)
• ~/other-project/config.yaml (different workspace, normal rank)
• ~/dotfiles/init.lua (different workspace, normal rank)

Benefits:

• Visual distinction between local and remote files
• Smarter ranking based on current context
• Faster file discovery within current project
• Maintains frecency's cross-project benefits while adding context awareness

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions