diff options
author | Benjamin Chausse <benjamin.chausse@goto.com> | 2025-04-02 23:37:26 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin.chausse@goto.com> | 2025-04-02 23:37:26 -0400 |
commit | 5804217bdc99e58a65dcf04baf70e028731219b1 (patch) | |
tree | 0b8bdd369e118d495ae16e9120ab0bc676f368ba | |
parent | 50f826d471386abd3ee7cf442cf656a043323dd7 (diff) |
More customization options
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | lua/dropship.lua | 11 |
2 files changed, 8 insertions, 7 deletions
@@ -35,10 +35,12 @@ plugin. dependencies = "nvim-telescope/telescope.nvim", opts = { new_tab_explorer = false, -- Set to true to use `:Exp` on new tabs + -- prompt_title = "Prompt inside Telescope" -- Optional + -- prompt_icon = "> " -- Optional: good if you don't have a NerdFont drop_locations = { { name = "Projects", dir = "~/Workspace" }, { name = "Neovim Config", dir = "~/.config/nvim" }, - { name = "University", dir = "~/Documents/school/university/current_semester" }, + { name = "University", dir = "~/Documents/school/university" }, }, }, keys = { diff --git a/lua/dropship.lua b/lua/dropship.lua index 7298d45..7b5eb40 100644 --- a/lua/dropship.lua +++ b/lua/dropship.lua @@ -6,9 +6,6 @@ local conf = require("telescope.config").values local actions = require("telescope.actions") local action_state = require("telescope.actions.state") -M.drop_locations = {} -M.use_exp = false - M.setup = function(opts) opts = opts or {} if type(opts.drop_locations) == "table" then @@ -32,13 +29,15 @@ local function get_target(opts, callback) opts = opts or {} pickers .new(opts, { + prompt_title = opts.prompt_title or "Drop into which project?", + prompt_prefix = opts.prompt_icon or "ξΆ‘ ", -- Added prompt_icon option finder = finders.new_table({ - results = M.drop_locations, + results = opts.drop_locations or M.drop_locations, entry_maker = function(entry) return { value = entry, - display = entry.name .. ": " .. entry.dir, - ordinal = entry.name, + display = (entry.name or "Unknown") .. ": " .. (entry.dir or "Unknown"), + ordinal = entry.name or ".", } end, }), |