Convert Figma logo to code with AI

liuchengxu logovim-clap

:clap: Modern performant fuzzy picker, tree-sitter highlighting, and more, for both Vim and NeoVim

2,128
85
2,128
23

Top Related Projects

9,849

fzf :heart: vim

Find, Filter, Preview, Pick. All lua, all the time.

2,166

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.

Fuzzy file, buffer, mru, tag, etc finder.

⌨️ Fast file navigation for Neovim and Vim

5,812

Fuzzy Finder in rust!

Quick Overview

vim-clap is a modern generic interactive finder and dispatcher for Vim and Neovim. It provides a powerful and flexible interface for searching and selecting various items such as files, buffers, and more, with a focus on speed and extensibility.

Pros

  • Fast and efficient, utilizing async jobs and Rust backend for performance
  • Highly customizable with extensive configuration options
  • Supports both Vim and Neovim with a unified interface
  • Extensible plugin architecture allowing for custom providers

Cons

  • Requires external dependencies (Rust) for optimal performance
  • Steeper learning curve compared to some simpler alternatives
  • May have compatibility issues with certain Vim configurations or plugins
  • Documentation can be overwhelming for new users

Code Examples

  1. Basic file search:
:Clap files

This command opens the Clap interface to search for files in the current directory.

  1. Searching through open buffers:
:Clap buffers

This example shows how to use Clap to search and switch between open buffers.

  1. Grep search with preview:
:Clap grep ++query=<search_term>

This command performs a grep search for the specified term and displays results with a preview.

Getting Started

To get started with vim-clap:

  1. Install the plugin using your preferred plugin manager. For example, with vim-plug:
Plug 'liuchengxu/vim-clap'
  1. Install the Rust backend for optimal performance:
cd ~/.vim/plugged/vim-clap
cargo build --release
  1. Add basic configuration to your .vimrc or init.vim:
let g:clap_layout = { 'relative': 'editor' }
nnoremap <leader>f :Clap files<CR>
nnoremap <leader>b :Clap buffers<CR>
nnoremap <leader>g :Clap grep<CR>
  1. Restart Vim and start using Clap with the configured keybindings or by running :Clap commands.

Competitor Comparisons

9,849

fzf :heart: vim

Pros of fzf.vim

  • Lightweight and fast, built on top of the highly efficient fzf command-line fuzzy finder
  • Extensive ecosystem and community support, with numerous plugins and extensions available
  • Seamless integration with Vim's built-in features and other popular plugins

Cons of fzf.vim

  • Requires external dependencies (fzf binary) to be installed separately
  • Less visually appealing interface compared to vim-clap's modern UI
  • Limited built-in customization options for appearance and behavior

Code Comparison

vim-clap:

let g:clap_layout = { 'relative': 'editor' }
let g:clap_theme = 'material_design_dark'
let g:clap_provider_grep_delay = 50
let g:clap_provider_grep_opts = '-H --no-heading --vimgrep --smart-case'

fzf.vim:

let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
let g:fzf_colors = { 'fg':      ['fg', 'Normal'], 'bg':      ['bg', 'Normal'] }
let g:fzf_action = { 'ctrl-t': 'tab split', 'ctrl-x': 'split', 'ctrl-v': 'vsplit' }
command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case ".shellescape(<q-args>), 1, <bang>0)

Find, Filter, Preview, Pick. All lua, all the time.

Pros of Telescope

  • Built specifically for Neovim, offering deeper integration and better performance
  • Highly extensible with a rich ecosystem of plugins and extensions
  • Supports asynchronous operations, providing a smoother user experience

Cons of Telescope

  • Requires Neovim 0.5+, limiting compatibility with older Vim versions
  • Steeper learning curve due to its extensive configuration options
  • May have higher memory usage for large projects or complex setups

Code Comparison

Telescope:

require('telescope').setup{
  defaults = {
    mappings = {
      i = {
        ["<C-j>"] = "move_selection_next",
        ["<C-k>"] = "move_selection_previous",
      }
    }
  }
}

Vim-clap:

let g:clap_layout = { 'relative': 'editor' }
let g:clap_theme = 'material_design_dark'
let g:clap_provider_grep_enable_icon = 1
let g:clap_provider_grep_opts = '-H --no-heading --vimgrep --smart-case'

Both plugins offer powerful fuzzy finding capabilities, but Telescope is more tailored for Neovim users, while Vim-clap provides broader compatibility across Vim and Neovim. Telescope's extensibility and plugin ecosystem give it an edge in customization, while Vim-clap offers a simpler setup process and potentially lower resource usage.

2,166

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.

Pros of LeaderF

  • Faster performance, especially for large projects
  • More extensive built-in features and search modes
  • Better integration with other Vim plugins

Cons of LeaderF

  • Steeper learning curve due to more complex configuration options
  • Less visually appealing default interface
  • Requires Python support in Vim

Code Comparison

LeaderF configuration example:

let g:Lf_ShortcutF = '<C-P>'
let g:Lf_WindowPosition = 'popup'
let g:Lf_PreviewInPopup = 1

vim-clap configuration example:

let g:clap_layout = { 'relative': 'editor' }
let g:clap_theme = 'material_design_dark'

LeaderF and vim-clap are both fuzzy finders for Vim, offering similar core functionality. LeaderF provides more advanced features and better performance, making it suitable for larger projects and power users. However, it requires more setup and has a steeper learning curve.

vim-clap offers a more user-friendly experience out of the box, with a modern interface and easier configuration. It's a great choice for users who want a simple, visually appealing fuzzy finder without extensive customization.

Both plugins are actively maintained and have strong community support. The choice between them often comes down to personal preference, project requirements, and the level of customization desired.

Fuzzy file, buffer, mru, tag, etc finder.

Pros of ctrlp.vim

  • Lightweight and fast for small to medium-sized projects
  • Extensive customization options through Vim settings
  • Well-established with a large user base and community support

Cons of ctrlp.vim

  • Performance can degrade in large codebases
  • Limited fuzzy matching capabilities compared to more modern alternatives
  • Less visually appealing interface

Code Comparison

ctrlp.vim configuration:

let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'ra'

vim-clap configuration:

let g:clap_layout = { 'relative': 'editor' }
let g:clap_theme = 'material_design_dark'
nnoremap <C-p> :Clap files<CR>

vim-clap offers a more modern and visually appealing interface with advanced fuzzy matching capabilities. It provides better performance for large codebases and supports asynchronous search. However, ctrlp.vim remains a solid choice for users who prefer a lightweight, traditional Vim plugin with extensive customization options.

Both plugins aim to improve file navigation in Vim, but vim-clap offers more features and better performance at the cost of a slightly higher learning curve and setup complexity. The choice between the two depends on individual needs, project size, and personal preferences.

⌨️ Fast file navigation for Neovim and Vim

Pros of Command-T

  • Written in C, offering potentially faster performance for large projects
  • Mature project with a long history and established user base
  • Supports custom ranking algorithms for search results

Cons of Command-T

  • Requires Ruby and compilation of C extensions
  • Limited to file and buffer searching, less versatile than Vim-clap
  • Less active development compared to Vim-clap

Code Comparison

Command-T (Ruby):

def sorted_matches_for(str, options = {})
  @finder.sorted_matches_for str, options
end

Vim-clap (Vim script):

function! clap#filter#sync#do(query, candidates, ...) abort
  let l:opts = get(a:, 1, {})
  return s:python.function('sync_filter')(a:query, a:candidates, l:opts)
endfunction

Key Differences

  • Vim-clap is more versatile, offering multiple search providers beyond files and buffers
  • Command-T focuses on file and buffer navigation with optimized performance
  • Vim-clap has a more modern architecture, leveraging async operations and Vim's built-in popup window
  • Command-T requires additional setup due to its C extension, while Vim-clap is more plug-and-play
  • Vim-clap offers a richer UI with preview and customizable display options

Both plugins aim to improve file navigation in Vim, but Vim-clap provides a more feature-rich and flexible solution, while Command-T focuses on speed and simplicity for file and buffer searching.

5,812

Fuzzy Finder in rust!

Pros of skim

  • Written in Rust, offering better performance and memory safety
  • Can be used as a standalone CLI tool, not limited to Vim integration
  • Supports multiple selection out of the box

Cons of skim

  • Less Vim-specific features compared to vim-clap
  • Smaller community and fewer Vim-specific plugins
  • May require additional setup for seamless Vim integration

Code comparison

skim:

use skim::prelude::*;

let options = SkimOptionsBuilder::default()
    .height(Some("50%"))
    .multi(true)
    .build()
    .unwrap();

vim-clap:

let g:clap_layout = { 'relative': 'editor' }
let g:clap_enable_icon = 1
let g:clap_current_selection_sign = { 'text': '➤', 'texthl': 'ClapCurrentSelectionSign', 'linehl': 'ClapCurrentSelection' }

Summary

skim is a versatile fuzzy finder written in Rust, offering excellent performance and the ability to be used as a standalone tool. It supports multiple selection by default but may require additional setup for seamless Vim integration. vim-clap, on the other hand, is specifically designed for Vim and provides more Vim-centric features out of the box. The choice between the two depends on whether you prioritize raw performance and flexibility (skim) or a more tailored Vim experience (vim-clap).

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CI Gitter

Vim-clap stands as a comprehensive and efficient solution, providing powerful fuzzy pickers and replacements for various established Vim plugins, designed to support both Vim and NeoVim.

User facing documentation and guide

Contribution

Vim-clap is still in beta. Any kinds of contributions are highly welcome.

License

MIT