You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim-libmodal/examples/lua/prompt-callback.lua

17 lines
424 B
Lua

local libmodal = require('libmodal')
local api = vim.api
local commandList = {'new', 'close', 'last'}
4 years ago
function fooMode()
local userInput = vim.api.nvim_get_var('fooModeInput')
if userInput == 'new' then
api.nvim_command('tabnew')
elseif userInput == 'close' then
api.nvim_command('tabclose')
elseif userInput == 'last' then
api.nvim_command('tablast')
end
end
4 years ago
libmodal.prompt.enter('FOO', fooMode, commandList)