- Introduction
- Build the dependency locally
- Download the prebuilt binary from GitHub release
- Build the Rust binary via Docker
vim-clap can work without any other extra dependencies. However, there are some unavoidable performance issues for some providers, see the details at #140, for you can never expect a Vim plugin written in pure VimL to be fast everywhere even vim9 can make the VimL faster significantly.
There are two optional dependencies for boosting the performance of vim-clap:
maple
binary.- Python dynamic module.
Now, only maple
binary is mandatory for getting a fast and quite responsive vim-clap. If you do not have the +python
support, that's no problem.
If you want to use the advanced built-in fuzzy match filter which uses the fzy algorithm implemented in python, then the python
support is required:
-
Vim:
:pyx print("Hello")
should beHello
. -
NeoVim:
# ensure you have installed pynvim $ python3 -m pip install pynvim
If you have installed Rust on your system, specifically, cargo
executable exists, you can build the extra tools for a performant and nicer vim-clap using this single command :call clap#installer#build_all()
.
If you are using macOS or Linux, building the Rust deps is very convenient, just go to the clap plugin directory and run make
.
maple
mainly serves two functions:
-
Expose the fuzzy matched indices so that the matched elements can be highlighted in vim-clap, being a tiny wrapper of external fuzzy filter fzf and fzy. Once you installed
maple
, fzy/skim binary are unneeded asmaple
does not rely the binary directly but reuses their filter algorithm internally. -
Reduce the overhead of async job of Vim/NeoVim dramastically.
To install maple
you can use the installer function and run :call clap#installer#build_maple()
, or install it manually:
cd path/to/vim-clap
# Compile the release build
cargo build --release
If you don't have +python
, you can safely skip this section, it's totally fine, vim-clap can still work very well with only maple
binary installed. This Python dynamic module is mainly for saving the async job when the data set is small.
Now PyO3(v0.11+) supports stable Rust, therefore the nightly Rust is no longer required. Simply use :call clap#installer#build_python_dynamic_module()
to install the Python dynamic module written in Rust for 10x faster fuzzy filter than the Python version. Refer to the post Make Vim Python plugin 10x faster using Rust for the whole story.
Python dynamic module needs to be compiled using Rust nightly, ensure you have installed it if you want to run the installer function successfully:
# You do not have to install Rust nightly since #471
$ rustup toolchain install nightly
You can call :call clap#installer#download_binary()
in Vim/NeoVim, or do it manually as follows.
$ bash install.sh
Run install.ps1
in the powershell.
- Download the binary from the latest release https://github.com/liuchengxu/vim-clap/releases/ according to your system.
- Rename the downloaded binary to:
- Unix:
maple
- Windows:
maple.exe
- Unix:
- Move
maple
/maple.exe
tobin
directory. Don't forget to assign execute permission tomaple
viachmod a+x bin/maple
if you are using the Unix system.
If you run into the libssl error when using the prebuilt binary from GitHub release, you can try building a static Rust binary:
$ cd path/to/vim-clap
$ docker run --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder cargo build --release
$ cp target/x86_64-unknown-linux-musl/release/maple bin/maple
# See if it really works
$ ./bin/maple version