6 releases

0.4.0 Dec 4, 2019
0.3.0 Nov 30, 2019
0.2.3 Nov 23, 2019

#37 in #selector

MIT license

37KB
1K SLoC

Rust 641 SLoC // 0.1% comments C 462 SLoC // 0.1% comments

Usage

chosen=$(ls | naru)
echo the user chose $chosen

To achieve this /dev/tty is used for user interaction and stdout for the result.

naru shows its results directly below the cursor position (scrolling the screen upward if necessary). This allows it to be used with editor plugins.

naru keybindings are configurable and it has a unique feature: it allows you to select multiple matches.

Configuration file

The configuration file uses the toml format, here is an example showing the defaults:

[window]
height = 0

[bindings]
c-j = "select-next"
c-k = "select-prev"

For window.height, positive numbers specify the height in lines, 0 means "full height" and the negative number -n means full_height - n.

Using with neovim-fuzzy

let g:fuzzy_executable = 'naru'

Dependencies

~0.6–1.3MB
~29K SLoC