GithubHelp home page GithubHelp logo

khayo / icon-picker.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ziontee113/icon-picker.nvim

0.0 0.0 0.0 278 KB

This is a Neovim plugin that helps you pick Nerd Font Icons, Symbols & Emojis

License: MIT License

Shell 0.33% Lua 99.67%

icon-picker.nvim's Introduction

icon-picker.nvim

icon-picker.nvim is a Neovim plugin that helps you pick ๐‘จ๐•ƒ๐šป Font Characters, Symbols ฮฃ, Nerd Font Icons ๎˜ซ & Emojis โœจ

Icon.Picker.Demo.mp4
Icon.Picker.Demo.2.mp4

Pick Symbol Screenshot

Alt Font Screenshot

Installation

This plugin utilizes vim.ui.select(), so you're gonna need something like dressing.nvim and a fuzzy finder like Telescope or fzf-lua

For Lazy

{
    "ziontee113/icon-picker.nvim",
    dependencies = {
        "stevearc/dressing.nvim",
    },
    config = function()
        require("icon-picker").setup({ disable_legacy_commands = true })

        local opts = { noremap = true, silent = true }

        vim.keymap.set("n", "<Leader><Leader>i", "<cmd>IconPickerNormal<cr>", opts)
        vim.keymap.set("n", "<Leader><Leader>y", "<cmd>IconPickerYank<cr>", opts) --> Yank the selected icon into register
        vim.keymap.set("i", "<C-i>", "<cmd>IconPickerInsert<cr>", opts)
    end
}

For Packer

use "stevearc/dressing.nvim"
use({
  "ziontee113/icon-picker.nvim",
  config = function()
    require("icon-picker").setup({
      disable_legacy_commands = true
    })
  end,
})

For Vim Plug

Plug 'stevearc/dressing.nvim'
Plug 'ziontee113/icon-picker.nvim'

lua << EOF
require("icon-picker").setup({ disable_legacy_commands = true })
EOF

Usage

Sample Config (new):

local opts = { noremap = true, silent = true }

vim.keymap.set("n", "<Leader><Leader>i", "<cmd>IconPickerNormal<cr>", opts)
vim.keymap.set("n", "<Leader><Leader>y", "<cmd>IconPickerYank<cr>", opts) --> Yank the selected icon into register
vim.keymap.set("i", "<C-i>", "<cmd>IconPickerInsert<cr>", opts)

Available Commands:

  • IconPickerNormal - Pick Icon and insert it to the buffer (normal mode)
  • IconPickerInsert - Pick Icon and insert it to the buffer (insert mode)
  • IconPickerYank - Pick Icon and yank it to register (will not input to buffer)

You can cherry pick the Icon source to your preference using arguments, for example:

:IconPickerInsert alt_font symbols
:IconPickerInsert nerd_font emoji
:IconPickerInsert nerd_font
:IconPickerInsert emoji nerd_font alt_font symbols

Available arguments for the IconPicker commands:

  • alt_font
  • emoji
  • html_colors
  • nerd_font
  • nerd_font_v3 (if you're using Nerd Fonts version 3 and above)
  • symbols

I personally use <C-i> for IconPickerInsert. If you also want to map <C-I> and can't do it, you can check out my quick guide to solve that on YouTube: Enable Special Keyboard Combinations in Alacritty / Kitty for Neovim

Sample Config (legacy):

local opts = { noremap = true, silent = true }

vim.keymap.set("n", "<Leader><Leader>i", "<cmd>PickEverything<cr>", opts)
vim.keymap.set("n", "<Leader><Leader>y", "<cmd>PickEverythingYank<cr>", opts)
vim.keymap.set("i", "<C-i>", "<cmd>PickEverythingInsert<cr>", opts)

Available Commands:

  • Normal Mode:
    • PickEverything (Nerd Font Icons & Emojis & Alt Font & Symbols)
    • PickIcons (Nerd Font Icons & Emojis)
    • PickEmoji
    • PickNerd
    • PickNerdV3
    • PickSymbols
    • PickAltFont
    • PickAltFontAndSymbols
  • Normal Mode (yank): These commands will Yank the selected icon into register
    • PickEverythingYank (Nerd Font Icons & Emojis & Alt Font & Symbols)
    • PickIconsYank (Nerd Font Icons & Emojis)
    • PickEmojiYank
    • PickNerdYank
    • PickNerdV3Yank
    • PickSymbolsYank
    • PickAltFontYank
    • PickAltFontAndSymbolsYank
  • Insert Mode:
    • PickEverythingInsert (Nerd Font Icons & Emojis & Alt Font & Symbols)
    • PickIconsInsert (Nerd Font Icons & Emojis)
    • PickEmojiInsert
    • PickNerdInsert
    • PickNerdV3Insert
    • PickSymbolsInsert
    • PickAltFontInsert
    • PickAltFontAndSymbolsInsert

You can use :help to see the details for any of those commands. Example: :help PickAltFont

Todo:

Fine tune the Insert Mode experience.

Feedback

If you run into issues or come up with an awesome idea, please feel free to open an issue or PR.

Special Thanks To

@mcauley-penney for the amazing #3 ๐Ÿ”ฅ

@logan-connolly for adding Yank commands #7 ๐Ÿ‘

@KaminoU for adding HTML Color Picker #14 ๐Ÿ‘

@Snxwman for adding Nerd Fonts V3 icon list generator #21 โค๏ธ

License

The project is licensed under MIT license. See LICENSE file for details.

icon-picker.nvim's People

Contributors

ziontee113 avatar mcauley-penney avatar snxwman avatar kaminou avatar logan-connolly avatar khayo avatar chrisgrieser 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.