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.
22 lines
608 B
Lua
22 lines
608 B
Lua
local libmodal = require 'libmodal'
|
|
|
|
-- the list of commands. Providing this will allow for autocomplete
|
|
local commandList = {'new', 'close', 'last'}
|
|
|
|
-- the function which will be called whenever the user enters a command
|
|
function FooMode()
|
|
local userInput = vim.g.fooModeInput
|
|
if userInput == 'new' then
|
|
vim.api.nvim_command 'tabnew'
|
|
elseif userInput == 'close' then
|
|
vim.api.nvim_command 'tabclose'
|
|
vim.g.fooModeExit = true
|
|
elseif userInput == 'last' then
|
|
vim.api.nvim_command 'tablast'
|
|
end
|
|
end
|
|
|
|
-- enter the prompt
|
|
vim.g.fooModeExit = false
|
|
libmodal.prompt.enter('FOO', FooMode, commandList)
|