Git Product home page Git Product logo

denote-fzf-lua's Introduction

denote-fzf-lua

Archive Note: This repo has been moved to https://codeberg.org/Historia/denote-fzf-lua.

Neovim plugin that uses fzf-lua to search a directory of notes formatted with the Emacs Denote package's file-naming scheme:

DATE==SIGNATURE--TITLE__KEYWORDS.EXTENSION

The nice custom table for Denote files is the only unique feature of this plugin. If you don't care about that you should just configure fzf-lua alone however you like it.

Installation / Config

Example config via lazy.nvim

{
  "DefaultGen/denote-fzf-lua",
  opts = {
    dir = "~/notes" -- Denote notes directory

    -- Toggle which Denote fields are displayed in search
    search_fields = {
      path      = false,
      date      = true,
      time      = false,
      sig       = false,
      title     = true,
      keywords  = true,
      ext       = false,
    },

    -- OPTIONAL:
    -- fzf-lua plugin options. Check fzf-lua docs for full details.
    -- Use this to set custom window and fzf options (and more)
    fzf_lua_opts = {
      winopts = {
        height = 0.85,
        width  = 0.80,
        row    = 0.35,
        col    = 0.50,
        preview = {
          layout = 'vertical',   -- vertical, horizontal, or flex
          vertical = 'down:45%', -- Alt: horizontal = 'right:50%'
        },
      },
      -- Options sent to fzf. If you don't include these, it will be
      -- set to the defaults below (which look like the screenshot)
      fzf_opts = {
        ['--reverse'] = true,
        ['--no-info'] = true,
        ['--no-separator'] = true,
        ['--no-hscroll'] = true,
        ['-i'] = true,
      },
    },
  },
},

Dependencies

  • ibhagwan/fzf-lua - Neovim plugin
  • fzf - Fuzzy finder
  • (OPTIONAL) fd - Fast find replacement
  • (OPTIONAL) sd - Fast sed replacement
  • (OPTIONAL) qsv- Fast column replacement
  • (OPTIONAL) bat - Nicer preview than cat
  • (OPTIONAL) ripgrep - Required to search note contents
Arch Linux: sudo pacman -S fzf ripgrep fd sd bat
            yay -S qsv-bin

Debian: sudo apt install fzf ripgrep fd-find sd bat
        export PATH=/usr/lib/cargo/bin/:$PATH (to add `fd` to path)
        Install qsv from Github

If the optional dependencies are missing denote-fzf-lua falls back to standard Unix tools. The Rust tools are 2-3x faster. On my PC this is a difference of 0.1s vs 0.2s for 10k notes, or 0.6s vs 1.9s for 100k notes.

qsv is used over the smaller, more ubiquitous xsv because it can table format very large inputs (e.g. 100k notes) without errors.

:DenoteSearch command

" Searches filenames in `dir` with fzf and displays results as a table
:DenoteSearch files

" Standard rg search through file contents in `dir`.
" Nothing special about this, it's just a convenient command that uses the same fzf-lua options
:DenoteSearch contents

License

GNU AGPL (fzf-lua license)

denote-fzf-lua's People

Contributors

defaultgen avatar

Stargazers

Void Droid Zoid avatar

Watchers

 avatar

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.