Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command less - [l]ess

Hides matching lines.

Example: hide “print_”

rxedit sample.rs 'a::fn.*_message' less::print_

  • a::fn.*_message only lines matching the regex fn.*_message are shown.
    • This regex is quoted because the shell may interpret special characters.
  • less::print_ hides lines that contain print_.

Output

fn make_message() -> String {
    fn always_pass_message(){

Search flags

NameFormatExampleDescription
insensitivei::icase-insentive search
afterA(\d+)::A16Show NUM lines after each match.
beforeB(\d+)::B5Show NUM lines before each match.
contextC(\d+)::C5Show NUM lines before and after each match.
fixed_stringF::Ftreat search as regular string, not a regex
use_grep_shortcodesg::gexpands shortcodes (..→.*, ~~s.→ +)
no_use_grep_shortcodesG::Gdoes not expand grep shortcodes
show_ownero::oshow “owner” of the line
set keysk=([a-z]+)(?:.|/|$)::sk=importan/ set key to a value that can be used with wk=. in later commands
where_keywk=([a-z]+)(?:.|/|$)::wk=mykey/puts an extra criteria to other commands
where_linenumwl=([-0-9A-Ca-chtHT,.]+)::wl=..5,8,-1/limit line number range

SEE ALSO

shortcodes, chaining, noop

Remark:

The [A]fter / [B]efore / [C]ontext flags don’t work for now. They’re there because the intent is to hide matching lines and then hide before/after lines.