-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
1506 lines (1399 loc) · 79.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2020-09-04 五 09:23 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>spacemacs.d for Verilog</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="何云" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
displayAlign: "center",
displayIndent: "0em",
"HTML-CSS": { scale: 100,
linebreaks: { automatic: "false" },
webFont: "TeX"
},
SVG: {scale: 100,
linebreaks: { automatic: "false" },
font: "TeX"},
NativeMML: {scale: 100},
TeX: { equationNumbers: {autoNumber: "AMS"},
MultLineWidth: "85%",
TagSide: "right",
TagIndent: ".8em"
}
});
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
</head>
<body>
<div id="content">
<h1 class="title">spacemacs.d for Verilog</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgcb1a959">1. 系统环境</a>
<ul>
<li><a href="#orga86aaf4">1.1. windows</a></li>
<li><a href="#org60b0975">1.2. linux</a></li>
</ul>
</li>
<li><a href="#orgfaa1a3e">2. terminal 之 zsh</a></li>
<li><a href="#orge96e731">3. 编辑器之 emacs</a>
<ul>
<li><a href="#org5a1245e">3.1. 安装</a></li>
<li><a href="#org794c131">3.2. 初识</a>
<ul>
<li><a href="#org04639a6">3.2.1. 启动</a></li>
<li><a href="#orgf02de6a">3.2.2. File: 文件操作</a></li>
<li><a href="#org9eadb49">3.2.3. Buffer: 操作</a></li>
<li><a href="#orgad341b8">3.2.4. Project:</a></li>
<li><a href="#org8f9adac">3.2.5. Windows</a></li>
<li><a href="#org998213f">3.2.6. Layouts</a></li>
<li><a href="#orge4566b2">3.2.7. 编辑</a></li>
<li><a href="#org4e7941d">3.2.8. 帮助系统</a></li>
</ul>
</li>
<li><a href="#org5e0f51e">3.3. 一些函数</a></li>
<li><a href="#org32695a1">3.4. regexp 正则表达式</a></li>
</ul>
</li>
<li><a href="#org0aa8ec8">4. 中文</a>
<ul>
<li><a href="#orgc17a401">4.1. 字体</a></li>
<li><a href="#org8650c94">4.2. 输入法</a></li>
</ul>
</li>
<li><a href="#org68eaf03">5. Awesome Modes</a>
<ul>
<li><a href="#orgd782a14">5.1. Verilog-mgde</a>
<ul>
<li><a href="#orgaea7bd1">5.1.1. 配置</a></li>
<li><a href="#orgb0e1db4">5.1.2. verilog-auto</a></li>
<li><a href="#org9d5cfb0">5.1.3. 常用的一些功能</a></li>
<li><a href="#orgaeaf7aa">5.1.4. AUTOOUTPUT</a></li>
<li><a href="#orge0536fd">5.1.5. 跳转</a></li>
<li><a href="#org5da4b97">5.1.6. flycheck</a></li>
<li><a href="#org86c8c5a">5.1.7. 代码折叠</a></li>
</ul>
</li>
<li><a href="#org73604c7">5.2. Org-mode</a></li>
<li><a href="#orgbd78a38">5.3. awesome-pair</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-orgcb1a959" class="outline-2">
<h2 id="orgcb1a959"><span class="section-number-2">1</span> 系统环境</h2>
<div class="outline-text-2" id="text-1">
<p>
tips: 以下系统环境安装过程中,如果下载包比较慢,可以试试搜索一下其对应的国内源,说不一定可以加速
</p>
</div>
<div id="outline-container-orga86aaf4" class="outline-3">
<h3 id="orga86aaf4"><span class="section-number-3">1.1</span> windows</h3>
<div class="outline-text-3" id="text-1-1">
<ul class="org-ul">
<li>cygwin</li>
<li>mysys2</li>
<li>wsl: 这货要求系统是win10</li>
</ul>
</div>
</div>
<div id="outline-container-org60b0975" class="outline-3">
<h3 id="org60b0975"><span class="section-number-3">1.2</span> linux</h3>
<div class="outline-text-3" id="text-1-2">
<p>
既然都选择了 linux, 您随意就好
</p>
</div>
</div>
</div>
<div id="outline-container-orgfaa1a3e" class="outline-2">
<h2 id="orgfaa1a3e"><span class="section-number-2">2</span> terminal 之 zsh</h2>
<div class="outline-text-2" id="text-2">
<p>
一般终端下默认的 shell 为 bash, 不妨( <code>强烈推荐</code> )换一个试试,比如此处提到的 zsh 。
</p>
<ul class="org-ul">
<li>各系统环境下都有自己的安装方法,都不用搜索老大哥出马,百度都能解决,再此我就给一下源码文件地址: <a href="https://sourceforge.net/projects/zsh/files/">https://sourceforge.net/projects/zsh/files/</a></li>
<li>只安装 zsh 的话也不堪重用,接下来给它安装插件 oh-my-zh: <a href="https://ohmyz.sh/">https://ohmyz.sh/</a>
<ul class="org-ul">
<li>跟着其提示安装就好,其默认会把文件安装在 ~/.oh-my-zsh 下。对默认配置不满意的话可以更新 ~/.zshrc</li>
<li><p>
默认打开的插件只有 git, 见 ~/.zshrc 里的变量 plugins 的值,实际上我的插件设置如下
</p>
<pre class="example">
plugins=(git zsh-syntax-highlighting zsh-autosuggestions fzf z)
</pre>
<p>
其中三个插件还需要额外安装一下,工具如何使用还请看其相关文档……
</p>
<ul class="org-ul">
<li><a href="https://github.com/zsh-users/zsh-syntax-highlighting.git">https://github.com/zsh-users/zsh-syntax-highlighting.git</a></li>
<li><a href="https://github.com/zsh-users/zsh-autosuggestions">https://github.com/zsh-users/zsh-autosuggestions</a></li>
<li><a href="https://github.com/junegunn/fzf">https://github.com/junegunn/fzf</a></li>
</ul></li>
<li>上一步给出的地址涉及到了 github, 这里又牵扯到版本管理工具 <a href="https://git-scm.com">git</a>, 类似于 svn, 各系统环境下请自行查找安装方法</li>
</ul></li>
<li>不太记得前面的步骤是否会把用户登录的默认 shell 更新到 zsh, 没有的话就通过命令 chsh 自己动手改一下</li>
</ul>
</div>
</div>
<div id="outline-container-orge96e731" class="outline-2">
<h2 id="orge96e731"><span class="section-number-2">3</span> 编辑器之 emacs</h2>
<div class="outline-text-2" id="text-3">
<p>
<a href="https://github.com/syl20bnr/spacemacs">The best editor is neither Emacs nor Vim, it's Emacs <b>and</b> Vim! </a>
</p>
<p>
在寻找写 verilog 代码的解决方案时接触到 <a href="https://www.veripool.org/wiki/verilog-mode">verilog-mode</a>, 然后才是 emacs, 接着便是 <a href="https://github.com/syl20bnr/spacemacs">spacemacs</a>, 最后才形成了我的 <a href="https://gitee.com/my2817/spacemacs-d">spacemacs.d</a>
</p>
</div>
<div id="outline-container-org5a1245e" class="outline-3">
<h3 id="org5a1245e"><span class="section-number-3">3.1</span> 安装</h3>
<div class="outline-text-3" id="text-3-1">
<ul class="org-ul">
<li>emacs:<a href="https://ftp.gnu.org/gnu/emacs/emacs-26.3.tar.gz">https://ftp.gnu.org/gnu/emacs/emacs-26.3.tar.gz</a>
<ul class="org-ul">
<li>以上是源码文件,安装过程中的问题都可通过搜索解决,就不啰嗦废话</li>
<li>也可通过各系统集成的包管理器安装,只是默认安装的版本可能不一样</li>
</ul></li>
<li>spacemacs: 给 emacs 套壳子</li>
</ul>
<div class="org-src-container">
<pre class="src src-sh">git clone https://gitee.com/mirrors/spacemacs ~/.emacs.d
<span style="color: #e5786d;">cd</span> ~/.emacs.d
git checkout -b develop origin/develop; <span style="color: #99968b;">#</span><span style="color: #99968b;">默认的master分支更新较慢</span>
</pre>
</div>
<ul class="org-ul">
<li>~/spacemacs.d: 针对 verilog 和个人习惯做了一些配置</li>
</ul>
<p>
走到这一步,如果前面猴急,已经启动过 emacs, 请先将 "~/.emacs" 文件删除
</p>
<div class="org-src-container">
<pre class="src src-sh">git clone https://gitee.com/my2817/spacemacs-d ~/.spacemacs.d
</pre>
</div>
<ul class="org-ul">
<li>启动 emacs 完成所有依赖的插件安装
<ul class="org-ul">
<li>终端中输入 "emacs" 启动并开始一大堆未知插件安装……
<ul class="org-ul">
<li>输入命令后 emacs 变为绿色,说明 oh-my-zsh 的 zsh-syntax-highlighting 插件开始工作了</li>
</ul></li>
<li>过程中可能需要多次重启
<ul class="org-ul">
<li>注意观察终端,刚键入 "e" 时,其自动在后面补全了 "macs", 但光标位置不在词尾,说明 oh-my-zsh 的 zsh-autosuggestions 插件开始工作了
<ul class="org-ul">
<li>此时可以选择手动将后面的 "macs" 输全,再回车</li>
<li>或则按方向键 <code>→</code> 回车</li>
<li>本人更习惯快捷键 <code>CTRL-e 回车</code></li>
</ul></li>
</ul></li>
<li>此步骤需要联网,如果是在无网络环境上,劝退吧……</li>
<li>或者,在有网环境上先安装好,再把 "~/.emacs.d" "~/.spacemacs.d" 打包到无网络环境中……</li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-org794c131" class="outline-3">
<h3 id="org794c131"><span class="section-number-3">3.2</span> 初识</h3>
<div class="outline-text-3" id="text-3-2">
<p>
emacs 中所有的操作都对应一个定义好的 function, 为了方便,已经将部分 function 绑定到特定的按键上,如后文介绍到的快捷键;一些知道名字,不知快捷键的 function 可以通过 <code>Alt-x</code> (同时按下 ALT 和 x 两个键),然后输入对应的 function 名字进行执行。
spacemacs 中默认安装了 evil 插件,就我的使用经历,其模拟了 vi 所有的操作方式。
</p>
</div>
<div id="outline-container-org04639a6" class="outline-4">
<h4 id="org04639a6"><span class="section-number-4">3.2.1</span> 启动</h4>
<div class="outline-text-4" id="text-3-2-1">
<ul class="org-ul">
<li><code>emacs</code> :如果直接使用本命令启动,每次都会打开一个全新进程,速度较慢,且各进程间的操作是独立的</li>
<li><code>emacsclient -c -a “”</code> : <code>推荐使用本命令启动</code>
<ul class="org-ul">
<li>第一次会启动后台守护进程,较慢</li>
<li>注意:不能关闭运行本命令的终端,个人习惯将其挪到不常用的 workspace 中</li>
<li>即使关闭当前的 frame (通过 gui 右上角的关闭按钮),也不会结束该进程,再次通过本命令(不一定在第一次启动终端里)可快速连接到守护进程,状态不会丢失</li>
</ul></li>
<li>完全关闭:<code>spc q q</code>, 或者执行命令:kill-emacs</li>
</ul>
</div>
</div>
<div id="outline-container-orgf02de6a" class="outline-4">
<h4 id="orgf02de6a"><span class="section-number-4">3.2.2</span> File: 文件操作</h4>
<div class="outline-text-4" id="text-3-2-2">
<ul class="org-ul">
<li><code>spc</code>: 指代空格键,spacemacs 中将其设置为 leader key, 敲一下它,会给出一个引导菜单,每个字母对应一个操作</li>
<li><code>spc f</code>: 两个按键用空格分隔,表示按键序列,先敲一下 <code>spc</code> 后敲 <code>f</code>,文件操作相关,下面还有二级菜单,可以都看看,都是字面意思,就不详细介绍
<ul class="org-ul">
<li><code>spc f r</code>: 打开最近打开过的文件,通过访问历史,速度更快,似乎是我用的较多的操作</li>
</ul></li>
<li><code>ctrl-g</code>: 两个键中间有连字符,表示两个键同时按下;操作过程中的后悔药,中断当前操作的意思</li>
<li><code>ctrl</code>: 这个键在 emacs 里用的比较多,同样的还有 <code>alt</code> ,为了偷懒,书写时:<code>ctrl</code> <code>= ~C~; ~alt~ =</code> <code>M</code>.</li>
<li><code>spc f f</code>: 过程中,浏览文件路径时,不论当前路径有多深,键入两个 <code>/</code>, 会直接跳到文件系统的根目录,键入 <code>~</code>, 则会跳转到用户的 HOME 目录下
<ul class="org-ul">
<li><code>C-j</code>: 同向下方向键,同 <code>C-n</code></li>
<li><code>C-k</code>: 同向上方向键,同 <code>C-p</code></li>
<li><code>C-h</code>: 到上一级目录</li>
<li><code>C-l</code>: 同回车</li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-org9eadb49" class="outline-4">
<h4 id="org9eadb49"><span class="section-number-4">3.2.3</span> Buffer: 操作</h4>
<div class="outline-text-4" id="text-3-2-3">
<ul class="org-ul">
<li><code>spc b</code>: 文件打开读入内存后就不叫文件了,叫 "buffer", 相关操作集中定义在此
<ul class="org-ul">
<li><code>spc b r</code>: 还是最近打开过的文件</li>
</ul></li>
<li>在 normal 模式下移动方式和 vi/vim 一致,
<ul class="org-ul">
<li>上下左右:<code>hjkl</code>,</li>
<li>上下滚动:<code>C-e</code>, <code>C-y</code></li>
<li>居中:<code>z z</code>,</li>
<li>翻页: <code>C-f</code> <code>C-b</code></li>
</ul></li>
<li>insert 模式下:<code>spc</code> 不能作为 leader key 直接呼出引导菜单了,可以用 <code>M-m</code> 代替
<ul class="org-ul">
<li><code>Esc</code>: 返回 normal 模式</li>
<li><code>C-l</code>: 光标所在行居中</li>
<li><code>C-[</code>: 仍然返回 normal 模式</li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-orgad341b8" class="outline-4">
<h4 id="orgad341b8"><span class="section-number-4">3.2.4</span> Project:</h4>
<div class="outline-text-4" id="text-3-2-4">
<p>
依赖插件:projectile. 一切皆文本,所谓 Project, 都是人为定义,这里的说一下定义 Project 的方式。
</p>
<ul class="org-ul">
<li>插件会自动识别版本管理系统,设置其根目录为 Project 的根目录,比如 git 的标志目录为 .git, SVN 的标志目录为最顶层的 .SVN
<ul class="org-ul">
<li>个人习惯,任何项目根目录,先"git init" 初始化为 git 仓库</li>
</ul></li>
<li>手动指定,在 Project 的根目录下生成文件 ".projectile", 插件识别文件后将其所在目录设置为 Project 的根目录
<ul class="org-ul">
<li>这个文件在生成 Project 的 TAG 文件时还有用,后面再说</li>
</ul></li>
<li><code>spc p</code>: Project 相关操作集中定义,前提是当前打开的文件已经在一个 Project 内部</li>
<li><code>spc p f</code>: 打开 Project 内的文件
<ul class="org-ul">
<li>文件太多影响查找速度,如果是通过 git 识别 Project, 通过 .gitignore 文件内容忽略不需要查找的文件</li>
</ul></li>
<li><code>spc p b</code>: Project 内的 buffer 切换,限定在 Project 内部,再也不怕同时打开多个同名文件</li>
<li><code>spc p r</code>: 打开 Project 内最近打开过的文件</li>
<li><code>spc p G</code>: 根据语法,生成 Project 内所有源码文件的 TAGS 文件,放在 Project 的根目录下
<ul class="org-ul">
<li>需要外部工具 ctags 的支持,建议安装的版本是 <a href="https://github.com/universal-ctags/ctags">universal-ctags</a></li>
<li><p>
TAGS 文件太大,影响查找速度,可以在 .projectile 里增加以下内容将用不上的目录排除,如下:
</p>
<pre class="example">
-/digital/to_FPGA
-/digital/sch
-/digital/netlist
</pre></li>
<li><code>C-]</code>: 在 TAGS 中搜索光标所在位置的 symbol, 如果只有一个则直接跳转到其定义处;如果多个,则给出候选列表</li>
<li><code>C-o</code>: 反向跳转</li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-org8f9adac" class="outline-4">
<h4 id="org8f9adac"><span class="section-number-4">3.2.5</span> Windows</h4>
<div class="outline-text-4" id="text-3-2-5">
<p>
如下所示,最大那个框叫 frame, 一个 frame 可以分割为多个 window, 每个 wdinow 里可以打开一个独立的 buffer ( 也可以是相同的,按使用需求选用吧 ),
</p>
<div class="org-src-container">
<pre class="src src-artist">+------------------------+--------------------------+
| | |
| | |
| | |
| window 1 | window 2 |
| | |
| | |
| | |
+------mode line---------+--------mode line---------+
| minibuffer |
+---------------------------------------------------+
</pre>
</div>
<ul class="org-ul">
<li><code>spc w /</code> 左右分割 window</li>
<li><code>spc w -</code> 上下分割 window</li>
<li><code>spc w d</code> 关闭当前 window</li>
<li><code>spc w Num</code> 跳转到对应编号的 window, 编号在 window 左下角,</li>
<li><code>spc w w</code> 在 window 间循环跳转,只有两个 window 时习惯用这个,无脑切换</li>
</ul>
</div>
</div>
<div id="outline-container-org998213f" class="outline-4">
<h4 id="org998213f"><span class="section-number-4">3.2.6</span> Layouts</h4>
<div class="outline-text-4" id="text-3-2-6">
<p>
本意是说多窗口布局吧,, 可以保存起来,多个 layout 可以比较方便的切换,而我个人习惯是将每个 Project 保存一个 layout, 方便不同 Project 间的切换,操作流程如下:
</p>
<ul class="org-ul">
<li><code>spc l</code>:</li>
<li><code>spc l ?</code>: 查看按键绑定提示,此步随意</li>
<li><code>spc l 0</code>: 新建一个 layout, 按提示输入一个名字,按我的用法就是输入 Project 名字</li>
<li><code>spc p d</code>: 打开 Project 的根目录</li>
<li><code>spc l S</code>: 保存当前的 layout 到一个文件
<ul class="org-ul">
<li>选择前面输入的 Project 名字并回车确认</li>
<li>选择 "[>DONE<]" 并回车</li>
<li>选择保存 layout 文件的位置并输入文件名,我习惯放在 "~/.emacs.d/.cache/layouts" 目录下</li>
</ul></li>
<li><code>spc l L</code>: 打开保存好的 layout, 对于我来说是 Project</li>
</ul>
</div>
</div>
<div id="outline-container-orge4566b2" class="outline-4">
<h4 id="orge4566b2"><span class="section-number-4">3.2.7</span> 编辑</h4>
<div class="outline-text-4" id="text-3-2-7">
<ul class="org-ul">
<li><code>sp c x a</code>: align, 快捷键用于代码格式化,对齐</li>
<li><code>spc j w C</code>: 在当前可视范围内,快速跳转到任何以字符 <code>C</code> 开始的 symbol 处,如果有多处,根据提示继续输入提示的按键序列</li>
<li><code>spc j j C</code>: 同上,但不要求输入的 <code>C</code> 是 symbol 的开始字符</li>
<li>多位置编辑替换,对搜索列出的候选项进行编辑
<ul class="org-ul">
<li><code>spc s p</code> 搜索当前 Project,或者 <code>spc s d</code>搜索当前目录</li>
<li>列出候选项后 <code>C-c C-e</code>,会给出新的buffer,进入多处替换模式</li>
<li>在该buffer中对候选项进行编辑</li>
<li>编辑完成后,进入普通模式,按<code>,</code> ,根据提示
<ul class="org-ul">
<li>wgrep-abort-changes:放弃修改</li>
<li>wgrep-finish-edit:完成修改
<ul class="org-ul">
<li>wgrep-save-all-buffers:将所有修改保存到文件</li>
</ul></li>
<li><code>q</code> 退出该模式</li>
</ul></li>
</ul></li>
<li><p>
diff
</p>
<p>
参考 ediff-* 系列命令,很好用,该系列工具会出现至少包含一个名为 "<b>Ediff Control Pannel</b>" 的窗口,只有选中它时,才能使用其相关命令: <code>?</code> 查看帮助说明,再次 <code>?</code> 隐藏帮助说明, <code># #</code>:比较时忽略空白符,执行此操作后再进行一次 <code>!</code> , 就不会受空白符的影响了
ediff-current-file: 对当前文件更改前后的内容进行比较
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">比较项目</td>
<td class="org-left">说明</td>
</tr>
<tr>
<td class="org-left">ediff-regions-linewise, ediff-regions-</td>
<td class="org-left">询问两个缓冲区的名字,然后比较相应的区域。不过你只能在每一个缓冲区中选定一个区域,而不能比较一个文件缓冲区的两个区域。</td>
</tr>
<tr>
<td class="org-left">ediff-buffers</td>
<td class="org-left">询问两个缓冲区的名字,然后比较</td>
</tr>
<tr>
<td class="org-left">ediff-files</td>
<td class="org-left">询问两个文件的名字,加载之,然后比较</td>
</tr>
<tr>
<td class="org-left">ediff-windows-linewise, ediff-windows-wordwise</td>
<td class="org-left">让你选两个窗口,然后比较窗口的内容。 -linewise- 函数比 -wordwise- 函数要快,</td>
</tr>
<tr>
<td class="org-left"> </td>
<td class="org-left">但另一方面, -wordwise- 工作方式更好,尤其是小区域作业时。 -linewise- 一行一行地比较, -wordwise- 一个单词一个单词地比较</td>
</tr>
</tbody>
</table>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">快捷键</th>
<th scope="col" class="org-left">命令</th>
<th scope="col" class="org-left">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left">q</td>
<td class="org-left">ediff-quit</td>
<td class="org-left">关闭 ediff control buffer, 并退出 ediff</td>
</tr>
<tr>
<td class="org-left">Space 或 n</td>
<td class="org-left">ediff-next-difference</td>
<td class="org-left">下一个差异处</td>
</tr>
<tr>
<td class="org-left">Del 或 p</td>
<td class="org-left">ediff-previous-difference</td>
<td class="org-left">上一个差异处</td>
</tr>
<tr>
<td class="org-left">[n]j</td>
<td class="org-left">ediff-jump-to-difference</td>
<td class="org-left">有数字前缀 [n] 修饰,第n个差异处,n可为负数</td>
</tr>
<tr>
<td class="org-left">v 或 C-v</td>
<td class="org-left">ediff-scroll-vertically</td>
<td class="org-left">所有缓冲区同步向下滚动</td>
</tr>
<tr>
<td class="org-left">V 或 M-v</td>
<td class="org-left">ediff-scroll-vertically</td>
<td class="org-left">所有缓冲区同步向上滚动</td>
</tr>
<tr>
<td class="org-left"><</td>
<td class="org-left">ediff-scroll-horizontally</td>
<td class="org-left">所有缓冲区同步向左滚动</td>
</tr>
<tr>
<td class="org-left">></td>
<td class="org-left">ediff-scroll-horizontally</td>
<td class="org-left">所有缓冲区同步向右滚动</td>
</tr>
<tr>
<td class="org-left">(vertical bar)</td>
<td class="org-left">ediff-toggle-split</td>
<td class="org-left">切换缓冲区布局方式, 水平和竖直</td>
</tr>
<tr>
<td class="org-left">m</td>
<td class="org-left">ediff-toggle-wide-display</td>
<td class="org-left">在正常 frame 大小和最大化之间切换</td>
</tr>
<tr>
<td class="org-left">a</td>
<td class="org-left">ediff-copy-A-to-B</td>
<td class="org-left">把Buffer-A的内容复制到Buffer-B</td>
</tr>
<tr>
<td class="org-left">b</td>
<td class="org-left">ediff-copy-B-to-A</td>
<td class="org-left">把Buffer-B的内容复制到Buffer-A</td>
</tr>
<tr>
<td class="org-left">r a 或 r b</td>
<td class="org-left">ediff-restore-diff</td>
<td class="org-left">恢复 Buffer-A 或 Buffer-B 差异区域中的被修改的内容</td>
</tr>
<tr>
<td class="org-left">A 或 B</td>
<td class="org-left">ediff-toggle-read-only</td>
<td class="org-left">切换 Buffer-A 或 Buffer-B 的只读状态</td>
</tr>
<tr>
<td class="org-left">g a 或 g b</td>
<td class="org-left">ediff-jump-to-difference-at-point</td>
<td class="org-left">根据光标在缓冲区中的位置,设置一个离它们最近的差异区域为当前活动区域</td>
</tr>
<tr>
<td class="org-left">C-l</td>
<td class="org-left">ediff-recenter</td>
<td class="org-left">恢复先前的所有缓冲区比较的高亮差异区。</td>
</tr>
<tr>
<td class="org-left"><code>!</code></td>
<td class="org-left">ediff-update-diffs</td>
<td class="org-left">重新比较并高亮差异区域</td>
</tr>
<tr>
<td class="org-left">w a 或 w b</td>
<td class="org-left">ediff-save-buffer</td>
<td class="org-left">保存 Buffer-A 或 Buffer-B 到磁盘</td>
</tr>
<tr>
<td class="org-left">E</td>
<td class="org-left">ediff-documentation</td>
<td class="org-left">打开 Ediff 文档</td>
</tr>
<tr>
<td class="org-left">z</td>
<td class="org-left">ediff-suspend</td>
<td class="org-left">关闭 ediff control buffer, 只是挂起,可在以后恢复 ediff 状态</td>
</tr>
</tbody>
</table></li>
</ul>
</div>
</div>
<div id="outline-container-org4e7941d" class="outline-4">
<h4 id="org4e7941d"><span class="section-number-4">3.2.8</span> 帮助系统</h4>
<div class="outline-text-4" id="text-3-2-8">
<ul class="org-ul">
<li><code>C-h m</code>: 列出当前打开的所有插件,以及对应的按键绑定</li>
<li><code>C-Mouse_Right</code>: ctrl+鼠标右键呼出菜单</li>
<li>spacemacs document: ~/.emacs.d/doc/DOCUMENTATION.org</li>
<li><code>C-h f</code>: <code>spc h d f</code>, 查看 function 的说明文档</li>
<li><code>C-h v</code>: <code>spc h d v</code>, 查看 variable 的说明文档</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org5e0f51e" class="outline-3">
<h3 id="org5e0f51e"><span class="section-number-3">3.3</span> 一些函数</h3>
<div class="outline-text-3" id="text-3-3">
<ul class="org-ul">
<li>flush-lines: 删除匹配的行,空行的正则表达式为"^\s-?+$" (即使有空白符,也算空行)</li>
<li>keep-lines: 如名字,功能与上一个命令相反</li>
<li>sort-lines: 对选中的行进行排序</li>
<li>使用linux的 sort 命令进行复杂排序,比如第几个字段作为关键词进行排序</li>
<li><p>
delete-duplicate-lines:
</p>
<p>
先使用'sort-lines'对当前buffer进行排序,再使用本函数, 本函数一次只能从相邻的两行中删除一行,所以需要多次运行,或者使用以下awk命令(不需要事先排序)。原理为将要匹配的内容作为数组下标,如果该下标对应的值为 0 则打印,否则不打印。该命令中的 $0 表示行内容完全重复时,进行删除操作,相应替换为$n,则表示当第n个字段相同时,进行删除操作。
</p>
<div class="org-src-container">
<pre class="src src-awk">awk '!a<span style="color: #8c8c8c;">[</span>$0<span style="color: #8c8c8c;">]</span>++<span style="color: #8c8c8c;">{</span><span style="color: #e5786d;">print</span> $0<span style="color: #8c8c8c;">}</span>'
</pre>
</div></li>
<li>ivy-push-view:将当前的窗口即对应的buffer信息保存起来,通过 ivy-switch-view可重新恢复该视图</li>
<li>my-highlight-symbol-in-frame: 通过多个 window 打开多个不同的文件),高亮显示光标下的 symbol (在所有的文件中)</li>
</ul>
</div>
</div>
<div id="outline-container-org32695a1" class="outline-3">
<h3 id="org32695a1"><span class="section-number-3">3.4</span> regexp 正则表达式</h3>
<div class="outline-text-3" id="text-3-4">
<p>
<a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html#Regexps">regexp online doc</a>
</p>
<p>
语法见相关文档: 菜单 help-> search documentation ->,提示输入关键词,输入 "regexp"
凡事提示regexp的地方,均可使用regexp,
</p>
</div>
</div>
</div>
<div id="outline-container-org0aa8ec8" class="outline-2">
<h2 id="org0aa8ec8"><span class="section-number-2">4</span> 中文</h2>
<div class="outline-text-2" id="text-4">
</div>
<div id="outline-container-orgc17a401" class="outline-3">
<h3 id="orgc17a401"><span class="section-number-3">4.1</span> 字体</h3>
<div class="outline-text-3" id="text-4-1">
<ul class="org-ul">
<li>默认的字体配置在 "~/.spacemacs.d/init.el" 中,见变量 "dotspacemacs-default-font"</li>
<li>本配置中,为了达到 org-mode 中的表格对齐效果,使用了 <a href="https://github.com/tumashu/cnfonts">cnfonts</a> 插件,如果不需要,在文件 "~/.spacemacs.d/init.el" 中,注释掉变量 my-config-packages 内的 cnfonts 即可</li>
<li>字体安装
<ul class="org-ul">
<li><p>
下载字体文件到 "~/.fonts" 目录(仅对当前用户生效,对系统安装的话大概是 "/usr/share/fonts" 目录),并在该目录下执行以下命令:
</p>
<div class="org-src-container">
<pre class="src src-sh">mkfontscale
mkfontdir
fc-cache
</pre>
</div></li>
</ul></li>
</ul>
</div>
</div>
<div id="outline-container-org8650c94" class="outline-3">
<h3 id="org8650c94"><span class="section-number-3">4.2</span> 输入法</h3>
<div class="outline-text-3" id="text-4-2">
<p>
本配置中有两个输入方案可供使用:
</p>
<ul class="org-ul">
<li><a href="https://github.com/tumashu/pyim">pyim</a>
<ul class="org-ul">
<li>本方案不需要其他工具配合使用</li>
<li><p>
<a href="file:///home/heyun/.spacemacs.d/layers/my-config/packages.el">配置</a>文件中找到以下的代码通过使用分号注释保留自己使用的输入法即可
</p>
<div class="org-src-container">
<pre class="src src-lisp"><span style="color: #8c8c8c;">(</span>setq pyim-default-scheme 'wubi<span style="color: #8c8c8c;">)</span>
<span style="color: #8c8c8c;">(</span>setq pyim-default-scheme 'quanpin<span style="color: #8c8c8c;">)</span>
<span style="color: #8c8c8c;">(</span>setq pyim-default-scheme 'xiaohe-shuangpin<span style="color: #8c8c8c;">)</span>
</pre>
</div></li>
</ul></li>
<li><a href="https://github.com/DogLooksGood/emacs-rime.git">emacs-rime</a>
<ul class="org-ul">
<li>如文档所述,其需要外部输入工具 rime 的支持,其如何配置请自行查询</li>
<li>在目前的配置中,会把 emacs-rime 的代码下载到 "~/.emacs.d/.cache/quelpa/build/rime" 目录下,且需要手动编译(编译时还有错,安提示修改)</li>
<li><a href="file:///home/heyun/.spacemacs.d/layers/my-config/packages.el">配置</a>, 文件中需要设置 rime–module-path 变量到编译好的 librime-emacs.so 文件</li>
</ul></li>
<li><p>
在 emacs 中通过以下变量配置选择输入方案,在我的<a href="file:///home/heyun/.spacemacs.d/layers/my-config/packages.el">配置</a>中有两个地方设置了该变量,最后生效的是 emac-rime, 请根据需要选择注释其中一处
</p>
<div class="org-src-container">
<pre class="src src-lisp"><span style="color: #8c8c8c;">(</span>setq default-input-method <span style="color: #95e454;">"pyim"</span><span style="color: #8c8c8c;">)</span>
</pre>
</div></li>
</ul>
</div>
</div>
</div>
<div id="outline-container-org68eaf03" class="outline-2">
<h2 id="org68eaf03"><span class="section-number-2">5</span> Awesome Modes</h2>
<div class="outline-text-2" id="text-5">
</div>
<div id="outline-container-orgd782a14" class="outline-3">
<h3 id="orgd782a14"><span class="section-number-3">5.1</span> Verilog-mgde</h3>
<div class="outline-text-3" id="text-5-1">
<p>
一般遇到的问题、需求,别人已经帮我们解决,见<a href="https://www.veripool.org/projects/verilog-mode/wiki/Faq">Faq</a>;在 verilog 模式下通过 ctrl + 鼠标右键呼出菜单,有3个 verilog 相关的菜单可关注一下
</p>
</div>
<div id="outline-container-orgaea7bd1" class="outline-4">
<h4 id="orgaea7bd1"><span class="section-number-4">5.1.1</span> 配置</h4>
<div class="outline-text-4" id="text-5-1-1">
<p>
verilog相关插件有两个:
</p>
<ul class="org-ul">
<li><a href="https:www.veripool.org">verilog-mode</a> : 虽然emacs本身已经集成了,但不一定是最新版本(我一般是官网下载后,直接覆盖emac自带的,反正emacs都是自己安装),另外意外的从官网发现了verilator,verilog-perl,似乎都比较好玩儿</li>
<li><a href="layers/my-config/local/my-verilog/my-verilog.el">my-verilog.el</a> : 这个文件的原始版本,是从网上抄过来的,现在似乎找不到出处,如有版权问题,麻烦提醒一下,谢谢!</li>
</ul>
</div>
</div>
<div id="outline-container-orgb0e1db4" class="outline-4">
<h4 id="orgb0e1db4"><span class="section-number-4">5.1.2</span> verilog-auto</h4>
<div class="outline-text-4" id="text-5-1-2">
<p>
当执行verilog-auto时,可能出现提示 "end xxxxx properties"信息,但verilog-auto并没有执行完成,使用emacs的batch mode解决
</p>
<div class="org-src-container">
<pre class="src src-sh">emacs --batch file.v -f verilog-batch-auto
</pre>
</div>
<p>
另,在我的配置中改写了verilog-mode中的一些函数,执行以上命令可能会出错,请使用以下命令:
</p>
<div class="org-src-container">
<pre class="src src-shell">emacs --batch file.v -l path/to/projectile.el -f verilog-batch-auto <span style="color: #99968b;">#</span><span style="color: #99968b;">在spacemacs中, projectile.el位置 ~/.emacs.d/elpa路径下,请自查</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org9d5cfb0" class="outline-4">
<h4 id="org9d5cfb0"><span class="section-number-4">5.1.3</span> 常用的一些功能</h4>
<div class="outline-text-4" id="text-5-1-3">
<ul class="org-ul">
<li>verilog-header: 原定义在verilog-mode.el中,我做了一定修改,放在my-verilog.el中,哪天跳槽了记得要改(前面已经说过了怎么查该函数对应的快捷键)</li>
<li>代码补全:基于skeleton代码片断、框架补全,输入关键字,按照列表选择,可以不用方向键, <code>c-j</code> : down; <code>c-k</code> : up; <code>c-l</code> : 相当于回车
本补全方式中,有时可能需要用户输入相应的信息,此时需要从minibuffer输入,此时不能使用关键字补全功能
<ul class="org-ul">
<li><a href="img/company-module.png">company-keyword-module</a></li>
<li><a href="img/module-expand.png">keyword-expand-module</a></li>
</ul></li>
<li>yasnippet 代码片断补全,暂时没有加入到补全后端里,需要快捷键触发: <code>M-m i s</code> ,always as eg: