From 4377e56e7ef29c2ee020fea9ada96643c723a86e Mon Sep 17 00:00:00 2001 From: niten94 <127052329+niten94@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:18:49 +0800 Subject: [PATCH 1/4] Add, sort options in list, default JSON in options.md --- runtime/help/options.md | 59 ++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/runtime/help/options.md b/runtime/help/options.md index 87943392e..404623917 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -201,11 +201,11 @@ Here are the available options: default value: `false` -* `incsearch`: enable incremental search in "Find" prompt (matching as you type). +* `ignorecase`: perform case-insensitive searches. default value: `true` -* `ignorecase`: perform case-insensitive searches. +* `incsearch`: enable incremental search in "Find" prompt (matching as you type). default value: `true` @@ -292,15 +292,6 @@ Here are the available options: default value: `2` -* `paste`: treat characters sent from the terminal in a single chunk as a paste - event rather than a series of manual key presses. If you are pasting using - the terminal keybinding (not `Ctrl-v`, which is micro's default paste - keybinding) then it is a good idea to enable this option during the paste - and disable once the paste is over. See `> help copypaste` for details about - copying and pasting in a terminal environment. - - default value: `false` - * `parsecursor`: if enabled, this will cause micro to parse filenames such as file.txt:10:5 as requesting to open `file.txt` with the cursor at line 10 and column 5. The column number can also be dropped to open the file at a @@ -311,6 +302,15 @@ Here are the available options: default value: `false` +* `paste`: treat characters sent from the terminal in a single chunk as a paste + event rather than a series of manual key presses. If you are pasting using + the terminal keybinding (not `Ctrl-v`, which is micro's default paste + keybinding) then it is a good idea to enable this option during the paste + and disable once the paste is over. See `> help copypaste` for details about + copying and pasting in a terminal environment. + + default value: `false` + * `permbackup`: this option causes backups (see `backup` option) to be permanently saved. With permanent backups, micro will not remove backups when files are closed and will never apply them to existing files. Use this option @@ -335,6 +335,12 @@ Here are the available options: default value: `false` +* `relativeruler`: make line numbers display relatively. If set to true, all + lines except for the line that the cursor is located will display the distance + from the cursor's line. + + default value: `false` + * `reload`: controls the reload behavior of the current buffer in case the file has changed. The available options are `prompt`, `auto` & `disabled`. @@ -352,12 +358,6 @@ Here are the available options: default value: `true` -* `relativeruler`: make line numbers display relatively. If set to true, all - lines except for the line that the cursor is located will display the distance - from the cursor's line. - - default value: `false` - * `savecursor`: remember where the cursor was last time the file was opened and put it there when you open the file again. Information is saved to `~/.config/micro/buffers/` @@ -441,14 +441,14 @@ Here are the available options: default value: `true` -* `tabmovement`: navigate spaces at the beginning of lines as if they are tabs - (e.g. move over 4 spaces at once). This option only does anything if - `tabstospaces` is on. +* `tabhighlight`: inverts the tab characters' (filename, save indicator, etc) + colors with respect to the tab bar. default value: `false` -* `tabhighlight`: inverts the tab characters' (filename, save indicator, etc) - colors with respect to the tab bar. +* `tabmovement`: navigate spaces at the beginning of lines as if they are tabs + (e.g. move over 4 spaces at once). This option only does anything if + `tabstospaces` is on. default value: `false` @@ -532,18 +532,24 @@ so that you can see what the formatting should look like. "colorscheme": "default", "comment": true, "cursorline": true, + "detectlimit": 100, "diff": true, "diffgutter": false, "divchars": "|-", "divreverse": true, "encoding": "utf-8", "eofnewline": true, + "fakecursor": false, "fastdirty": false, "fileformat": "unix", "filetype": "unknown", - "incsearch": true, "ftoptions": true, + "helpsplit": "hsplit", + "hlsearch": false, + "hltaberrors": false, + "hltrailingws": false, "ignorecase": true, + "incsearch": true, "indentchar": " ", "infobar": true, "initlua": true, @@ -556,6 +562,8 @@ so that you can see what the formatting should look like. "matchbracestyle": "underline", "mkparents": false, "mouse": true, + "multiopen": "tab", + "pageoverlap": 2, "parsecursor": false, "paste": false, "permbackup": false, @@ -565,12 +573,14 @@ so that you can see what the formatting should look like. "pluginrepos": [], "readonly": false, "relativeruler": false, + "reload": "prompt", "rmtrailingws": false, "ruler": true, "savecursor": false, "savehistory": true, "saveundo": false, "scrollbar": false, + "scrollbarchar": "|", "scrollmargin": 3, "scrollspeed": 2, "smartpaste": true, @@ -583,12 +593,13 @@ so that you can see what the formatting should look like. "statusline": true, "sucmd": "sudo", "syntax": true, - "tabmovement": false, "tabhighlight": true, + "tabmovement": false, "tabreverse": false, "tabsize": 4, "tabstospaces": false, "useprimary": true, + "wordwrap": false, "xterm": false } ``` From 9e46a385364574ecaf21676d621b3771ed57697f Mon Sep 17 00:00:00 2001 From: niten94 <127052329+niten94@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:23:44 +0800 Subject: [PATCH 2/4] Insert few parts in options.md in backticks --- runtime/help/options.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/help/options.md b/runtime/help/options.md index 404623917..3cf1ae055 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -89,7 +89,7 @@ Here are the available options: binary. The colorscheme can be selected from all the files in the - ~/.config/micro/colorschemes/ directory. Micro comes by default with + `~/.config/micro/colorschemes/` directory. Micro comes by default with three colorschemes: You can read more about micro's colorschemes in the `colors` help topic @@ -293,7 +293,7 @@ Here are the available options: default value: `2` * `parsecursor`: if enabled, this will cause micro to parse filenames such as - file.txt:10:5 as requesting to open `file.txt` with the cursor at line 10 + `file.txt:10:5` as requesting to open `file.txt` with the cursor at line 10 and column 5. The column number can also be dropped to open the file at a given line and column 0. Note that with this option enabled it is not possible to open a file such as `file.txt:10:5`, where `:10:5` is part of the filename. @@ -507,13 +507,13 @@ or disable them: recent Git commit rather than the diff since opening the file. Any option you set in the editor will be saved to the file -~/.config/micro/settings.json so, in effect, your configuration file will be +`~/.config/micro/settings.json` so, in effect, your configuration file will be created for you. If you'd like to take your configuration with you to another -machine, simply copy the settings.json to the other machine. +machine, simply copy the `settings.json` to the other machine. ## Settings.json file -The settings.json file should go in your configuration directory (by default +The `settings.json` file should go in your configuration directory (by default at `~/.config/micro`), and should contain only options which have been modified from their default setting. Here is the full list of options in json format, so that you can see what the formatting should look like. From 63091363221d16eb17cabf50d01750dc260550ed Mon Sep 17 00:00:00 2001 From: Dmytro Maluka Date: Tue, 21 Jan 2025 17:26:42 +0800 Subject: [PATCH 3/4] Adjust formatting of colorscheme option description --- runtime/help/options.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/runtime/help/options.md b/runtime/help/options.md index 3cf1ae055..443b81079 100644 --- a/runtime/help/options.md +++ b/runtime/help/options.md @@ -79,22 +79,16 @@ Here are the available options: default value: `0` -* `colorscheme`: loads the colorscheme stored in - $(configDir)/colorschemes/`option`.micro, This setting is `global only`. +* `colorscheme`: use the given colorscheme. This setting is `global only`. + The colorscheme can be either one of the colorschemes that micro comes with + by default (such as `default`, `solarized` or `solarized-tc`) which are + embedded in the micro binary, or a custom colorscheme stored in + `~/.config/micro/colorschemes/$(option).micro` where `$(option)` is the + option value. You can read more about micro's colorschemes and see the list + of default colorschemes in `> help colors`. default value: `default` - Note that the default colorschemes (default, solarized, and solarized-tc) - are not located in configDir, because they are embedded in the micro - binary. - - The colorscheme can be selected from all the files in the - `~/.config/micro/colorschemes/` directory. Micro comes by default with - three colorschemes: - - You can read more about micro's colorschemes in the `colors` help topic - (`help colors`). - * `cursorline`: highlight the line that the cursor is on in a different color (the color is defined by the colorscheme you are using). From 7aa72b6a96468daf0cbac07eff71f065e0e69c76 Mon Sep 17 00:00:00 2001 From: niten94 <127052329+niten94@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:06:35 +0800 Subject: [PATCH 4/4] Sort options in settings.go --- internal/config/settings.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/settings.go b/internal/config/settings.go index a1c01c81d..d2bef5a3f 100644 --- a/internal/config/settings.go +++ b/internal/config/settings.go @@ -69,8 +69,8 @@ var defaultCommonSettings = map[string]interface{}{ "hlsearch": false, "hltaberrors": false, "hltrailingws": false, - "incsearch": true, "ignorecase": true, + "incsearch": true, "indentchar": " ", "keepautoindent": false, "matchbrace": true, @@ -80,10 +80,10 @@ var defaultCommonSettings = map[string]interface{}{ "pageoverlap": float64(2), "permbackup": false, "readonly": false, + "relativeruler": false, "reload": "prompt", "rmtrailingws": false, "ruler": true, - "relativeruler": false, "savecursor": false, "saveundo": false, "scrollbar": false,