presser.nvim/lua/presser/init.lua
TheOnePath 0d458544e0 Moved presser/ -> lua/presser/
Created new director lua/ and moved presser/ into the subdirectory.
This is to align with other standard developments of Neovim extensions.
2023-01-13 17:18:56 +00:00

35 lines
728 B
Lua

local builtins = require'presser.builtins'
local a = vim.api
local presser = {} -- list of functions to be exported
presser.setup = function ( opts )
local opts = opts or {}
-- @Dev: TODO - construct setup function for configs
--
--map("n", "<Leader>h", "<cmd>lua require'presser'.find_replace()<CR>") -- global replace with last buffer item
a.nvim_create_user_command(
'Presser',
function ( o )
local args = {}
for arg in string.gmatch( o.args, "%S+" ) do
table.insert( args, arg )
end
builtins[args[1]]()
end,
{
nargs = 1,
complete = function (ArgLead, CmdLine, CursorPos)
return { 'find_replace' }
end,
}
)
end
return presser