Useful snippets

    Vim

    2024-01-24

    https://vim.rtorr.com/

    Fuzzy search

    2025-12-16

    Telescope & Fzf.vim

    Action Telescope Fzf.vim
    Open all items in quickfixlist [Q] Select all items with [Tab] and hit [Enter]
    List all vim keymaps require('telescope.builtin').keymaps :Maps

    More on Telescope: https://useful-snippets.netlify.app/posts/vim/

    Fzf lua

    Q for selecting all elements with fzf-lua:

    config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept"
    

    From Lazyvim config: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/editor/fzf.lua

    Fzf use cases

    Edit a file

    nvim $(fzf)

    Restore a file from another branch (here: main)

    git checkout main $(fzf)

    Run a specific test in Jest

    npx jest --runTestsByPath $(fzf)