2024-04-29

Vim Fuzzy Finder and Search Tools

This post describes two minimalist Vim9script plugins that harness the capabilities of fd and ripgrep, two robust Rust tools renowned for their speed and efficiency.

Vim9PsGrep

This extension (Vim9script) seamlessly integrates the power of ripgrep with Vim. It achieves this by utilizing a set of PowerShell scripts and Visual Basic popups. The primary purpose of this plugin is to enhance your code navigation and editing workflow by providing efficient search capabilities.

Here are the key features and details about vim9psgrep:

- Integration with ripgrep: The plugin acts as a wrapper around ripgrep, a powerful command-line search tool. By leveraging ripgrep, vim9psgrep enables you to perform fast and efficient searches within your Vim environment.

- Compatibility with PowerShell Desktop and PowerShell Core: While it was initially tested with PowerShell Desktop, it should also work seamlessly with PowerShell Core. This flexibility ensures that users across different environments can benefit from its functionality.

Installation: To install vim9psgrep, simply add the following line to your .vimrc file using the Plug plugin manager:

  
    Plug 'sevehub/vim9psgrep'

Pre-set Mappings:

<leader>gw

This mapping allows you to locate the word under the cursor (grep word). It's a quick way to find occurrences of the current word within your codebase.

<leader>gp

Use this mapping to open a popup where you can enter a search pattern (grep pattern).

The results will be compiled into Vim’s quickfix list, allowing you to navigate through them efficiently.

FdMiniFuzzy

Fdminifuzzy improves cross-platform compatibility, enhancing the fuzzy finder capabilities of minifuzzy.vim. Its primary purpose is to enhance your file navigation experience by providing efficient fuzzy search functionality.

Installation: To install fdminifuzzy, add the following line to your .vimrc file using the Plug plugin manager:

    Plug 'sevehub/fdminifuzzy'

Fd Binary: Fd is an external utility that efficiently searches for files and directories. It's essential to have the fd binary installed and available in your system's PATH.

Preset Keyboard Shortcuts: fdminifuzzy provides the following preset keyboard shortcuts (mapped to the leader key):

<leader>ff

Search for files in the current working directory.

<leader>fb

List open buffers.

<leader>fm

Display the most recently used files.

<leader>fl

Search for lines within the current buffer.

These keybindings allow you to quickly navigate and locate files, buffers, and specific lines within your Vim environment.