Giter Club home page Giter Club logo

fzf.el's Introduction

fzf.el MELPA

An Emacs front-end for fzf.

demo

installation

fzf.el can be installed through MELPA.

usage

fzf.el comes with some example commands to try out

  • M-x fzf
  • M-x fzf-directory
  • M-x fzf-switch-buffer
  • M-x fzf-find-file
  • M-x fzf-find-file-in-dir
  • M-x fzf-git
  • M-x fzf-git-files
  • M-x fzf-hg
  • M-x fzf-projectile
  • M-x fzf-git-grep
  • M-x fzf-recentf
  • M-x fzf-grep

But the real action is writing your own.

fzf.el exposes three functions:

  • fzf-with-entries (entries action &optional directory): run fzf, passing in an elisp list and running the function action with the user's selected results
  • fzf-with-command (command action &optional directory): run a shell command and directly pass to fzf. An optimization on top of fzf-with-entries so that the output does not have to be stored in emacs before sending to fzf anyway.

Using these functions, it's easy to define your own commands that use fzf:

(defun fzf-example ()
  (fzf-with-entries
   (list "a" "b" "c")
   'print))

Or more exciting:

(defun fzf-find-file (&optional directory)
  (interactive)
  (let ((d (fzf/resolve-directory directory)))
    (fzf
    (lambda (x)
        (let ((f (expand-file-name x d)))
        (when (file-exists-p f)
            (find-file f))))
    d)))

license

GPL3

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.