mirror of
https://github.com/Iron-E/nvim-libmodal
synced 2024-11-18 15:25:49 +00:00
afdfadf365
BREAKING CHANGE: now requires Neovim 0.5
22 lines
551 B
Lua
22 lines
551 B
Lua
-- Imports
|
|
local libmodal = require 'libmodal'
|
|
local cmd = vim.api.nvim_command
|
|
|
|
-- 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
|
|
cmd 'tabnew'
|
|
elseif userInput == 'close' then
|
|
cmd 'tabclose'
|
|
elseif userInput == 'last' then
|
|
cmd 'tablast'
|
|
end
|
|
end
|
|
|
|
-- Enter the prompt.
|
|
libmodal.prompt.enter('FOO', FooMode, commandList)
|