From c442d7030deab4118be45558184a55725b0db1d2 Mon Sep 17 00:00:00 2001 From: Jake Leahy Date: Mon, 6 Dec 2021 12:45:10 +1100 Subject: [PATCH 1/7] Fix edge case when comment is at start of line (#2237) --- runtime/syntax/nim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/nim.yaml b/runtime/syntax/nim.yaml index 2bf5c719..625580ca 100644 --- a/runtime/syntax/nim.yaml +++ b/runtime/syntax/nim.yaml @@ -18,7 +18,7 @@ rules: - constant.number: "\\b0[bB][01][01_]+\\b" - constant.number: "\\b[0-9_]((\\.?)[0-9_]+)?[eE][+\\-][0-9][0-9_]+\\b" - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - - comment: "[[:space:]]*[^\\\\]#.*$" + - comment: "[[:space:]]*(?:[^\\\\]|^)#.*$" - comment: start: "\\#\\[" end: "\\]\\#" From fd20fc8837d3a0ed7760c6bd0959b18d877f5334 Mon Sep 17 00:00:00 2001 From: Juan Francisco Cantero Hurtado Date: Wed, 22 Dec 2021 05:47:31 +0100 Subject: [PATCH 2/7] Fix the syntax for Raku variables. (#2309) The current version has problems with the last argument and the brackets in this code: sub myfunction(Int $x1, Int $x2){ } Taken from: https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc --- runtime/syntax/raku.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/syntax/raku.yaml b/runtime/syntax/raku.yaml index c3d62017..919da125 100644 --- a/runtime/syntax/raku.yaml +++ b/runtime/syntax/raku.yaml @@ -1,16 +1,16 @@ filetype: raku -detect: +detect: filename: "(\\.p6$|\\.pl6$|\\.pm6$|\\.raku$|\\.rakumod$|\\.rakudoc$)" rules: - type: "\\b(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork)|get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join|keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek|seekdir|se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr|y|truncate|umask|un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\\b" - statement: "\\b(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\\b" - special: "\\b(has|is|class|role|given|when|BUILD|multi|returns|method|submethod|slurp|say|sub)\\b" - - identifier: - start: "[$@%]" - end: "( |\\\\W|-)" - rules: [] + + - identifier: "[$@%&](\\.|!|\\^)?([[:alpha:]]|_)" + - identifier: "[$@%&](\\.|!|^)?([[:alpha:]]|_)([[:alnum:]]|-|_)*([[:alnum:]]|_)" + - identifier: "[$@%&](\\?|\\*)([A-Z])([A-Z]|-)*([A-Z])" - constant.string: "\".*\"|qq\\|.*\\|" - default: "[sm]/.*/" From cc0af275c1d37fbe039ee8927c6ec3912eeabfd4 Mon Sep 17 00:00:00 2001 From: Owen Valentine Date: Sat, 25 Dec 2021 05:32:15 +0200 Subject: [PATCH 3/7] Adjust default keybinding text (#2293) Fixes #2287 --- runtime/help/keybindings.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/runtime/help/keybindings.md b/runtime/help/keybindings.md index 9e19a148..d2b1883c 100644 --- a/runtime/help/keybindings.md +++ b/runtime/help/keybindings.md @@ -14,8 +14,8 @@ at the end of this document). If `~/.config/micro/bindings.json` does not exist, you can simply create it. Micro will know what to do with it. -You can use the alt keys + arrows to move word by word. Ctrl left and right -move the cursor to the start and end of the line, and ctrl up and down move the +You can use Ctrl + arrows to move word by word (Alt + arrows for Mac). Alt + left and right +move the cursor to the start and end of the line (Ctrl + left/right for Mac), and Ctrl + up and down move the cursor the start and end of the buffer. You can hold shift with all of these movement actions to select while moving. @@ -70,7 +70,7 @@ will execute `InsertTab`. ## Binding commands -You can also bind a key to execute a command in command mode (see +You can also bind a key to execute a command in command mode (see `help commands`). Simply prepend the binding with `command:`. For example: ```json @@ -88,9 +88,9 @@ instead insert unicode characters. To fix this, do the following: Now when you press `Alt-p` the `pwd` command will be executed which will show your working directory in the infobar. -You can also bind an "editable" command with `command-edit:`. This means that +You can also bind an "editable" command with `command-edit:`. This means that micro won't immediately execute the command when you press the binding, but -instead just place the string in the infobar in command mode. For example, +instead just place the string in the infobar in command mode. For example, you could rebind `Ctrl-g` to `> help`: ```json @@ -105,13 +105,13 @@ cursor placement). ## Binding raw escape sequences -Only read this section if you are interested in binding keys that aren't on the +Only read this section if you are interested in binding keys that aren't on the list of supported keys for binding. One of the drawbacks of using a terminal-based editor is that the editor must get all of its information about key events through the terminal. The terminal sends these events in the form of escape sequences often (but not always) -starting with `0x1b`. +starting with `0x1b`. For example, if micro reads `\x1b[1;5D`, on most terminals this will mean the user pressed CtrlLeft. @@ -149,7 +149,7 @@ Coming soon! ## Unbinding keys -It is also possible to disable any of the default key bindings by use of the +It is also possible to disable any of the default key bindings by use of the `None` action in the user's `bindings.json` file. ## Bindable actions and bindable keys @@ -642,7 +642,7 @@ Note: On some old terminal emulators and on Windows machines, `Ctrl-h` should be used for backspace. Additionally, alt keys can be bound by using `Alt-key`. For example `Alt-a` or -`Alt-Up`. Micro supports an optional `-` between modifiers like `Alt` and +`Alt-Up`. Micro supports an optional `-` between modifiers like `Alt` and `Ctrl` so `Alt-a` could be rewritten as `Alta` (case matters for alt bindings). This is why in the default keybindings you can see `AltShiftLeft` instead of `Alt-ShiftLeft` (they are equivalent). From 580c32bcef304f9e42e0ae2ec1ee69acebbe4b46 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Fri, 31 Dec 2021 02:06:53 -0500 Subject: [PATCH 4/7] Fix repo.json info in plugin docs (#2313) --- runtime/help/plugins.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/help/plugins.md b/runtime/help/plugins.md index 723248eb..d959488c 100644 --- a/runtime/help/plugins.md +++ b/runtime/help/plugins.md @@ -3,9 +3,9 @@ Micro supports creating plugins with a simple Lua system. Plugins are folders containing Lua files and possibly other source files placed in `~/.config/micro/plug`. The plugin directory (within `plug`) should -contain at least one Lua file and an `info.json` file. The info file +contain at least one Lua file and a `repo.json` file. The `repo.json` file provides additional information such as the name of the plugin, the -plugin's website, dependencies, etc... Here is an example info file +plugin's website, dependencies, etc... [Here is an example `repo.json` file](https://github.com/micro-editor/updated-plugins/blob/master/go-plugin/repo.json) from the go plugin, which has the following file structure: ``` @@ -17,7 +17,7 @@ from the go plugin, which has the following file structure: ``` The `go.lua` file contains the main code for the plugin, though the -code may be distributed across multiple Lua files. The `info.json` +code may be distributed across multiple Lua files. The `repo.json` file contains information about the plugin such as the website, description, version, and any requirements. Plugins may also have additional files which can be added to micro's runtime files, From a2d83132caa137ffcaa8e557e52e744607ad0a6f Mon Sep 17 00:00:00 2001 From: Juan Francisco Cantero Hurtado Date: Fri, 31 Dec 2021 23:42:21 +0100 Subject: [PATCH 5/7] Raku syntax: Fix strings and comments (#2311) * Raku syntax: Fix strings and comments Problematic code: my @array1 = [ "'", "a", "b" ]; my @array2 = [ '"', 'a', 'b' ]; my @array3 = [ "#", "a", "b" ]; I deleted "default" because it was breaking comments with urls after of my changes. Some parts were taken from: https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc * Raku syntax: fix strings Code: sub xyz(Str is encoded('utf8')) returns int32 is native('asdf') { * } sub xyz(Str is encoded("utf8")) returns int32 is native("asdf") { * } From python3.yaml --- runtime/syntax/raku.yaml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/runtime/syntax/raku.yaml b/runtime/syntax/raku.yaml index 919da125..c0f6c910 100644 --- a/runtime/syntax/raku.yaml +++ b/runtime/syntax/raku.yaml @@ -12,14 +12,29 @@ rules: - identifier: "[$@%&](\\.|!|^)?([[:alpha:]]|_)([[:alnum:]]|-|_)*([[:alnum:]]|_)" - identifier: "[$@%&](\\?|\\*)([A-Z])([A-Z]|-)*([A-Z])" - - constant.string: "\".*\"|qq\\|.*\\|" - - default: "[sm]/.*/" + - comment: "#\ [^`|=]*" + - comment: "#[:alnum:].*" + - comment: "^#!/.*" + + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - preproc: start: "(^use| = new)" end: ";" rules: [] - - comment: "#.*" - identifier.macro: start: "< Date: Sat, 1 Jan 2022 00:51:53 +0100 Subject: [PATCH 6/7] Raku syntax: fix comments (#2318) Code: # sub xyz(Str is encoded("utf8")) returns int32 is native("asdf") { * } --- runtime/syntax/raku.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/syntax/raku.yaml b/runtime/syntax/raku.yaml index c0f6c910..3dea6ade 100644 --- a/runtime/syntax/raku.yaml +++ b/runtime/syntax/raku.yaml @@ -12,10 +12,6 @@ rules: - identifier: "[$@%&](\\.|!|^)?([[:alpha:]]|_)([[:alnum:]]|-|_)*([[:alnum:]]|_)" - identifier: "[$@%&](\\?|\\*)([A-Z])([A-Z]|-)*([A-Z])" - - comment: "#\ [^`|=]*" - - comment: "#[:alnum:].*" - - comment: "^#!/.*" - - constant.string: start: "\"" end: "\"" @@ -40,3 +36,7 @@ rules: end: "EOSQL" rules: [] + - comment: + start: "#" + end: "$" + rules: [] From 409ac5460540451dd9786eeb20b297d456b88444 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 1 Jan 2022 00:33:05 -0500 Subject: [PATCH 7/7] Add unofficial discord to readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29adb166..44fc70d6 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,8 @@ view the help files here: I also recommend reading the [tutorial](https://github.com/zyedidia/micro/tree/master/runtime/help/tutorial.md) for a brief introduction to the more powerful configuration features micro offers. +There is also an unofficial Discord, which you can join at https://discord.gg/nhWR6armnR. + ## Contributing If you find any bugs, please report them! I am also happy to accept pull requests from anyone. @@ -269,6 +271,6 @@ If you find any bugs, please report them! I am also happy to accept pull request You can use the [GitHub issue tracker](https://github.com/zyedidia/micro/issues) to report bugs, ask questions, or suggest new features. -For a more informal setting to discuss the editor, you can join the [Gitter chat](https://gitter.im/zyedidia/micro). +For a more informal setting to discuss the editor, you can join the [Gitter chat](https://gitter.im/zyedidia/micro) or the [Discord](https://discord.gg/nhWR6armnR). Sometimes I am unresponsive, and I apologize! If that happens, please ping me.