From a0e39b30e6b3c98c390d45974f4d9858e190ef7e Mon Sep 17 00:00:00 2001 From: 111110100 Date: Mon, 11 May 2026 17:28:39 +1000 Subject: [PATCH] Add VIM usage instructions for leaf Added instructions for using leaf with VIM, including keybindings and configuration. Signed-off-by: 111110100 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index dd9fad1..b919479 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,15 @@ find . -name '*.md' | fzf --preview 'leaf --inline ansi {}' find . -name '*.md' | fzf --preview 'leaf --inline ansi:$FZF_PREVIEW_COLUMNS {}' ``` +## Using with VIM + +To configure keybindings with `vim` that opens a vertical split and run `leaf -w` to preview current markdown file. The shortcut **\md** (pressing `\` followed by `md`). Pressing `CTRL+w,h` moves the focus back to the main Markdown file for editing. Add the following to your `~/.vimrc` file: + +```vim +" Pressing m will open a vertical split on the right and run leaf +nnoremap md :vertical botright terminal leaf -w % +``` + ## Configuration Set default values for theme, editor, and watch mode via `config.toml`: