stephansama/fzf-nerdfont.nvim

website github github
icon
stars 7
issues 1
subscribers 1
forks 1
CREATED

UPDATED


fzf-nerdfont.nvim

Example GIF

A Neovim plugin that provides a handy way to search and insert Nerd Font iconsusing ibhagwan/fzf-lua while editing.


☄ Getting Started

This plugin provides a command FzfNerdFont that opens a fzf-lua window with a list of Nerd Font icons. You can search for an icon and press Enter to insert it into the current buffer.

Requirements

📋 Installation

Using lazy.nvim:

require("lazy").setup({
    spec = {
      {
        "stephansama/fzf-nerdfont.nvim",
        lazy = true,
        build = ":FzfNerdfont generate",
        dependencies = { "ibhagwan/fzf-lua" },
        cmd = "FzfNerdfont",
        keys = {
            { "<leader>fi", "<CMD>FzfNerdfont<CR>", desc= "Open fzf nerd font picker" }
        },
        ---@module 'fzf-nerdfont'
        ---@type FzfNerdFontOpts
        opts = {}
      }
    }
})

⚙ Configuration

[!NOTE] The options are also available in Neovim by running :h fzf-nerdfont.options.

---@type FzfNerdFontOpts
{
  debug = false, -- Debugging
  glyphs_dir = vim.fn.stdpath("data") .. "/fzf-nerdfont", -- The directory in which glyphs will be saved
  prompt = "Select Icon>", -- The fzf-lua prompt
}

🧰 Commands

Command Description
:FzfNerdfont Shows the Nerd Font icon list with fzf-lua.
:FzfNerdfont generate Generates the Nerd Font icon list.
:FzfNerdfont delete Deletes the generated Nerd Font icon list.
:FzfNerdfont run Shows the Nerd Font icon list with fzf-lua (same as no arguments).

FAQ

  • How do I use this plugin from within insert mode?
    local function insert_fzf_nerdfont()
      vim.cmd.stopinsert()
      vim.cmd.FzfNerdfont()
    end
    
    vim.keymap.set("i", "<C-i>", insert_fzf_nerdfont, {
      noremap = true,
      silent = true,
    })
    

⌨ Contributing

PRs and issues are always welcome. Make sure to provide as much context as possible when opening one.

Special Thanks

A very special thanks to DrKJeff16 for helping me with the initial setup of this plugin.

And a special thank you to fzf-lua.