Plugin catalog
keyword_search
Searches files in the current directory for keywords, then lets you view, copy, save or analyze the matches.
↓ on this page
keyword_search searches the files in the current directory for keywords and lets you pick which matches to view, copy or save. Reach for it when you want to go through matches by hand. To search a whole tree, use lla --search.
Turn it on
The search action works whether or not the plugin is on. Turn it on to mark files in listings that contain your configured keywords:
# ~/.config/lla/config.toml
enabled_plugins = ["keyword_search"]Or run lla --enable-plugin keyword_search, which writes the same setting, so it stays on. lla --disable-plugin keyword_search removes it.
To list the files that match, read the field from JSON. Set keywords in settings first:
lla --json | jq -r '.[] | select(.plugin.keyword_matches != null) | .name'Makefile
main.rsActions
Run an action with lla plugin run keyword_search <action>.
| Action | What it does |
|---|---|
search | Search files in the current directory, then pick files and matches to work with |
help | Show help |
Both are interactive, so they need a TTY.
search uses keywords from your settings. With none set, it asks for space-separated keywords and doesn't save them. It doesn't look in subdirectories, and it skips files without a listed extension.
Example
lla plugin run keyword_search searchSelect files with space and press Enter, then do the same for matches. A menu then offers: View detailed matches, Copy to clipboard, Save to file, Show statistics, Filter matches and Advanced analysis.
With keywords = ["TODO"], View detailed matches on main.rs shows the match in context:
1 │ fn main() {
2 │ let data = load();
3 │ // TODO: handle errors
4 │ run(data);
5 │ }Settings
Edit ~/.config/lla/plugins/keyword_search/config.toml:
keywords = ["TODO", "FIXME"]
case_sensitive = false
use_regex = false
context_lines = 2
max_matches = 5
file_extensions = ["txt", "md", "rs", "py", "js", "java", "c", "cpp", "h", "hpp", "go", "rb", "php", "html", "css", "json", "yaml", "yml", "toml", "ini", "conf"]keywords is empty by default. max_matches applies per file. The listing check also searches files with no extension.
Permissions
write:user-path for Save to file, read:selection to read the files you list, and clipboard for Copy to clipboard.