“git” mode
The Gif below (just over a minute long) shows fzfm’s “git” mode. However, it’s probably useful to have some notes as a refresher, so you don’t have to watch the gif if you don’t want to.
Basics
cdto a directory that contains a git repo, and typeg+alt-mto get into git mode.- A “mode” indicator appears, showing
mode: git, on the 5th line.- After that you get 4 numbers in colors; the count of deleted files is
in. red, modified in yellow, new (untracked) in green, and ignored in
blue.
- Sadly, at the moment, this does not show staged file counts, only un-staged.
- After this is the branch name.
- After that you get 4 numbers in colors; the count of deleted files is
in. red, modified in yellow, new (untracked) in green, and ignored in
blue.
- The preview changes to a
git log --statfor the file or directory the cursor is on. Toggle between that and the normal view usingalt+m.- You can hit
alt-pto toggle--patchin the preview window.
- You can hit
- If the cursor is on a file that has un-staged changes, then the preview
window shows a
git diffbefore thegit log --stat.- Scrolling the previews depends on how you’ve set your
FZF_DEFAULT_OPTIONS
- Scrolling the previews depends on how you’ve set your
Changing the view
- You can change the view by typing a command and then hitting
alt+m.alt-pstill works to toggle--patchin any of these views.
icommand shows you ignored files- Similarly
mfor modified,dfor deleted, andnfor new allshows all files.mrcshows all files in most recently committed order.- I find myself using this mode quite often; I may add a hot key for it.
- See below for how
F5resets the view to the default
Further customisation (not shown in the Gif)
-
To add a hotkey for a frequently used sub-command (e.g., in my case,
mrc), add something like this to~/.config/fzfm/cmd_hist: key=alt-R ; set fzfm_mode; fzfm_mode_handler g; fzfm_mode_handler mrcThen, pressing
alt-shift-rwill switch to git mode and get you the “most recently committed files” view.At present it’s not possible to add a hotkey only for a mode without touching the source code for the mode.