Skip to content

Latest commit

 

History

History
39 lines (35 loc) · 932 Bytes

.gp.md

File metadata and controls

39 lines (35 loc) · 932 Bytes

Use this example as a convention for helper functions:

---@param name string # name of the augroup
---@param opts table | nil # options for the augroup
---@return number # returns augroup id
_H.create_augroup = function(name, opts)
	...
end

---@param file_name string # name of the file for which to get buffer
---@return number | nil # buffer number
_H.get_buffer = function(file_name)
    ...
end

The function assignment is preferred over:

function _H.create_augroup(name, opts)
    ...
end

Module has following structure:

local _H = {}
local M = {
	_H = _H, -- helper functions
	_Name = "Gp", -- plugin name
	_handles = {}, -- handles for running processes
	_queries = {}, -- table of latest queries
	_state = {}, -- table of state variables
	agents = {}, -- table of agents
	cmd = {}, -- default command functions
	config = {}, -- config variables
	hooks = {}, -- user defined command functions
}