mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 06:37:14 +09:00
Add some docs for linter, comment, status
This commit is contained in:
15
runtime/plugins/status/help/status.md
Normal file
15
runtime/plugins/status/help/status.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Status
|
||||
|
||||
The status plugin provides some functions for modifying the status line.
|
||||
|
||||
Using the `statusformatl` and `statusformatr` options, the exact contents
|
||||
of the status line can be modified. Please see the documentation for
|
||||
those options (`> help options`) for more information.
|
||||
|
||||
This plugin provides the three functions that can be used in the status
|
||||
line format:
|
||||
|
||||
* `status.branch`: returns the name of the current git branch.
|
||||
* `status.hash`: returns the hash of the current git commit.
|
||||
* `status.paste`: returns "" if the paste option is disabled and "PASTE"
|
||||
if it is enabled.
|
||||
@@ -8,6 +8,7 @@ function init()
|
||||
micro.SetStatusInfoFn("status.branch")
|
||||
micro.SetStatusInfoFn("status.hash")
|
||||
micro.SetStatusInfoFn("status.paste")
|
||||
config.AddRuntimeFile("status", config.RTHelp, "help/status.md")
|
||||
end
|
||||
|
||||
function branch(b)
|
||||
@@ -19,6 +20,7 @@ function branch(b)
|
||||
if err == nil then
|
||||
return strings.TrimSpace(branch)
|
||||
end
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,6 +33,7 @@ function hash(b)
|
||||
if err == nil then
|
||||
return strings.TrimSpace(hash)
|
||||
end
|
||||
return ""
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user