repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim/lua/bugabinga/fuzzy_find.lua

Raw
local puk = require 'std.puk'
local icon = require 'std.icon'
local map = require 'std.map'

puk.defer 'mini.pick' (function(pick)
  local extra = puk 'mini.extra'
  pick.setup {
    options = {
      -- Whether to show content from bottom to top
      content_from_bottom = true,

      -- Whether to cache matches (more speed and memory on repeated prompts)
      use_cache = true,
    },
    window = {
      -- String to use as caret in prompt
      prompt_caret = icon.prompt_caret .. ' ',

      -- String to use as prefix in prompt
      prompt_prefix = icon.prompt_prefix .. ' ',
    },
  }

  map.normal {
    description = 'Find files',
    command = pick.builtin.files,
    keys = '<leader>ff',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Live Grep',
    command = pick.builtin.grep_live,
    keys = '<leader>fg',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find in help',
    command = pick.builtin.help,
    keys = '<leader>fh',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find buffers',
    command = pick.builtin.buffers,
    keys = '<leader>fb',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find symbols',
    command = function() extra.pickers.lsp { scope = 'document_symbol' } end,
    keys = '<leader>fs',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find diagnostic',
    command = extra.pickers.diagnostic,
    keys = '<leader>fd',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find highlight groups',
    command = extra.pickers.hl_groups,
    keys = '<leader>fl',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find spellsuggests',
    command = extra.pickers.spellsuggest,
    keys = '<leader>fz',
    category = 'fuzzy'
  }

  map.normal {
    description = 'Find keymaps',
    command = extra.pickers.keymaps,
    keys = '<leader>fk',
    category = 'fuzzy'
  }
end)