We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
helpsplit
help
1 parent ff4c5c8 commit 47b84f7Copy full SHA for 47b84f7
internal/action/actions.go
@@ -1723,7 +1723,8 @@ func (h *BufPane) ToggleHelp() bool {
1723
if h.Buf.Type == buffer.BTHelp {
1724
h.Quit()
1725
} else {
1726
- h.openHelp("help", true, false)
+ hsplit := config.GlobalSettings["helpsplit"] == "hsplit"
1727
+ h.openHelp("help", hsplit, false)
1728
}
1729
return true
1730
internal/action/command.go
@@ -450,12 +450,12 @@ func (h *BufPane) openHelp(page string, hsplit bool, forceSplit bool) error {
450
451
// HelpCmd tries to open the given help page in a horizontal split
452
func (h *BufPane) HelpCmd(args []string) {
453
454
if len(args) < 1 {
455
// Open the default help if the user just typed "> help"
456
457
458
var topics []string
- hsplit := true
459
forceSplit := false
460
const errSplit = "hsplit and vsplit are not allowed at the same time"
461
for _, arg := range args {
internal/config/settings.go
@@ -29,6 +29,7 @@ var optionValidators = map[string]optionValidator{
29
"detectlimit": validateNonNegativeValue,
30
"encoding": validateEncoding,
31
"fileformat": validateChoice,
32
+ "helpsplit": validateChoice,
33
"matchbracestyle": validateChoice,
34
"multiopen": validateChoice,
35
"reload": validateChoice,
@@ -41,6 +42,7 @@ var optionValidators = map[string]optionValidator{
41
42
var OptionChoices = map[string][]string{
43
"clipboard": {"internal", "external", "terminal"},
44
"fileformat": {"unix", "dos"},
45
+ "helpsplit": {"hsplit", "vsplit"},
46
"matchbracestyle": {"underline", "highlight"},
47
"multiopen": {"tab", "hsplit", "vsplit"},
48
"reload": {"prompt", "auto", "disabled"},
@@ -109,6 +111,7 @@ var DefaultGlobalOnlySettings = map[string]interface{}{
109
111
"divchars": "|-",
110
112
"divreverse": true,
113
"fakecursor": false,
114
+ "helpsplit": "hsplit",
115
"infobar": true,
116
"keymenu": false,
117
"mouse": true,
runtime/help/commands.md
@@ -27,9 +27,11 @@ quotes here but these are not necessary when entering the command in micro.
27
Help topics are stored as `.md` files in the `runtime/help` directory of
28
the source tree, which is embedded in the final binary.
The `flags` are optional.
- * `-hsplit`: Opens the help topic in a horizontal split (default for initial split)
+ * `-hsplit`: Opens the help topic in a horizontal split
* `-vsplit`: Opens the help topic in a vertical split
+ The default split type is defined by the global `helpsplit` option.
+
* `save ['filename']`: saves the current buffer. If the file is provided it
36
will 'save as' the filename.
37
runtime/help/options.md
@@ -172,6 +172,13 @@ Here are the available options:
172
default value: `unknown`. This will be automatically overridden depending
173
on the file you open.
174
175
+* `helpsplit`: sets the split type to be used by the `help` command.
176
+ Possible values:
177
+ * `vsplit`: open help in a vertical split pane
178
+ * `hsplit`: open help in a horizontal split pane
179
180
+ default value: `hsplit`
181
182
* `hlsearch`: highlight all instances of the searched text after a successful
183
search. This highlighting can be temporarily turned off via the
184
`UnhighlightSearch` action (triggered by the Esc key by default) or toggled
0 commit comments