Emacs+highlight-parentheses高亮括号

EmacsWiki上关于它的介绍HighlightParentheses,下载最新版请通过作者的GitHub:https://github.com/nschum/highlight-parentheses.el

目前的最新版是1.0.2

加载文件中加入以下语句

(require ‘highlight-parentheses)

用M-x highlight-parentheses-mode来启动。

能看到光标处于括号中的任意位置,高亮最接近的括号,而且用不同颜色依次高亮外侧的n层括号。如果觉得默认的配色太接近,不易区分,也可以改色:

在highlight-parentheses.el的61行,有如下定义

(defcustom hl-paren-colors‘("firebrick1" "IndianRed1" "IndianRed3" "IndianRed4")

自定义这些颜色即可,由左到右依次是由内到外的括号的颜色。

Emacs for window: 24.2
highlight-parentheses.el : 1.0.2
时间: 2024-11-06 13:24:47

Emacs+highlight-parentheses高亮括号的相关文章

The application of the stack—Parentheses Matching(括号匹配)

The thought of the algorithm is as follows: (1) Initially set up an empty stack, sequentially read in parentheses; (2) If it is a right parentheses, or it matches the stack top element, or it is illegal; (3) If it is a left parentheses, it will be pu

【LeetCode-面试算法经典-Java实现】【020-Valid Parentheses(括号验证)】

[020-Valid Parentheses(括号验证)] [LeetCode-面试算法经典-Java实现][所有题目目录索引] 原题 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and &qu

[CareerCup] 9.6 Generate Parentheses 生成括号

9.6 Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n-pairs of parentheses.EXAMPLEInput: 3Output: ((())), (()()), (())(), ()(()), ()()() LeetCode上的原题,请参见我之前的博客Generate Parentheses 生成括号. 解法一: class Solution

[LeetCode] Generate Parentheses 生成括号

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" 在LeetCo

[LeetCode] 22. Generate Parentheses 生成括号

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" 给一个数字n,

leetCode 22.Generate Parentheses (生成括号) 解题思路和方法

Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "

UVa 673 Parentheses Balance(括号配对 栈)

题意  判断输入的括号序列是否是配对的 栈的基础应用  栈顶元素与输入的字符匹配就出栈咯  注意括号序列可以为空 STL栈 #include <bits/stdc++.h> using namespace std; int main() { int cas; char c; cin >> cas; getchar(); while(cas--) { stack<char> s; while((c = getchar()) != '\n') { if(s.empty())

[Leetcode] valid parentheses 有效括号对

Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid. The brackets must close in the correct order,"()"and"()[]{}"are all valid but"(]"and"([)]"are not. 题意:给

[LeetCode] Valid Parentheses 验证括号

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]"