-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.html
1156 lines (1150 loc) · 36.9 KB
/
README.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">
<head>
<title>README.html</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml;charset=utf-8"/>
<link rel="stylesheet" type="text/css" media="all" href="/Users/van/.doom.d/https:/cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css" />
<link rel="stylesheet" type="text/css" media="all" href="/Users/van/.doom.d/https:/cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/github.min.css" /><meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'><style> body { box-sizing: border-box; max-width: 740px; width: 100%; margin: 40px auto; padding: 0 10px; } </style><script id='MathJax-script' async src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'></script><script src='https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js'></script><script>document.addEventListener('DOMContentLoaded', () => { document.body.classList.add('markdown-body'); document.querySelectorAll('pre[lang] > code').forEach((code) => { code.classList.add(code.parentElement.lang); }); document.querySelectorAll('pre > code').forEach((code) => { hljs.highlightBlock(code); }); });</script>
</head>
<body>
<p><img src="https://img.shields.io/badge/neo_emacs-v3.0-green.svg"
alt="img" /> <img
src="https://img.shields.io/badge/based_on-doom_emacs-red.svg?color=3152A0"
alt="img" /> <img
src="https://img.shields.io/badge/macos-full_supported-red.svg?logo=macos&color=55C2E1"
alt="img" /> <img
src="https://img.shields.io/badge/windows-almost_supported-red.svg?logo=windows&color=3498DB"
alt="img" /><br />
<img
src="https://img.shields.io/badge/eclipse-jdt_1.27.1-red.svg?logo=eclipse&color=2C2255"
alt="img" /> <img
src="https://img.shields.io/badge/supports-Emacs_27.1_to_31.0.50-red.svg?logo=gnuemacs&color=7F5AB6"
alt="img" /></p>
<figure>
<img src="./images/image-use.png" alt="img" />
<figcaption aria-hidden="true">img</figcaption>
</figure>
<p><a id="org8db91ab"></a></p>
<h1 id="about">About</h1>
<p>Neo emacs is a configuration framework for GNU Emacs which is based
on doom emacs and focuses on the java web application coding
environment. Neo emacs has the following features:</p>
<ul>
<li>Code completion: Lsp-java supports maven and gradle project.</li>
<li>Program debugging: Dap-java supports program debugging.</li>
<li>Http client: Rest-client is a tool to manually explore and test HTTP
REST webservices just like Postman.</li>
<li>Http client*: verb a package for Emacs which allows you to organize
and send HTTP requests.</li>
<li>SQL client: Ejc-sql turns Emacs into a simple SQL client which
supports various databases.</li>
<li>Redis client: <a
href="https://github.com/laixintao/iredis">IRedis</a> is a terminal
client for redis with auto-completion and syntax highlighting.</li>
<li>Terminal emulator: Emacs-libvterm (vterm) is fully-fledged terminal
emulator inside GNU Emacs based on libvterm.</li>
<li>Knowledge management system: Org-roam borrows principles from the
Zettelkasten method, providing a solution for non-hierarchical
note-taking.</li>
</ul>
<p><a id="orgceab02d"></a></p>
<h1 id="how-to-install">How to install</h1>
<p><a id="org1b28412"></a></p>
<h2 id="install-emacs">Install emacs</h2>
<blockquote>
<p>Most of the time, for safety you should install emacs by brew or
complie it from source ,that will give you a better compatibility.<br />
In other words, try not to install emacs throuht Free installation
package like Gnu Emacs below.</p>
</blockquote>
<p>There have many emacs distribution,just choose one and install
it.</p>
<ul>
<li><p><a
href="https://github.com/railwaycat/homebrew-emacsmacport">EmacsPorts</a>
is the best choice to run NeoEmcas on macos now.</p>
<pre><code>brew tap railwaycat/emacsmacport
brew install emacs-mac --with-natural-title-bar --with-mac-metal \
--with-librsvg --with-starter --with-emacs-big-sur-icon --with-native-comp \
defaults write org.gnu.Emacs TransparentTitleBar DARK \
defaults write org.gnu.Emacs HideDocumentIcon kES</code></pre></li>
<li><p><a
href="https://github.com/d12frosted/homebrew-emacs-plus">Emacs-plus</a>
which I used for a long time once.</p>
<pre><code>brew tap d12frosted/emacs-plus
brew install emacs-mac --with-natural-title-bar \
--with-mac-metal --with-librsvg --with-starter \
--with-emacs-big-sur-icon --</code></pre></li>
<li><p><a href="https://www.gnu.org/software/emacs/">Gnu-Emacs</a> is
the official emacs client which I used for windows platform.</p></li>
<li><p><a href="https://git.savannah.gnu.org/cgit/emacs.git">Source
Code</a> Building form source which I use rarely.<br />
building emacs with with source code</p>
<pre><code>1 git clone git://git.savannah.gnu.org/emacs.git
2 cd emacs
3 git checkout emacs-28
4 brew install libxml2
5 make configure
6 ./configure --with-native-compilation --with-modern-papirus-icon --with-no-titlebar
7 make -j4
8 make install
9 open nextstep/Emacs.app</code></pre></li>
</ul>
<p>After emacs installation, set environment variables which names EMACS
,this depends on your emacs exec path.</p>
<pre><code>export EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs</code></pre>
<p><a id="orgc533cfb"></a></p>
<h2 id="clone-project">Clone project</h2>
<p>clone doom-emacs and neo-emacs from github.</p>
<pre><code>git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
git clone --depth 1 https://github.com/vanniuner/neo-emacs.git ~/.doom.d/</code></pre>
<p><a id="org6740a1b"></a></p>
<h2 id="doom-install">Doom Install</h2>
<p>Set up a vpn if you need it.</p>
<pre><code>export http_proxy="ip:port"
export https_proxy="ip:port"</code></pre>
<p>Set your emacs cmd for doom install.</p>
<pre><code>export EMACS= $YOUR EMACS CMD PATH$</code></pre>
<p>Make sure there have Cmake lib or install it.</p>
<ul>
<li><p>Ubuntu</p>
<pre><code>sudo apt install cmake
sudo apt install libtool-bin</code></pre></li>
<li><p>MacOs</p>
<pre><code>brew install cmake libtool gnuplot d2 ripgrep fzf terrastruct/tap/tala graphviz</code></pre></li>
</ul>
<p>At last run below, this will take few minutes. And it depends on the
quality of your network.</p>
<pre><code>~/.emacs.doom/bin/doom install
~/.emacs.doom/bin/doom.cmd install</code></pre>
<p><a id="org3bb4edc"></a></p>
<h1 id="how-to-update">How to update</h1>
<p><a id="org6fa3227"></a></p>
<h2 id="for-brew">For brew</h2>
<pre><code>brew upgrade
brew update && brew upgrade emacs-mac && brew cleanup emacs-mac</code></pre>
<p><a id="org2ffdfe5"></a></p>
<h2 id="for-doom-project">For doom project</h2>
<pre><code>export EMACS=/Applications/Emacs.app/Contents/MacOS/EMACS
sh ~/.emacs.d/bin/doom upgrade
sh ~/.emacs.d/bin/doom install
sh ~/.emacs.d/bin/doom sync</code></pre>
<p><a id="org9857385"></a></p>
<h1 id="patches">Patches</h1>
<p><a id="orgba119ca"></a></p>
<h2 id="transparent-patch">transparent patch</h2>
<p>It offer a window transparent solution which could transparent
background but the font not.Note after install the patch, here have a
alternative package to control the transparent value.</p>
<pre><code>(use-package transwin
:config
(setq transwin-delta-alpha 5)
(setq transwin-parameter-alpha 'alpha-background)
:bind
("C-M-=" . transwin-inc)
("C-M--" . transwin-dec)
("C-M-0" . transwin-toggle))</code></pre>
<p><a id="org22115b9"></a></p>
<h2 id="cursor-animation">cursor animation</h2>
<p>The awesome patch could make cursor more funny.But there have a
bug,If you shift to full screen from a window state , there will remain
a shadow of the current cursor which will stay here forever.I will make
cursor in replace mode before shifting to full screen.This might makes
it effect less more.</p>
<p><a id="orgb4bc84c"></a></p>
<h2 id="how-to">how to</h2>
<p>Here have a <a
href="https://neoemacs.com/posts/emacs-patches/">tutorial</a> to apply
patch if you are using emacs plus.</p>
<ol type="1">
<li><p>Put the patches file under to
`/opt/homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/patches/emacs-30`</p></li>
<li><p>Modify
`/opt/homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/Formula/[email protected]`,
around <u>local_patch</u>.<br />
There only have two terms to be filled in, one is patch name which
referenced to the pathches directory, another is the pathchs `sha256`
value.</p>
<pre><code>#
# Patches
#
opoo "The option --with-no-frame-refocus is not required anymore in emacs-plus@30." if build.with? "no-frame-refocus"
local_patch "fix-window-role", sha: "1f8423ea7e6e66c9ac6dd8e37b119972daa1264de00172a24a79a710efcb8130"
local_patch "system-appearance", sha: "9eb3ce80640025bff96ebaeb5893430116368d6349f4eb0cb4ef8b3d58477db6"
local_patch "poll", sha: "31b76d6a2830fa3b6d453e3bbf5ec7259b5babf1d977b2bf88a6624fa78cb3e6" if build.with? "poll"
local_patch "round-undecorated-frame", sha: "7451f80f559840e54e6a052e55d1100778abc55f98f1d0c038a24e25773f2874"
local_patch "cursor-animation", sha: "812a934bd45dd4ee3311c1bc6681605364193bbd14ec05b9b847f9488bf989e2"
local_patch "ns-alpha-background", sha: "6c174aff2602b64255ce8952f91302ede51e213be090f1b39e06913bbe0b086b"</code></pre>
<blockquote>
<p>Notic: above sha value is out of date</p>
</blockquote></li>
<li><p>Just install emacs plus, you could use `brew reinstall`</p></li>
</ol>
<p><a id="org35e708b"></a></p>
<h1 id="private-setting">Private setting</h1>
<p>Customize your private setting config in the config.el ; use
<code>setq</code></p>
<p><a id="orgb270865"></a></p>
<h2 id="font-setting">Font setting</h2>
<p>Before start up,install fonts in the <./neoemacs/font>
directory firstly.<br />
Cause different platform have different font name,after font installed
there need a adjustment based on the fact.</p>
<ol type="1">
<li><p>setting on macos</p>
<pre><code>(setq doom-font (font-spec :family "victor Mono" :size 19 ))
(defun init-cjk-fonts()
(dolist (charset '(kana han cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil 'font)
charset (font-spec :family "HYXinRenWenSongW" :size 20))))
(add-hook 'doom-init-ui-hook 'init-cjk-fonts)</code></pre></li>
<li><p>setting on windows</p>
<pre><code>(setq doom-font (font-spec :family "victor Mono Medium" :size 24))
(defun init-cjk-fonts()
(dolist (charset '(kana han cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil 'font)
charset (font-spec :family "汉仪新人文宋W" :size 26))))
(add-hook 'doom-init-ui-hook 'init-cjk-fonts)</code></pre></li>
<li><p>install all-the-icons</p>
<p>For the icons font, we need do below</p>
<ul>
<li>M-x install-package all-the-icons</li>
<li>M-x all-the-icons-install-fonts</li>
<li>M-x nerd-icons-install-fonts</li>
</ul></li>
<li><p>font sepcify by mode</p>
<p>Use different font is a funny thing.The main idea to change font
family is use <code>after-change-major-mode-hook</code>,unfortunately
the implement do not fit doom big font.</p>
<pre><code>(defun my-set-font-for-mode ()
(cond
((derived-mode-p 'dired-mode)
(setq-local face-remapping-alist '((default (:family "M PLUS Code Latin 50" :height 180) default))))
((derived-mode-p 'vterm-mode)
(setq-local face-remapping-alist '((default (:family "Kode Mono" :height 160) default))))
))
(add-hook 'after-change-major-mode-hook #'my-set-font-for-mode)
(defun my-set-font-for-minibuffer ()
(setq-local face-remapping-alist '((default (:family "M PLUS Code Latin 50" :height 170) default)))
(redraw-frame (selected-frame)))
(add-hook 'minibuffer-setup-hook #'my-set-font-for-minibuffer)</code></pre></li>
<li><p>require fonts</p>
<p>Cause we are using multiple fonts ,here they are.</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">
<p>FONT NAME</p>
</td>
<td class="org-left">
<p>USED</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>M PLUS Code Latin 50</p>
</td>
<td class="org-left">
<p>dired mode</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>Kode Mono</p>
</td>
<td class="org-left">
<p>vterm mode</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>JetBrains Mono</p>
</td>
<td class="org-left">
<p>lsp mode</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>IBM Plex Mono</p>
</td>
<td class="org-left">
<p>mode line which key</p>
</td>
</tr>
</tbody>
</table></li>
</ol>
<p><a id="org934acc1"></a></p>
<h2 id="basic-setting">Basic setting</h2>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-bottom">
<span class="table-number">Table 1:</span> neo-emacs basic setting
</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">
variable
</td>
<td class="org-left">
default value
</td>
<td class="org-left">
config location
</td>
<td class="org-left">
description
</td>
</tr>
<tr>
<td class="org-left">
emacs-module-root
</td>
<td class="org-left">
/opt/homebrew/opt/emacs-plus@28/include
</td>
<td class="org-left">
config.el
</td>
<td class="org-left">
emcas module root
</td>
</tr>
<tr>
<td class="org-left">
display-line-numbers-type
</td>
<td class="org-left">
nil
</td>
<td class="org-left">
config.el
</td>
<td class="org-left">
show line number
</td>
</tr>
<tr>
<td class="org-left">
org-directory
</td>
<td class="org-left">
~/org/
</td>
<td class="org-left">
config.el
</td>
<td class="org-left">
org root path
</td>
</tr>
<tr>
<td class="org-left">
rg-exec-path
</td>
<td class="org-left">
system path
</td>
<td class="org-left">
-
</td>
<td class="org-left">
-
</td>
</tr>
<tr>
<td class="org-left">
fd-exec-path
</td>
<td class="org-left">
system path
</td>
<td class="org-left">
-
</td>
<td class="org-left">
-
</td>
</tr>
<tr>
<td class="org-left">
dot-exec-path
</td>
<td class="org-left">
/opt/homebrew/bin/dot
</td>
<td class="org-left">
modules/neo-emacs/org/config.el
</td>
<td class="org-left">
dot exec path
</td>
</tr>
<tr>
<td class="org-left">
pdflatex-exec-path
</td>
<td class="org-left">
/Library/TeX/texbin/pdflatex
</td>
<td class="org-left">
modules/neo-emacs/org/config.el
</td>
<td class="org-left">
pdflatex exec path
</td>
</tr>
<tr>
<td class="org-left">
org-roam-directory
</td>
<td class="org-left">
~/org/org-roam
</td>
<td class="org-left">
modules/neo-emacs/org/config.el
</td>
<td class="org-left">
org roam root path
</td>
</tr>
<tr>
<td class="org-left">
lsp-java-jdt-download-url
</td>
<td class="org-left">
<a href="http://1.117.167.195/download">http://1.117.167.195/download</a>
</td>
<td class="org-left">
modules/neo-emacs/java/config.el
</td>
<td class="org-left">
jdt-server URL
</td>
</tr>
<tr>
<td class="org-left">
lsp-java-java-path
</td>
<td class="org-left">
</td>
<td class="org-left">
modules/neo-emacs/java/config.el
</td>
<td class="org-left">
java11 exec path
</td>
</tr>
<tr>
<td class="org-left">
lsp-maven-path
</td>
<td class="org-left">
~/.m2/settings.xml
</td>
<td class="org-left">
modules/neo-emacs/java/config.el
</td>
<td class="org-left">
maven setting path
</td>
</tr>
<tr>
<td class="org-left">
rime-user-data-dir
</td>
<td class="org-left">
~/Library/Rime/
</td>
<td class="org-left">
modules/neo-emacs/rime/config.el
</td>
<td class="org-left">
rime config input
</td>
</tr>
<tr>
<td class="org-left">
rime-librime-root
</td>
<td class="org-left">
~/.doom.d/myconfig/rime-macos/dist
</td>
<td class="org-left">
modules/neo-emacs/rime/config.el
</td>
<td class="org-left">
emacs-rime/blob/master/
</td>
</tr>
</tbody>
</table>
<blockquote>
<p>recentfile save default dir: ~/.emacs.d/.local/cache/recentf</p>
</blockquote>
<p><a id="orgf990e85"></a></p>
<h1 id="neoemacs-modules">Neoemacs modules</h1>
<p><a id="org7505445"></a></p>
<h2 id="lsp-java">Lsp Java</h2>
<p><a href="./modules/neo-emacs/java/readme.md">futher more java
readme</a><br />
Neo-Emacs will automatically download the jdtls from
`lsp-java-jdt-download-url`, and now it’s located at <a
href="https://www.eclipse.org/downloads/download.php?file=/jdtls/milestones/1.22.0/jdt-language-server-1.22.0-202304131553.tar.gz">jdt-language-server-1.22.0</a>.After
that you could use all the features powered by eclipse.</p>
<ul>
<li><p>Generate eclipse files<br />
Execute mvn command for generate eclipse .project & .classpath files
on your project root path.</p>
<pre><code>mvn eclipse:clean eclipse:eclipse</code></pre></li>
<li><p>Support projectlombok plugin<br />
There have a default lombok.jar in <code>doom-user-dir/neoemacs</code>
which you could replace by yourself.</p>
<pre><code>(setq lombok-jar-path (expand-file-name (concat doom-user-dir "neoemacs/lombok.jar")</code></pre></li>
<li><p>Shotcuts/Key binding</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption class="t-bottom">
<p><span class="table-number">Table 2:</span> java mode key binding</p>
</caption>
<colgroup>
<col class="org-left" />
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">
<p>KEY</p>
</td>
<td class="org-left">
<p>FUNCTION</p>
</td>
<td class="org-left">
<p>DESCRIPTION</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c i</p>
</td>
<td class="org-left">
<p>find-implementations</p>
</td>
<td class="org-left">
<p>find where sub class definition</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c I</p>
</td>
<td class="org-left">
<p>lsp-java-open-super-implementation</p>
</td>
<td class="org-left">
<p>find where sub class definition</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC t e</p>
</td>
<td class="org-left">
<p>lsp-treemacs-java-deps-list</p>
</td>
<td class="org-left">
<p>find projects referenced libs</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c f</p>
</td>
<td class="org-left">
<p>formart buffer/region</p>
</td>
<td class="org-left">
<p>goto type definition</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c a</p>
</td>
<td class="org-left">
<p>lsp-execute-code-action</p>
</td>
<td class="org-left">
<p>code action</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c d</p>
</td>
<td class="org-left">
<p>lsp-jump-definition</p>
</td>
<td class="org-left">
<p>jump to where symbol definition</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c D</p>
</td>
<td class="org-left">
<p>lsp-jump-reference</p>
</td>
<td class="org-left">
<p>jump to where symbol referenced</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC c o</p>
</td>
<td class="org-left">
<p>lsp-java-organize-imports</p>
</td>
<td class="org-left">
<p>import require package</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC t s</p>
</td>
<td class="org-left">
<p>lsp-workspace-restart</p>
</td>
<td class="org-left">
<p>restart lsp server</p>
</td>
</tr>
</tbody>
</table></li>
<li><p>How to upgrade jdtls</p>
<ol type="1">
<li>Customization your own eclipse jdtls project version by replace it’s
binary pacage.</li>
<li>Download the lastest jdt-language-server from <a
href="https://download.eclipse.org/jdtls/milestones"
class="uri">https://download.eclipse.org/jdtls/milestones</a>.</li>
<li>Replace file to ~/.emacs.d/.local/etc/lsp/eclipse.jdt.ls.</li>
</ol></li>
</ul>
<p><a id="orgfe93b4d"></a></p>
<h2 id="vterm-shell">Vterm Shell</h2>
<p>You’d better install vterm in a terminal environment case there might
have error incompatible architecture.</p>
<div id="orgf770524" class="notice-warning">
<p>
Vterm is not available on windows.<br /> Thus windows user have to use
eshell as a downgrade plan.<br />
</p>
</div>
<ol type="1">
<li><p>Install vterm</p>
<p>You’d better install vterm in a terminal environment case there might
have error incompatible architecture.<br />
If vterm complie failed in emacs, we could complie it manually.</p>
<pre><code>cd .emacs.d/.local/straight/build/vterm/
mkdir -p build
# install cmake and libtool-bin
brew install cmake libtool
mkdir -p build
cd build
cmake ..
make</code></pre></li>
<li><p>Fish shell optimize</p>
<p>If you are using fish shell ,fortunately there have some optimize
config prepared for you.</p>
<ul>
<li><p>feature:</p>
<ul>
<li><p>use fish shell on emacs vterm.</p></li>
<li><p>use command `ff` %anyfile% on vterm will open %anyfile% in a new
emacs buffer.It’s very useful.</p>
<pre><code>if [ "$INSIDE_EMACS" = 'vterm' ]
function clear
vterm_printf "51;Evterm-clear-scrollback";
tput clear;
end
end
function vterm_cmd --description 'Run an Emacs command among the ones been defined in vterm-eval-cmds.'
set -l vterm_elisp ()
for arg in $argv
set -a vterm_elisp (printf '"%s" ' (string replace -a -r '([\\\\"])' '\\\\\\\\$1' $arg))
end
vterm_printf '51;E'(string join '' $vterm_elisp)
end
function ff
set -q argv[1]; or set argv[1] "."
vterm_cmd find-file (realpath "$argv")
end</code></pre></li>
</ul></li>
<li><p>http proxy<br />
In fact there have two different config ,first one for vterm and another
for emacs inner plugins.<br />
In vterm the http proxy be effected by `~/.config/fish/config.fish`,you
could config it like this.</p>
<pre><code>set -x http_proxy http://vpn.local.com:10887
set -x https_proxy http://vpn.local.com:10887
set -x no_proxy ".aliyun.com,192.168.0.0/16,137.239.155.184"</code></pre>
<p>When you are using emacs lisp program such as restclient, you could
config proxy like this.<br />
The difference is wildcard</p>
<pre><code>(defun convert-to-regex (str)
(let* ((joined (replace-regexp-in-string "," "\\\\|" str))
(wrapped (concat "^\\(" joined "\\)")))
wrapped))
(setq url-proxy-services `(("http" ."vpn.local.com:10887")
("https" ."vpn.local.com:10887")
("no_proxy" . ,(convert-to-regex ".*aliyun.com,192.168.0.0/16,137.239.155.184"))))</code></pre></li>
<li><p>display command’s time</p>
<pre><code>funced fish_right_prompt -i
function fish_right_prompt
echo -n (date +"%H:%M:%S ")
end
funcsave fish_right_prompt</code></pre></li>
</ul></li>
<li><p>Usage</p>
<ul>
<li><p>Being with eshell<br />
Eshell have a most wanted feature was <strong>quickrun-eshell</strong>
which have a fast reload function after shell is runinng,you just use
<code>C-c C-c</code> to stop it and use <strong>r</strong> to return you
shell script file.It’s pretty convenient.</p></li>
<li><p>Key Binding</p>
<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>
<tbody>
<tr>
<td class="org-left">
<p>KEY</p>
</td>
<td class="org-left">
<p>FUNCTION</p>
</td>
<td class="org-left">
<p>DESCRIPTION</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC v v</p>
</td>
<td class="org-left">
<p>projectile-run-vterm</p>
</td>
<td class="org-left">
<p>open vterm window base on the project root path</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC v p</p>
</td>
<td class="org-left">
<p>vterm-send-start</p>
</td>
<td class="org-left">
<p>enable vterm screen roll</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC v s</p>
</td>
<td class="org-left">
<p>vterm-send-stop</p>
</td>
<td class="org-left">
<p>disable vterm screen roll</p>
</td>
</tr>
</tbody>
</table></li>
</ul></li>
</ol>
<p><a id="org0967765"></a></p>
<h2 id="ejc-sql">Ejc Sql</h2>
<ul>
<li><p>The privacy configuration<br />
In here you could save any connections in your setting config.<br />
But where should the setting located especially for our Emacs config
project with a public github repository? There have a privacy path which
is excluded in the public repository named
<strong>user-private-dir</strong>, You could config your connection’s
account/password here for safely.<br />
There default load a db-work module which having your privacy config
.</p>
<pre><code>(add-to-list 'load-path user-private-dir )
(use-package! db-work )</code></pre></li>
<li><p>Config your particular db connection</p>
<pre><code>(use-package ejc-sql
:commands ejc-sql-mode ejc-connect
:config
(setq clomacs-httpd-default-port 18090)
(ejc-create-connection "connection-name"
:classpath "~/.m2/repository/mysql/mysql-connector-java/8.0.17/
mysql-connector-java-8.0.17.jar"
:connection-uri "jdbc:mysql://localhost/user?useSSL=false&user=root&password=pwd"
:separator "</?\.*>" )
)
(provide 'db-work)</code></pre></li>
<li><p>Write Sql file<br />
Before try to use ejc sql, firstly create a sql file which named with a
suffix <strong>.sql</strong>, cause emacs will turn on the sql minor
mode so that ejc-sql could works well. And then use <code>SPC e c</code>
to connect a particular database which you have configurated. Emacs will
popup a minibuffer listing candidates which show you the
<strong>connection-name</strong>.<br />
Secondarily, write your testing sql content which surrounded by a tag,
cause we have configurated <strong>:separator</strong> by a syntax
meaning tag in order to execute a single sql rather than to choose
it.For sure you could make any comment with the tag’s schema.<br />
Further more, you could use delimiter sign for batch execution. the
delimiter could customization by any character.<br />
Finnaly, use <code>C-c C-c</code> to execute it. It’s just execute the
content which surrounded by a tag in your cusor.</p>
<pre><code>1 <SELECT name='select all org'>
2 SELECT * FROM TABLE_ORG
3 </SELECT>
4
5 <SELECT>
6 delimiter ;
7 COMMENT ON COLUMN TABLE_ORG.PROJECT_CODE IS '项目编码';
8 COMMENT ON COLUMN TABLE_ORG.PERIOD IS '期间';
9 </SELECT></code></pre></li>
<li><p>key binding</p>
<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>
<tbody>
<tr>
<td class="org-left">
<p>KEY</p>
</td>
<td class="org-left">
<p>FUNCTION</p>
</td>
<td class="org-left">
<p>description</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>SPC e c</p>
</td>
<td class="org-left">
<p>ejc-connection</p>
</td>
<td class="org-left">
<p>choose connection with ivy</p>
</td>
</tr>
<tr>
<td class="org-left">
<p>C-c C-c</p>
</td>
<td class="org-left">
<p>ejc-execute</p>
</td>
<td class="org-left">
<p>execute the sql</p>
</td>
</tr>
</tbody>
</table></li>
</ul>
<p><a id="org29797bd"></a></p>
<h2 id="emacs-rime">Emacs Rime</h2>
<p><a href="https://github.com/DogLooksGood/emacs-rime">Emacs Rime</a>
which makes to embedding an input method be possible whthin the
emacs.Emacs could benefit form the flexible configuration of <a
href="https://rime.im/">rime</a>.<br />
On macos it’s required to install <strong>Squirrel</strong> which is one
of rime’s distribution. <strong>Squirrel</strong> is installed in your
os system as a input method.<br />
Note that the configuration of rime located at home/Library/Rime/. We
want to sharing this configuration between Eamcs rime and os rime.<br />
So there have a variable which named <code>rime-user-data-dir</code> ,
And another important variable is <code>rime-librime-root</code> which
configed the librime location.</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">
variable
</td>
<td class="org-left">
required
</td>
</tr>
<tr>
<td class="org-left">
rime-user-data-dir
</td>
<td class="org-left">
true
</td>
</tr>
<tr>
<td class="org-left">
rime-librime-root
</td>
<td class="org-left">
true
</td>
</tr>
</tbody>
</table>
<p><a href="./modules/neo-emacs/rime/readme.md">futher more rime
readme</a></p>
<p><a id="org098b95e"></a></p>
<h2 id="org-mode">Org mode</h2>
<p><a href="./modules/neo-emacs/org/readme.md">futher more org
readme</a></p>
<ol type="1">
<li><p>Install Dependency</p>
<p>There have some third party lib we need prepare.</p>
<ol type="1">
<li><p>d2 diagram</p>
<p><a
href="https://github.com/terrastruct/d2/blob/master/docs/INSTALL.md">d2
installation</a></p>
<pre><code>alias ds2 "/opt/homebrew/bin//d2 --sketch --animate-interval=1400 -l elk -c --pad 0"
alias d2 "/opt/homebrew/bin//d2 --pad 0 --layout tala "</code></pre></li>
</ol></li>
<li><p>Image to base64</p>
<p>No need to sent images files of the source.<br />
The embedded base64 image make to distribute your html documentation
more easily.</p></li>
<li><p>Optimize Line Number</p>
<p>Just hidden the colon after line number character.<br />
Modify `~/.emacs.d/.local/straight/repos/org/lisp/ox-html.el`.</p>
<pre><code>1 (let* ((code-lines (split-string code "\n"))
2 (code-length (length code-lines))
3 (num-fmt
4 (and num-start
5 (format "%%%ds "
6 (format "%(add-hook 'code-review-mode-hook
7 (lambda ()
8 ;; include *Code-Review* buffer into current workspace
9 (persp-add-buffer (current-buffer))))%%ds: "</code></pre></li>
<li><p>Image Directory</p>
<p>Cause org mode html export program need a image directory locate at
org root directory.<br />
Highly recommended:<br />
Use <code>ln</code> making an mirror of the directory.<br />
Make the image directory as your screenshot file’s saving location.</p>
<pre><code>ln -s ~/org/org-roam/image any_where/image</code></pre></li>
</ol>
<p><a id="org90be83a"></a></p>
<h2 id="restclient">Restclient</h2>
<p>Restclient provide a test suite for HTTP REST in Emacs.The official
repository here <a
href="https://github.com/pashky/restclient.el">restclient.el</a>.<br />
Yea, a pretty old old project.Fortunately doom emacs have integrated
it.We just need open it with <code>(rest +jq)</code>.<br />
<strong>+jq</strong> makes restclient have the ability to parse a
particular response which Content-Type equalable application/json.<br />
The amazing feature is restclient support set variables or make a part
of response being a variables which one could as a request part for
another HTTP REST.</p>
<p>Here we take the value from results as a variables which named
count.</p>
<pre><code>GET https://www.zhihu.com/api/v3/oauth/sms/supported_countries
-> jq-set-var :count .count</code></pre>
<blockquote>
<p>Only <strong>jq-set-var</strong> could works when the content-type
equal to application/json MIME type</p>
</blockquote>
<p>Fortunately we have solution for other mime type, it’s
restclient-set-var, you could use elisp to parse the response;</p>
<pre><code>GET https://www.baidu.com/sugrec
-> run-hook (restclient-set-var ":queryid" (cdr (assq 'queryid (json-read))))
Content-Type: application/x-www-form-urlencoded; charset=utf-8</code></pre>
<p>About the variables infomation in current buffer, we could use
<code>C-c Tab</code> to show them.</p>