diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/telescope_laravel.lua | 20 | ||||
| -rw-r--r-- | lua/plugins.lua | 1 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lua/alpha/telescope_laravel.lua b/lua/alpha/telescope_laravel.lua index b1fc3c4..155aaf2 100644 --- a/lua/alpha/telescope_laravel.lua +++ b/lua/alpha/telescope_laravel.lua @@ -28,13 +28,21 @@ local mt_string_entry = { end, } +function getArtisanCommand(args) + local artCmdStr = vim.g.laravel_artisan + if artCmdStr == nil then + artCmdStr = "php artisan" + end + if type(args) ~= "table" then + return Split(artCmdStr .. ' ' .. args, " ") + end + + return {unpack(Split(artCmdStr, ' ')), unpack(args)} +end + laravel.artisan = function() - local results = utils.get_os_command_output({ - "php", - "artisan", - "--raw", - }) + local results = utils.get_os_command_output(getArtisanCommand('--raw')) pickers.new({}, { prompt_title = "Artisan commands", @@ -54,7 +62,7 @@ laravel.artisan = function() define_preview = function(self, entry) - local cmd = { "php", "artisan", entry.value, "-h" } + local cmd = getArtisanCommand({entry.value, '-h'}) putils.job_maker(cmd, self.state.bufnr, { value = entry.value, diff --git a/lua/plugins.lua b/lua/plugins.lua index fa901b0..e092603 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -112,6 +112,7 @@ return require('packer').startup(function(use) use 'Raimondi/delimitMate' use 'tpope/vim-surround' + use 'tpope/vim-dotenv' use 'tpope/vim-fugitive' use 'tpope/vim-repeat' use 'tpope/vim-obsession' |