Code Monkey home page Code Monkey logo

nvim-fzy's Introduction

nvim-fzy

A vim.ui.select implementation for the fzy CLI.

Installation

  • Requires Neovim (latest stable or nightly)
  • Install fzy and make sure it is in your $PATH.
  • nvim-fzy is a plugin. Install it like any other plugin:
    • If using vim-plug: Plug 'mfussenegger/nvim-fzy'
    • If using packer.nvim: use 'mfussenegger/nvim-fzy'

Usage

nvim-fzy provides the vim.ui.select implementation and a execute function to feed the output of commands to fzy.

Create some mappings like this:

lua fzy = require('fzy')
nnoremap <silent><leader>ff :lua fzy.execute('fd', fzy.sinks.edit_file)<CR>
nnoremap <silent><leader>fg :lua fzy.execute('git ls-files', fzy.sinks.edit_file)<CR>
nnoremap <silent><leader>fl :lua fzy.execute('ag --nobreak --noheading .', fzy.sinks.edit_live_grep)<CR>

See :help fzy for more information

demo

To get additional pickers to jump to tags and other stuff, you can use it in combination with nvim-qwahl

Enjoy

Customize

  • You can override the new_pop function if you want to customize the floating window.
  • You can override the command function if you want to customize the fzy shell command.

Take a look at the source to see the default implementations.

Goals

  • Have a simple API so people can create their custom actions.
  • Include the essentials, but not much more than that.

This plugin is pretty much done and won't see feature additions, unless there is a convincing case to be made.

Alternatives

nvim-fzy's People

Contributors

gpanders avatar hesseltuinhof avatar mfussenegger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nvim-fzy's Issues

Easier customization of floating window

Hey, I am wondering if it would be possible to provide some options that allow to customize the floating window. I would like to remove the border, which would require me to change the value of this line:

border = 'single',

However, this simple change requires me to override a function with 17 lines, which means I would need to copy over 16 lines which would already be included in this plugin. Wouldn't it be better to provide some options instead using a setup function?

Live grep example

Is there an easy way to configure a keybinding that allows for live grep across the working directory?

I am currently stuck with fzy.execute('ag --nobreak --noheading .', fzy.sinks.edit_file)<cr>". This gives me something like this

image

Of course, sinks.edit_file can't open the selection and we need to further parse it. How best to proceed here? Any pointers are appreciated ❤️

[Question] Resize window

Hi,
I wonder if it is possible to resize the fzy floating window, I just find it too big for my needs, and also ideally to be positioned at the bottom. Otherwise, I really like this plugin for its simplicity and snappiness.
Thanks!

Expose a function to customize the fuzzy finder command

Thanks for creating the package!

What do you think about having an option to expose the fuzzy finder command to the user to make it possible to override it?

The motivation is using fzf which supports streaming, so I don't have to wait until the command to find the items is done (fzy is causing vim to hang if I'm searching in a huge directory)

I already created a branch showing a possible solution JafarAbdi@8eb47a6

This is a comparison

fzy.command = function(opts)
  return string.format(
    'fzf --height %d --prompt "%s" --preview="" --no-multi',
    opts.height,
    vim.F.if_nil(opts.prompt, "")
  )
end
no-audio-fzf.mp4
no-audio-fzy.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.