Skip to content

Instantly share code, notes, and snippets.

@ghiden
Last active July 26, 2025 08:33
Show Gist options
  • Save ghiden/109e8a3379fbb004731cc88407753c55 to your computer and use it in GitHub Desktop.
Save ghiden/109e8a3379fbb004731cc88407753c55 to your computer and use it in GitHub Desktop.
notational velocity (nvalt) alternative one-liner using skim, ripgrep, and fzf in vim/nvim
#/bin/bash
# Given a directory:
# - fuzzy matches against filenames (fzf/sk/...)
# - exact matches against contents (rg)
# Key bindings:
# enter: open the selected file
# ctrl-n: open new file with QUERY_STRING.txt
# config
NVALT_DIR=YOUR_NVALT_DIR
EDITOR=nvim
FUZZY=fzf
cd $HOME/$NVALT_DIR && sk \
--ansi \
-i \
-c "(rg --files | $FUZZY --filter \"{}\" & rg -S -l \"{}\") | uniq" \
--bind "enter:execute($EDITOR {}),ctrl-n:execute($EDITOR {cq}.txt)" \
--preview "$HOME/.vim/plugged/fzf.vim/bin/preview.sh {}" \
--preview-window down:wrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment