Fzfm’s “modes”
Fzfm has “modes”; I’ll explain what and how using the “dirdiff” mode as an example.
The “dirdiff” mode is essentially a TUI wrapper around the output of diff -qr dir1 dir2
General intro to modes
Fzfm modes are useful to provide specific functionality that you may not need all the time.
- You enter a mode by typing in the mode name or short name (e.g.,
dirdiff, orddfor short), and hittingalt-m. This performs some sort of initialisation, and then the display changes.- You can also directly enter a mode while starting fzfm. E.g., the Gif
below uses
fzfm -m dd dir1 dir2.
- You can also directly enter a mode while starting fzfm. E.g., the Gif
below uses
- When you enter a mode, a mode indicator appears on the fifth line. In
addition, some other information might appear. For example, in the
dirdiff mode you will see three numbers prefixed by
d,l, andr.- They are, respectively, the number of files which are
different, unique to theleft side, and unique to theright side.
- They are, respectively, the number of files which are
- Most modes have their own commands and hotkeys which only work within that
mode. A command must be followed by
alt-m. Hotkeys stand on their own.- Hotkeys example: in “dirdiff” mode,
alt-mruns vimdiff of the left file and the right file. In “git” mode,alt-ptoggles between showing and not showing--patchin the git log output. - Commands example: in “dirdiff” mode, typing
d, thenalt-mwill show you only the files that are different on both sides. In “git” mode,mrc+alt-mshows all files in most recently committed order.
- Hotkeys example: in “dirdiff” mode,
- Most modes also respond to
helporh(+alt-m) to show you a brief help. - Some modes may also respond to
F5to refresh the mode. This reruns the initialisation (in “dirdiff”, this would rerun thediff -qrcommand), and also resets the display to the default. - Finally, you exit a mode by hitting Escape (not shown in Gif below).
Here’s a brief Gif that shows off all this.