Oscout is a small command line tool to explore Odoo source code. It uses ripgrep to recursively search the directory, fzf to select the matches and display a preview with bat.
Run oscout
in a directory.
Type in your query. (Note: regular expression meta characters like .(){}*+ have to be escaped)
Use shortcuts to refine the search
<alt-p>
,<alt-j>
,<alt-x>
are going to filter for .py, .js, .xml files<alt-N>
,<alt-I>
,<alt-C>
,<alt-D>
look for the query prefixed with'name ='
,'inherit ='
,'class'
,'def'
Depending on what's to be modified, you could open an issue or a PR.
Arguments given to oscout will be forwarded to ripgrep.
Oscout will also source ~/.config/oscout/env_var.sh
It can be a good place to :
- add executables to the
$PATH
for use in keybindings - export
FZF_DEFAULT_OPTS
orOSCOUT_RG_OPTS
with options for fzf and ripgrep respectively
If the file ~/.config/oscout/bindings
exists, oscout will read it as well as the default one. Key and event binding for fzf can be added/modified there.
For example, to open the selected file with Sublime instead of bat, you can add :
enter:execute(subl {1}:{2}:{3})+accept
Note : the bindings files supports #
comments but will break if they contain trailing whitespaces or trailing empty lines
Clone the repository
git clone https://github.com/dutrieuc/oscout.git oscout && cd oscout
Symlink oscout in ~/.local/bin
to make it usable from everywhere
./setup