Skip to content

Commit

Permalink
docs: add note for multi directories in workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus committed Nov 24, 2024
1 parent e5c3f72 commit cb90035
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 20 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ Frecency tackles this with *Workspace Filters*:

The workspace filter feature enables you to select from user defined _filter
tags_ that map to a directory or collection of directories. Filters are applied
by entering `:workspace_tag:` anywhere in the query. Filter name completion is
available by pressing `<Tab>` after the first `:` character.
by entering `:workspace_tag:` anywhere in the query. You can complete names by
pressing `<Tab>` after the first `:` character (in default setting).

When a filter is applied, results are reduced to entries whose path is a
descendant of the workspace directory. The indexed results are optionally
descendant of the workspace directories. The indexed results are optionally
augmented with a listing of _all_ files found in a recursive search of the
workspace directory. Non-indexed files are given a score of zero and appear
below the 'frecent' entries. When a non-indexed file is opened, it gains a
score value and is available in future 'frecent' search results.
workspace directories. Non-indexed files are given a score of zero and appear
below the _frecent_ entries. When a non-indexed file is opened, it gains a
score value and is available in future _frecent_ search results.

In default, pre-defined workspace tag: `CWD` is available. that is, you can
filter entries into ones under the current working directory.

If the active buffer (prior to the finder being launched) is attached to an LSP
server, an automatic `LSP` tag is available, which maps to the workspace
Expand Down Expand Up @@ -85,7 +88,7 @@ See `:h telescope-frecency-configuration` to know about further configurations.

Filter tags are applied by typing the `:tag:` name (adding surrounding colons)
in the finder query. Entering `:<Tab>` will trigger omni completion for
available tags.
available tags (in default setting).

## References

Expand Down
41 changes: 28 additions & 13 deletions doc/telescope-frecency.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,28 @@ Frecency tackles this with “Workspace Filters”.
WORKSPACE FILTER *telescope-frecency-introduction-workspace-filter*

This feature enables you to select from user defined “filter tags” that map to
a directory or collection of directories. Filters are applied by entering
`:workspace_tag:` anywhere in the query. Filter name completion is available by
pressing `<Tab>` after the first `:` character.
a directory or a collection of directories. Filters are applied by entering
`:workspace_tag:` anywhere in the query. You can complete names by pressing
`<Tab>` after the first `:` character (see
|telescope-frecency-configuration-enable_prompt_mappings|).

When a filter is applied, results are reduced to entries whose path is a
descendant of the workspace directory. The indexed results are optionally
descendant of the workspace directories. The indexed results are optionally
augmented with a listing of “all” files found in a recursive search of the
workspace directory. Non-indexed files are given a score of zero and appear
workspace directories. Non-indexed files are given a score of zero and appear
below the “frecent” entries. When a non-indexed file is opened, it gains a
score value and is available in future “frecent” search results.

In default, pre-defined workspace tag: `CWD` is available, that is, you can
filter entries into ones under the current working directory.

If the active buffer (prior to the finder being launched) is attached to an
LSP server, an automatic `LSP` tag is available, which maps to the workspace
directories provided by the language server.

You can define other workspace tags by an option:
|telescope-frecency-configuration-workspaces|.


==============================================================================
REQUIREMENTS *telescope-frecency-requirements*
Expand Down Expand Up @@ -707,18 +714,26 @@ because of performance consideration.
workspaces ~

Default: `{}`
Type: `table<string, string>`
Type: `table<string, string[]>`

This table contains mappings of `workspace_tag``workspace_directory`. The key
corresponds to the `:tag_name` used to select the filter in queries. The value
corresponds to the top level directory by which results will be filtered.
This table contains mappings of `workspace_tag``workspace_directories`. The key
corresponds to the `:tag_name:` used to select the filter in queries. The value
corresponds to the top level directories by which results will be filtered.

When multiple directories are set to one `workspace_tag` such as `:PJT:` in this
example setting below, you can show entries containing results filtered with
each directory.
>lua
-- example configuration
workspaces = {
["conf"] = "/home/my_username/.config",
["data"] = "/home/my_username/.local/share",
["project"] = "/home/my_username/projects",
["wiki"] = "/home/my_username/wiki",
CONF = "/home/my_username/.config",
DATA = "/home/my_username/.local/share",
WIKI = "/home/my_username/wiki",
PJT = {
"/home/my_username/project_foo",
"/home/my_username/project_bar",
"/home/my_username/project_foobar",
},
}


Expand Down

0 comments on commit cb90035

Please sign in to comment.