MobaXterm自定义关键字高亮(解决绿色不亮问题)

2023-12-28 18:12:22

作用

终端中的一些关键字高亮可以提高我们的效率,本文是解决在部分关键字没有高亮的情况下,添加自定义关键字使其高亮

教程

打开设置
在这里插入图片描述

基于已有模式进行拓展
在这里插入图片描述

在已有Session中选择自定义的规则,重启MobaXterm即可
在这里插入图片描述

解决绿色不亮问题

由于软件bug,生成的已有规则存在问题,在不修改的情况下绿色关键字都可能不亮,所以大家可以导入我修改过的规则文件
在这里插入图片描述

[CustomSyntax]
Name=Custom
UseRegex=1
Underline=[^A-Za-z_&-](http(s)?://[A-Za-z0-9_.&?=%~#{}()@+-]+:?[A-Za-z0-9_./&?=%~#{}()@+-]+)[^A-Za-z0-9_-]
Red=[^A-Za-z_&-](fail|rejected|session closed|session disconnected|does not match|does not exist|(bad|wrong|incorrect|improper|invalid|unsupported|bad)( file| memory)? (descriptor|alloc(ation)?|addr(ess)?|owner(ship)?|arg(ument)?|param(eter)?|setting|length|filename)|not properly|improperly|(operation |connection |authentication |access |permission )?(denied|disallowed|not allowed|refused|problem|failed|failure|not permitted)|no [A-Za-z]+( [A-Za-z]+)? found|invalid|unsupported|not supported|seg(mentation )?fault|corruption|corrupted|corrupt|overflow|underrun|not ok|unimplemented|unsuccessfull|not implemented|permerrors?|fehlers?|errore|errors?|erreurs?|fejl|virhe|gre歬a|erro|fel|\(ee\)|\(ni\))[^A-Za-z_-]|[^\](\$\([^(\))╙+\)|`[^ `[^`╙+`)[^╙|[=>"':.,;({\[][ ]*(false|no valid signature found|no|ko)[ ]*[]=>"':.,;)} ]| false    | no    | ko    | down    | inactive    |[^A-Za-z_&-]administratively down[^A-Za-z_&-]
(descriptor|alloc(ation)?|addr(ess)?|owner(ship)?|arg(ument)?|param(eter)?|setting|length|filename)
|not properly|improperly|(operation |connection |authentication |access |permission )?
(denied|disallowed|not allowed|refused|problem|failed|failure|not permitted)
|no [A-Za-z]+( [A-Za-z]+)? found|invalid|unsupported|not supported|seg(mentation )?fault
|corruption|corrupted|corrupt|overflow|underrun|not ok|unimplemented|unsuccessfull|not implemented
|permerrors?|fehlers?|errore|errors?|erreurs?|fejl|virhe|gre歬a|erro|fel|\(ee\)|\(ni\))
[^A-Za-z_-]|[^\](\$\([^(\))╙+\)|`[^ `[^`╙+`)[^╙|[=>"':.,;({\[][ ]*(false|no valid signature found|no|ko)[ ]*[]=>"':.,;)} ]|
false    | no    | ko    | down    | inactive    |[^A-Za-z_&-]administratively down[^A-Za-z_&-]
Green=[^A-Za-z_&-](pass|accepted|allowed|enabled|connected|successfully|成功|正确|successful|succeeded|success)[^A-Za-z_-]|[=>"':.,;({\[][ ]*(true|yes|ok)[ ]*[]=>"':.,;)} ]
[^A-Za-z_-]|[=>"':.,;({\[][ ]*(true|yes|ok)[ ]*[]=>"':.,;)} ])
Yellow=([^A-Za-z_&-](\[\-w[A-Za-z-]+\]|unassigned|shutdown|discarded|discarding|warn|caught signal [0-9]+|cannot|(connection (to (remote host|[a-z0-9.]+) )?)?(closed|terminated|stopped|not responding)|exited|no more [A-Za-z] available|unexpected|(command |binary |file )?not found|ooo?o?o?ps|out of (space|memory)|low (memory|disk)|(user )?unknown( user)?|disabled|disconnected|deprecated|refused|disconnect(ion)?|advertencia|avvertimento|attention|warnings?|achtung|exclamation|alerts?|warnungs?|advarsel|pedwarn|aviso|varoitus|upozorenje|peringatan|uyari|varning|avertissement|\(ww\)|\(\?\?\)|could not|unable to)[^A-Za-z_-])|([^\](\$[\?@\$][^╙|\$\(\([^(\))]+\)\)[^╙|\$\{[^\}]+\}[^╙|\$\[[^]]+\][^╙|\$[A-Za-z_0-9]+[^A-Za-z_0-9]))
Blue=[^\](\\(033|e)(\[(1;)?(0|30|31|32|33|34|35|36)?m|\((0|b))|\[[0-9.:,]+\]|/dev/null|\|\||\&\&)[^╙
Magenta=([^0-9A-Za-z_&-]([0-9a-f][0-9a-f](:|-)[0-9a-f][0-9a-f](:|-)[0-9a-f][0-9a-f](:|-)[0-9a-f][0-9a-f](:|-)[0-9a-f][0-9a-f](:|-)[0-9a-f][0-9a-f]|localhost|([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4])\.[0-9]+\.[0-9]+\.[0-9]+|null|none)[^0-9A-Za-z_-])|([;▅挨\$\>][ \(]*(for(each)?|while|done|if|then|else|elif|fi|case|esac|endif|exit|eval|shift|read|continue|return)[ ;)])|[^A-Za-z_&-](interface )?(Fa[0-9/]+|Gi[0-9/]+|GigabitEthernet[0-9/]+|FastEthernet[0-9/]+|vlan[0-9]+|Dot11Radio[0-9\\.]+|dot[0-9][A-Za-z0-9\\.]+|bvi[0-9]+)[^A-Za-z_&-]
Cyan=(( |\(|"|'|\[|\])-(-)?[a-zA-Z0-9_-]+( |=|,|\.|\)|"|'|\[|\]))|([^A-Za-z_&-](last (failed )?login:|launching|checking|loading|creating|building|important|booting|starting|notice|informational|informationen|informazioni|informa玢o|oplysninger|informations?|info|informaci髇|informasi|note|\(ii\)|\(\!\!\))[^A-Za-z_-])|([ ;(builtin )?(setenv|export|unset|builtin|shopt|unalias|echo|printf|alias|function|bindkey|setopt|unsetopt|user access verification|switchport|logging event|no ip address|service-policy|vlan-range|spanning-tree|access-list|description|running-config|startup-config|radius-server|class-map|policy-map|media-type|ip address)[ ;)
Blinking=
CaseSensitive=0

文章来源:https://blog.csdn.net/qq_36973838/article/details/135272600
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。