当前位置:网站首页>How to use align regexp to align userscript meta information
How to use align regexp to align userscript meta information
2022-07-26 17:22:00 【Flying watermelon】
There is one userscript, Meta information [1] No strict alignment , Can work , But not pretty , What shall I do? ?
// ==UserScript==
// @name Github Commented Issues
// @namespace https://github.com/jiacai2050
// @description Show your commented issues on github easily.
// @match https://github.com/issues*
// @author jiacai2050
// @version 0.2.3
// @icon https://github.githubassets.com/favicons/favicon.svg
// @grant none
// ==/UserScript==align-regexp to the resuce!
C-u M-x align-regexp @[a-z]+\(\s-*\) RET 1 RET 1 RET n
Before explaining the above command , First look at his signature :
(align-regexp BEG END REGEXP &optional GROUP SPACING REPEAT)•REGEXP Regular for alignment , At least one group namely () , By modifying this group To achieve the effect of alignment
• @[a-z]+\(\s-*\) This regular representation uses @name Zero or more spaces after as modified group
• \s- Said the blank space , For specific grammar, please refer to Regexp-Backslash[2]
• GROUP Indicate which of the regular expressions group Use to make changes to achieve the alignment effect
• SPACING The number of spaces between different columns
• REPEAT Whether it works on this whole line , In this example, it doesn't matter , Because there are only two columns in the end
// ==UserScript==
// @name Github Commented Issues
// @namespace https://github.com/jiacai2050
// @description Show your commented issues on github easily.
// @match https://github.com/issues*
// @author jiacai2050
// @version 0.2.3
// @icon https://github.githubassets.com/favicons/favicon.svg
// @grant none
// ==/UserScript==Last , Encapsulate as a function
(defun my/align-userscript-metablock (start end)
(interactive "r")
(align-regexp start end
"@[a-z]+\\(\\s-*\\)" 1 1 t))practice
the quick brown fox
jumped over the lazy
dogs the quick brownC-u M-x align-regexp \(\s-*\)\s- RET 1 RET 0 RET y
the quick brown fox
jumped over the lazy
dogs the quick brownReference resources
• Aligning text[3]
• Aligning columns in Emacs[4]
• Emacs: Align Text[5]
Reference link
[1] Meta information : https://violentmonkey.github.io/api/metadata-block/[2] Regexp-Backslash: https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html[3] Aligning text: http://pragmaticemacs.com/emacs/aligning-text/[4] Aligning columns in Emacs: https://blog.lambda.cx/posts/emacs-align-columns/[5] Emacs: Align Text: http://ergoemacs.org/emacs/emacs_align_and_sort.html
边栏推荐
- Operating system migration practice: deploying MySQL database on openeuler
- Detailed explanation of openwrt's feeds.conf.default
- Heavy! Zeng Xuezhong was promoted to vice chairman and CEO of zhanrui, and Chu Qingren was appointed as co CEO!
- Data preprocessing of machine learning
- Win11怎么自动清理回收站?
- After Australia, New Zealand announced the ban on Huawei 5g! Huawei official response
- FIR filter design
- [visdrone data set] yolov7 training visdrone data set and results
- Win11系统如何一键进行重装?
- 37. [categories of overloaded operators]
猜你喜欢

How emqx 5.0 under the new architecture of mria+rlog realizes 100million mqtt connections

Speaker recruitment | AI time recruit icml/ijcai 2022 as a Chinese speaker!!!

Anaconda download and Spyder error reporting solution
![[C language classic topic exercise 2]](/img/66/8dbfefe585aa35f5791f04b376b75c.png)
[C language classic topic exercise 2]

Marxan model, reserve optimization and protection vacancy selection technology, application in invest ecosystem

Execution process of select statement in MySQL

How does win11 automatically clean the recycle bin?

Establishment of Eureka registration center Eureka server

Everything is available Cassandra: the fairy database behind Huawei tag

In May, 2022, video user insight: user use time increased, and the platform achieved initial results in cost reduction and efficiency increase
随机推荐
[daily3] vgg16 learning
Why are test / development programmers who are better paid than me? Abandoned by the times
TD database syntax
[basic course of flight control development 2] crazy shell · open source formation UAV - timer (LED flight information light and indicator light flash)
Advantages of time series database and traditional database
Win11 auto delete file setting method
My meeting of OA project (meeting seating & submission for approval)
Week 4 Recurrent Neural Networks
注意 公安部发出旅游客运交通安全预警
API analysis of Taobao / tmall shipping address list and express delivery fees
PXE高效批量网络装机
Batch normalization batch_ normalization
正则表达式
Win11自动删除文件设置方法
2022 software testing skills postman+newman+jenkins continuous integration practical tutorial
带你一分钟了解对称加密和非对称加密
MySQL foundation - basic database operation
Tcpdump命令详解
Avalanche subnets vs. polygon supernets of application chain
Xiaomi Wuhan headquarters building starts today! Lei Jun: planned according to the scale of 10000 people