aboutsummaryrefslogtreecommitdiffstats
path: root/after/plugin/harpoon.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-08-19 19:20:38 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-08-19 19:20:38 +0200
commita65989fad830a346782c69373c8a0f92f31c3149 (patch)
treeaff9b100171700d0d234006008db8039900a71a4 /after/plugin/harpoon.lua
parent168be4afb2ee51f8b7532a3374237b9f87b70b44 (diff)
downloadnvim-conf-a65989fad830a346782c69373c8a0f92f31c3149.tar.gz
nvim-conf-a65989fad830a346782c69373c8a0f92f31c3149.zip
add symbols for lsp
Diffstat (limited to 'after/plugin/harpoon.lua')
0 files changed, 0 insertions, 0 deletions
span> previewers = require "telescope.previewers" local conf = require("telescope.config").values local putils = require "telescope.previewers.utils" local action_state = require "telescope.actions.state" local utils = require "telescope.utils" local laravel = {} function Split(s, delimiter) local result = {}; for match in (s..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match); end return result; end local lookup_keys = { display = 1, ordinal = 1, value = 1, } local mt_string_entry = { __index = function(t, k) return rawget(t, rawget(lookup_keys, k)) end, } laravel.artisan = function() local results = utils.get_os_command_output({ "php", "artisan", "--raw", }) pickers.new({}, { prompt_title = "Artisan commands", finder = finders.new_table { results = results, entry_maker = function (line) return setmetatable({ Split(line, " ")[1], }, mt_string_entry) end }, previewer = previewers.new_buffer_previewer { title = "Help", get_buffer_by_name = function(_, entry) return entry.value end, define_preview = function(self, entry) local cmd = { "php", "artisan", entry.value, "-h" } putils.job_maker(cmd, self.state.bufnr, { value = entry.value, bufname = self.state.bufname, }) end, }, sorter = conf.file_sorter(), attach_mappings = function (_, map) map('i', '<cr>', function(prompt_bufnr) local entry = action_state.get_selected_entry() actions.close(prompt_bufnr) vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(":Artisan " .. entry.value .. " ", true, false, true), "t", true) end) return true end }):find() end return laravel