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:
- Code completion: Corfu is a modern, popup completion UI that works seamlessly with LSP backends like Eglot.
- Agent-shell: A native Emacs shell to interact with LLM agents powered by ACP
- Http client: verb a package for Emacs which allows you to organize and send HTTP requests.
- DB client: clutch — Interactive Database Client for Emacs include redis.
- Lsp client: eglot, a lightweight, stable, and ready to use out of the box .
- Terminal emulator: Emacs-libvterm (vterm) is fully-fledged terminal emulator inside GNU Emacs based on libvterm.
- Knowledge management system: Org-roam borrows principles from the Zettelkasten method, providing a solution for non-hierarchical note-taking.
Most of the time, for safety you should install emacs by brew or complie it from source ,that will give you a better compatibility.
In other words, try not to install emacs throuht Free installation package like Gnu Emacs below.
There have many emacs distribution,just choose one and install it.
-
EmacsPorts is the best choice to run NeoEmcas on macos now.
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 -
Emacs-plus which I used for a long time once.
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 -- -
Gnu-Emacs is the official emacs client which I used for windows platform.
-
Source Code Building form source which I use rarely.
building emacs with with source code1 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
-
bash
After emacs installation, set environment variables which names EMACS ,this depends on your emacs exec path.
cp -rf /opt/homebrew/Cellar/emacs-plus@31/31.0.90/Emacs.app /Applications/ export EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs # config emacsclient export EMACS_APP=/opt/homebrew/Cellar/emacs-plus@31/31.0.90 export PATH="$EMACS_APP/bin:$PATH" -
fish
cp -rf /opt/homebrew/Cellar/emacs-plus@31/31.0.90/Emacs.app /Applications/ set -x EMACS /Applications/Emacs.app/Contents/MacOS/EMACS # config emacsclient set -x EMACS_APP /opt/homebrew/Cellar/emacs-plus@31/31.0.90 set PATH $EMACS_APP/bin $PATH
clone doom-emacs and neo-emacs from github.
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
git clone --depth 1 https://github.com/vanniuner/neo-emacs.git ~/.doom.d/
Set up a vpn if you need it.
export http_proxy="ip:port"
export https_proxy="ip:port"
Set your emacs cmd for doom install.
export EMACS= $YOUR EMACS CMD PATH$
Make sure there have Cmake lib or install it.
-
Ubuntu
sudo apt install cmake sudo apt install libtool-bin -
MacOs
brew install cmake libtool gnuplot d2 ripgrep fzf terrastruct/tap/tala graphviz vips
At last run below, this will take few minutes. And it depends on the quality of your network.
~/.emacs.doom/bin/doom install
~/.emacs.doom/bin/doom.cmd install
brew upgrade
brew update && brew upgrade emacs-mac && brew cleanup emacs-mac
Running straight-pull-package performs a git pull inside the package’s repository at ~/.config/emacs/.local/straight/repos/PACKAGE/, and then you need to execute (doom/reload) (or M-x doom/reload) to recompile the source into .elc bytecode files (stored in ~/.config/emacs/.local/straight/build-EMACS_VERSION/PACKAGE/) and reload the updated package, making the changes take effect.
sh doom sync
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
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.
(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))
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.
Here have a tutorial to apply patch if you are using emacs plus.
-
Put the patches file under to `/opt/homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/patches/emacs-30`
-
Modify `/opt/homebrew/Library/Taps/d12frosted/homebrew-emacs-plus/Formula/emacs-plus@30.rb`, around local_patch.
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.# # 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"Notic: above sha value is out of date
-
Just install emacs plus, you could use `brew reinstall`
Customize your private setting config in the config.el ; use setq
Before start up,install fonts in the <./neoemacs/font> directory firstly.
Cause different platform have different font name,after font installed there need a adjustment based on the fact.
-
setting on macos
(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) -
setting on windows
(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) -
install all-the-icons
For the icons font, we need do below
- M-x install-package all-the-icons
- M-x all-the-icons-install-fonts
- M-x nerd-icons-install-fonts
-
font sepcify by mode
Use different font is a funny thing.The main idea to change font family is use
after-change-major-mode-hook,unfortunately the implement do not fit doom big font.(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) -
require fonts
Cause we are using multiple fonts ,here they are.
FONT NAME USED M PLUS Code Latin 50 dired mode Kode Mono vterm mode JetBrains Mono lsp mode IBM Plex Mono mode line which key
| variable | default value | config location | description |
| emacs-module-root | /opt/homebrew/opt/emacs-plus@28/include | config.el | emcas module root |
| display-line-numbers-type | nil | config.el | show line number |
| org-directory | ~/org/ | config.el | org root path |
| rg-exec-path | system path | - | - |
| fd-exec-path | system path | - | - |
| dot-exec-path | /opt/homebrew/bin/dot | modules/neo-emacs/org/config.el | dot exec path |
| pdflatex-exec-path | /Library/TeX/texbin/pdflatex | modules/neo-emacs/org/config.el | pdflatex exec path |
| org-roam-directory | ~/org/org-roam | modules/neo-emacs/org/config.el | org roam root path |
recentfile save default dir: ~/.emacs.d/.local/cache/recentf
read first
Download jdt-language-server-1.22.0 make `jdtls` in your PATH so that eglot could find it.After that you could use all the features powered by eclipse.
-
Generate eclipse files
Execute mvn command for generate eclipse .project & .classpath files on your project root path.mvn eclipse:clean eclipse:eclipse -
Shotcuts/Key binding
Table 2: java mode key binding KEY FUNCTION DESCRIPTION SPC c i find-implementations find where sub class definition SPC c f formart buffer/region goto type definition SPC c a lsp-execute-code-action code action SPC c d lsp-jump-definition jump to where symbol definition SPC c D lsp-jump-reference jump to where symbol referenced ; i lsp-java-organize-imports import require package SPC t s lsp-workspace-restart restart lsp server -
How to upgrade jdtls
- Customization your own eclipse jdtls project version by replace it’s binary pacage.
- Download the lastest jdt-language-server from https://download.eclipse.org/jdtls/milestones.
- Replace it in your bash/zsh/fish
You could config jdk version and lombok in jdtls python source code.
read first
agent shell A native Emacs shell to interact with LLM agents powered by ACP.
With agent-shell, you can interact with any ACP-driven agent like:
Claude Agent (Anthropic)
Codex (OpenAI)
Gemini CLI (Google)
Goose
Grok Build (xAI)
Cursor
Kimi Code CLI
CodeBuddy
Kiro CLI
Qwen Code
Auggie
Mistral Vibe
Factory Droid
Pi
Oh My Pi
Opencode
-
shortcuts/Key binding
KEY FUNCTION DESCRIPTION spc d a (open-opencode-session-in-right-window) new opencode agent session spc d c (open-cursor-session-in-right-window) new cursor agent session C-c RET (agent-shell-set-session-mode &optional ON-SUCCESS) set session mode plan/build g v (agent-shell-set-session-model &optional ON-SUCCESS) set session model gpt/deepseek \/ agent skill choose agent skill
You’d better install vterm in a terminal environment case there might have error incompatible architecture.
Vterm is not available on windows.
Thus windows user have to use eshell as a downgrade plan.
-
Install vterm
You’d better install vterm in a terminal environment case there might have error incompatible architecture.
If vterm complie failed in emacs, we could complie it manually.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 -
Fish shell optimize
If you are using fish shell ,fortunately there have some optimize config prepared for you.
-
feature:
-
use fish shell on emacs vterm.
-
use command `ff` %anyfile% on vterm will open %anyfile% in a new emacs buffer.It’s very useful.
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
-
-
http proxy
In fact there have two different config ,first one for vterm and another for emacs inner plugins.
In vterm the http proxy be effected by `~/.config/fish/config.fish`,you could config it like this.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"When you are using emacs lisp program such as restclient, you could config proxy like this.
The difference is wildcard(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")))) -
display command’s time
funced fish_right_prompt -i function fish_right_prompt echo -n (date +"%H:%M:%S ") end funcsave fish_right_prompt
-
-
Usage
-
Being with eshell
Eshell have a most wanted feature was quickrun-eshell which have a fast reload function after shell is runinng,you just useC-c C-cto stop it and use r to return you shell script file.It’s pretty convenient. -
Key Binding
KEY FUNCTION DESCRIPTION SPC v v projectile-run-vterm open vterm window base on the project root path SPC v p vterm-send-start enable vterm screen roll SPC v s vterm-send-stop disable vterm screen roll
-
-
The privacy configuration
In here you could save any connections in your setting config.
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 user-private-dir, You could config your connection’s account/password here for safely.
There default load a db-work module which having your privacy config .(add-to-list 'load-path user-private-dir ) (use-package! db-work ) -
Config your particular db connection
(setq clutch-connection-alist '(("test" . (:backend mysql :host "127.0.0.1" :port 3306 :user "root" :password "****" :database "test" :connect-timeout 5 :read-idle-timeout 60)))) (provide 'db-work) -
Write Sql file
Before try to use clutch , firstly create a sql file which named with a suffix .sql, cause emacs will turn on the clutch-mode so that clutch could works well. And then useSPC e cto connect a particular database which you have configurated. Emacs will popup a minibuffer listing candidates which show you the connection-name.
Secondarily, write your testing sql content which surrounded by a tag, cause we have configurated :separator 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.
Further more, you could use delimiter sign for batch execution. the delimiter could customization by any character.
Finnaly, useC-c C-cto execute it. It’s just execute the content which surrounded by a tag in your cusor.1 <SELECT name='select all org'> 2 SELECT * FROM TABLE_ORG 3 </SELECT> 4 <SELECT> 5 delimiter ; 6 COMMENT ON COLUMN TABLE_ORG.PROJECT_CODE IS '项目编码'; 7 COMMENT ON COLUMN TABLE_ORG.PERIOD IS '期间'; 8 </SELECT> -
key binding
KEY FUNCTION description SPC e c clutch-connection choose connection with ivy C-c C-c my-clutch-exec-xml-inner execute the sql ? clutch-dispatch clutch menu
shift system input method on macos
-
Install Dependency
There have some third party lib we need prepare.
-
d2 diagram
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 "
-
-
Image to base64
No need to sent images files of the source.
The embedded base64 image make to distribute your html documentation more easily. -
Optimize Line Number
Just hidden the colon after line number character.
Modify `~/.emacs.d/.local/straight/repos/org/lisp/ox-html.el`.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: " -
Image Directory
Cause org mode html export program need a image directory locate at org root directory.
Highly recommended:
Uselnmaking an mirror of the directory.
Make the image directory as your screenshot file’s saving location.ln -s ~/org/org-roam/image any_where/image
Verb is a new package for http client,becase the restclient is out of date and the author no longger maintain it on github.Fortunately there have a alternative one named verb which is more powerful and customizable. Verb support url template which makes you change different environment more conveniently.Also verb supports variables and picture query and upload.In org mode start verb just use `C-c C-r` as a previous command,example `C-c C-r C-f` will execute http request with your config,So verb is really fancy right?
-
set a particular location for bookmark
(setq bookmark-default-file "~/org/org-roam/command/doom/config/bookmark") -
key binding
key binding Spc-Ent select a bookmark Spc b m set a bookmark Spc b M delete a bookmark
rsync -avz rsync://mirrors.tuna.tsinghua.edu.cn/elpa ~/soft/emacs-elpa
(setq configuration-layer--elpa-archives
'(("melpa-cn" . "/soft/emacs-elpa/melpa/")
("org-cn" . "/soft/emacs-elpa/org/")
("gnu-cn" . "/soft/emacs-elpa/gnu/")
("marmalade-cn" . "/soft/emacs-elpa//marmalade/")))
as a full stack developer u need vue support, so here it comes.
npm install vls -g
You could customization startup inital workspace and their buffer.No need to open it every time.
(setq +workspaces-main " SSH")
(defun open-my-workspaces ()
(interactive)
(+workspace/new " IDE")
(find-file "yourexpect.java")
(+workspace/new " SQL")
(find-file "yourexpect.sql")
(+workspace/new " HTTP")
(find-file "yourexpect.http")
(+workspace/new " ORG")
(find-file "yourexpect.org"))
(add-hook 'window-setup-hook #'open-my-workspaces)
This step can help you compile neo emacs faster,It only takes 3 minutes to install using the release package on my Mac laptop. Otherwise it would take me 15 minutes. The release installation package is a better choice for users with unstable networks and those who need to frequently reinstall neoemacs.
Release package contains the git repository of related dependencies.The compiled directory files are removed and the .git directory is retained,So that you can perform subsequent upgrades.
I will update the Release package once a month, And test them in advance and revise them for compatibility with upstream projects.
For customize farther, there have some documentation you need read.
https://neoemacs.com/
https://github.com/hlissner/doom-emacs/blob/master/docs/getting_started.org
https://github.com/BurntSushi/ripgrep
https://github.com/junegunn/fzf
https://github.com/kostafey/ejc-sql
https://leiningen.org/
https://plantuml.com/
https://github.com/emacs-lsp/lsp-java
https://projectlombok.org/
https://github.com/DogLooksGood/emacs-rime
https://github.com/be5invis/Sarasa-Gothic
https://github.com/akicho8/string-inflection
https://raw.githubusercontent.com/alibaba/p3c/master/p3c-formatter/eclipse-codestyle.xml
https://www.tug.org/mactex/
