Skip to content

Commit 7573de9

Browse files
committed
feat: use electric-pair-mode and puni-mode
1 parent c355eea commit 7573de9

File tree

2 files changed

+45
-59
lines changed

2 files changed

+45
-59
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ aichat*
2828
/debug-adapters
2929
/recentf.eld
3030
/tramp
31-
/org-persist
31+
/org-persist
32+
/bookmarks.eld

README.org

Lines changed: 43 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
* 目录 :TOC:
3535
- [[#安装方法][安装方法]]
36+
- [[#windows][Windows]]
37+
- [[#linux][Linux]]
38+
- [[#guix-pack][guix pack]]
3639
- [[#early-initel][early-init.el]]
3740
- [[#设置配置启动模式][设置配置启动模式]]
3841
- [[#开启-debug-on-error][开启 debug-on-error]]
@@ -46,6 +49,7 @@
4649
- [[#启动后全屏][启动后全屏]]
4750
- [[#straight-包管理][straight 包管理]]
4851
- [[#空闲时增量加载包][空闲时增量加载包]]
52+
- [[#use-package-扩展][use-package 扩展]]
4953
- [[#启动速度测试][启动速度测试]]
5054
- [[#emacs-配置][emacs 配置]]
5155
- [[#载入-custom-文件][载入 custom 文件]]
@@ -64,7 +68,7 @@
6468
- [[#关闭启动动画][关闭启动动画]]
6569
- [[#scratch-buffer-设置][scratch buffer 设置]]
6670
- [[#yes-or-no-p-改为-y-or-n-p][yes-or-no-p 改为 y-or-n-p]]
67-
- [[#关掉提示声音][关掉提示声音]]
71+
- [[#关掉提示][关掉提示]]
6872
- [[#禁止光标闪烁][禁止光标闪烁]]
6973
- [[#启动时不要显示][启动时不要显示]]
7074
- [[#tab-设置][tab 设置]]
@@ -76,8 +80,7 @@
7680
- [[#rime-智能的中文输入法][rime 智能的中文输入法]]
7781
- [[#字体和主题][字体和主题]]
7882
- [[#ligature-连字体][ligature 连字体]]
79-
- [[#awesome-tray-底部信息显示][awesome-tray 底部信息显示]]
80-
- [[#sort-tab-快速切换到其它-buffer][sort-tab 快速切换到其它 buffer]]
83+
- [[#doom-modeline][doom-modeline]]
8184
- [[#hydra-方便的快捷键设置][hydra 方便的快捷键设置]]
8285
- [[#recentf-读取最近文件][recentf 读取最近文件]]
8386
- [[#popper-更方便的弹出窗口][popper 更方便的弹出窗口]]
@@ -89,46 +92,43 @@
8992
- [[#toggle-one-window-快速切换到单窗口][toggle-one-window 快速切换到单窗口]]
9093
- [[#yasnippet-快速插入代码片段][yasnippet 快速插入代码片段]]
9194
- [[#separedit-快速编辑][separedit 快速编辑]]
92-
- [[#projectileel-工程管理][projectile.el 工程管理]]
9395
- [[#compile-增强][compile 增强]]
9496
- [[#eshell-增强][eshell 增强]]
9597
- [[#eshell-基本配置][eshell 基本配置]]
9698
- [[#eshell-历史记录设置][eshell 历史记录设置]]
9799
- [[#esh-mode-设置][esh-mode 设置]]
98100
- [[#eshell-git-prompt-提示符美化][eshell-git-prompt 提示符美化]]
99101
- [[#eshell-z-智能目录跳转][eshell-z 智能目录跳转]]
100-
- [[#fingertip-智能括号插入][fingertip 智能括号插入]]
102+
- [[#emacs-libvterm][emacs-libvterm]]
103+
- [[#智能括号插入][智能括号插入]]
104+
- [[#结构化编辑-puni][结构化编辑 puni]]
101105
- [[#color-rg-快速搜索重构][color-rg 快速搜索重构]]
106+
- [[#markdown][markdown]]
102107
- [[#lsp-bridge-代码补全][lsp-bridge 代码补全]]
108+
- [[#acm-terminal][acm-terminal]]
109+
- [[#company-补全][company 补全]]
110+
- [[#eglot-booster-加速-eglot][eglot-booster 加速 eglot]]
111+
- [[#启动代码服务][启动代码服务]]
103112
- [[#highlight-parentheses-高亮外层括号][highlight-parentheses 高亮外层括号]]
104113
- [[#evil-nerd-commenter-智能注释代码][evil-nerd-commenter 智能注释代码]]
105114
- [[#apheleia-智能格式化代码][apheleia 智能格式化代码]]
106-
- [[#wuco-拼写检查][wuco 拼写检查]]
107115
- [[#git-配置][git 配置]]
108116
- [[#magit][magit]]
109117
- [[#显示当前行的最后提交信息][显示当前行的最后提交信息]]
110118
- [[#smerge-mode-解决冲突][smerge-mode 解决冲突]]
111119
- [[#visual-regexp-可视化的正则替换][visual-regexp 可视化的正则替换]]
112120
- [[#expand-region-递增选区][expand-region 递增选区]]
113-
- [[#openwith-外部工具打开文件][openwith 外部工具打开文件]]
114121
- [[#启用-treesit][启用 treesit]]
115122
- [[#elisp-配置][elisp 配置]]
116123
- [[#c-开发配置][C++ 开发配置]]
117-
- [[#citre][citre]]
118124
- [[#cmake-ts-mode-设置][cmake-ts-mode 设置]]
119125
- [[#c-ts-mode-设置][c-ts-mode 设置]]
120126
- [[#导入-vs-环境变量][导入 VS 环境变量]]
127+
- [[#cmake-integration-配置][cmake-integration 配置]]
121128
- [[#rust-开发配置][Rust 开发配置]]
122129
- [[#python-开发配置][python 开发配置]]
123-
- [[#java-开发配置][java 开发配置]]
124-
- [[#web-开发][web 开发]]
125-
- [[#javascript][Javascript]]
126-
- [[#typescript][Typescript]]
127-
- [[#html][HTML]]
128-
- [[#css][css]]
129130
- [[#json-ts-mode][json-ts-mode]]
130131
- [[#qml-开发][qml 开发]]
131-
- [[#lua-开发][lua 开发]]
132132
- [[#plantuml-支持][plantuml 支持]]
133133
- [[#dape-调试][dape 调试]]
134134
- [[#dash-docs-查询-dash-文档][dash-docs 查询 dash 文档]]
@@ -146,9 +146,7 @@
146146
- [[#增量载入-org-包][增量载入 org 包]]
147147
- [[#知识管理及博客配置][知识管理及博客配置]]
148148
- [[#denote][denote]]
149-
- [[#org-roam][org-roam]]
150149
- [[#hugo-配置][hugo 配置]]
151-
- [[#上传博客图片到腾讯云对象存储][上传博客图片到腾讯云对象存储]]
152150
- [[#自动在中英文插入空格][自动在中英文插入空格]]
153151
- [[#org-download-下载图片][org-download 下载图片]]
154152
- [[#eaf-配置][eaf 配置]]
@@ -1366,38 +1364,23 @@ ref:https://github.com/manateelazycat/toggle-one-window
13661364

13671365
)
13681366
#+end_src
1369-
** fingertip 智能括号插入
1367+
** 智能括号插入
13701368

13711369
#+begin_src emacs-lisp
1372-
(use-package fingertip
1373-
:straight (fingertip :type git :host github :repo "manateelazycat/fingertip")
1370+
(use-package elec-pair
1371+
:config
1372+
(electric-pair-mode +1)
1373+
)
1374+
#+end_src
1375+
1376+
** 结构化编辑 puni
1377+
1378+
#+begin_src emacs-lisp
1379+
(use-package puni
1380+
:straight t
13741381
:defer t
1375-
:hook ((prog-mode toml-ts-mode) . my-enable-pair-parents)
1376-
:bind (:map fingertip-mode-map
1377-
("(" . fingertip-open-round)
1378-
("[" . fingertip-open-bracket)
1379-
("{" . fingertip-open-curly)
1380-
(")" . fingertip-close-round)
1381-
("]" . fingertip-close-bracket)
1382-
("}" . fingertip-close-curly)
1383-
("=" . fingertip-equal)
1384-
("\"" . fingertip-double-quote)
1385-
("SPC" . fingertip-space)
1386-
("RET". fingertip-newline)
1387-
("C-k" . fingertip-kill)
1388-
("M-\"" . fingertip-wrap-double-quote)
1389-
("M-[" . fingertip-wrap-bracket)
1390-
("M-{" . fingertip-wrap-curly)
1391-
("M-(" . fingertip-wrap-round)
1392-
("M-]" . fingertip-unwrap)
1393-
("M-n" . fingertip-jump-right)
1394-
("M-p" . fingertip-jump-left)
1395-
("M-RET" . fingertip-jump-out-pair-and-newline))
1396-
:init
1397-
(defun my-enable-pair-parents ()
1398-
(if (treesit-parser-list)
1399-
(fingertip-mode)
1400-
(electric-pair-mode))))
1382+
:hook ((prog-mode) . puni-mode))
1383+
14011384
#+end_src
14021385

14031386
** color-rg 快速搜索重构
@@ -1854,21 +1837,23 @@ ref:https://github.com/manateelazycat/toggle-one-window
18541837

18551838
#+begin_src elisp
18561839
(use-package c-ts-mode
1857-
:hook ((c-ts-mode c++-ts-mode) . my-enable-code-service)
1858-
:preface
1859-
(defun my-c++-ts-indent-style()
1860-
(let* ((default-style (copy-alist (alist-get 'k&r (c-ts-mode--indent-styles 'cpp))))
1861-
(custom-style '(;; Do not indent preprocessor statements.
1862-
((node-is "preproc") column-0 0)
1863-
;; Do not indent namespace children.
1864-
((n-p-gp nil nil "namespace_definition") grand-parent 0)))
1865-
;; Prepend custom rules by appending the default style to the custom style list.
1866-
(combined-style (append custom-style default-style)))
1867-
combined-style))
1840+
:hook ((c-ts-mode c++-ts-mode) . my-c-ts-mode-setup)
18681841
:custom
18691842
(c-ts-mode-indent-offset 4)
18701843
(c-basic-offset 4)
1871-
(c-ts-mode-indent-style #'my-c++-ts-indent-style)
1844+
:config
1845+
(defun my-c-ts-mode-setup ()
1846+
(treesit-simple-indent-add-rules 'cpp
1847+
'(
1848+
((n-p-gp nil nil "namespace_definition") grand-parent 0)
1849+
((node-is "}") standalone-parent 0)
1850+
((parent-is "declaration_list") parent-bol c-ts-mode-indent-offset)
1851+
)
1852+
:before
1853+
'c-ts-common-baseline-indent-rule
1854+
)
1855+
(my-enable-code-service)
1856+
)
18721857
)
18731858
#+end_src
18741859

0 commit comments

Comments
 (0)