Skip to content

Is it possible to have blocks of text in my cheat sheets #954

@gabriel-vanzandycke

Description

@gabriel-vanzandycke

I like to use cheat sheets not only for command lines, but also for any block of code or text.

A naive example of cheat-block would be on how to git rebase:

1. fetch latest changes on main branch
2. call `git rebase <main-branch>` from the working branch
3. for each commit, solve conflict files and call `git add`
4. continue rebase with `git-rebase --continue`
5. once done, a force push may be required: `git push -f`

Another example would be to have a compact list of arguments for a command:

iostat
	-d     # The -d option is exclusive of the -c option and displays only the device utilization report.
	-k     # Display statistics in kilobytes per second instead of blocks per second.
	-t     # Print the time for each report displayed.
	-x     # Display  extended  statistics

I also have cheats like that don't correspond to commands that should be executed:

[ -b FILE ]	True if FILE exists and is a block-special file.
[ -c FILE ]	True if FILE exists and is a character-special file.
[ -d FILE ]	True if FILE exists and is a directory.
[ -e FILE ]	True if FILE exists.
...

And a last example:

!!     # execute last command.
!top   # execute the most recent command that starts with ‘top’ (e.g. !).
!top:p # displays the command that !top would run (also adds it as the latest command in the command history).
!$:p   # displays the word that !$ would execute.
!*     # displays the last word of the previous command.
!*:p   # displays the last word that !* would substitute.

The current implementation of navi doesn't allow for this type of cheat sheets.
A workaround is to split each line into multiple lines, with a common prefix, but lines can get messed-up in the fuzzy search. And it doesn't provide a compact result.

It would be great to have the possibility to have navi dump a block of text on stdout, such that it can be handily peaked for command composition right after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions