Skip to content

Jamie-Cui/emacs.d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

238 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs.d

░▒▓████████▓▒░▒▓██████████████▓▒░ ░▒▓██████▓▒░ ░▒▓██████▓▒░ ░▒▓███████▓▒░
░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░
░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░      ░▒▓█▓▒░
░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓████████▓▒░▒▓█▓▒░       ░▒▓██████▓▒░
░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░             ░▒▓█▓▒░
░▒▓█▓▒░      ░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░      ░▒▓█▓▒░
░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░░▒▓██████▓▒░░▒▓███████▓▒░

What this config does?

  1. Use melpa only.
  2. Use emacs version 30.1.
  3. Use Maple Mono NF CN (NO Ligature!): repo, download.
  4. Use Plantuml for uml drawing: download.
  5. Use emacs build-in tree-sitter.

Getting started

Ubuntu:

curl -sSL https://gist.githubusercontent.com/Jamie-Cui/e0c613bad06e17f34be591efb7615896/raw/00e86159e15191698f038d2be4367358f46fa66c/install-emacs-and-deps.sh | bash

Prerequisite

  • gcc toolchain (gcc, g++, cmake, makefile, autotools, …): compile environment
  • libgccjit: for emacs’s native compilation feature
  • libsqlite3: for org-roam database
  • libtree-sitter (tested with version 0.25.8, repo): for tree-sitter,
  • (optional) texlive: for latex
  • (optional) direnv: for separating project envs (sudo dnf install direnv)
# macos, if you have not done so, in ~/.zshrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/homebrew/lib/
# why tree-sitter@0.25? see: https://github.com/jdtsmith/emacs-mac/issues/121
brew install autoconf texinfo libgccjit gcc gnutls tree-sitter@0.25 pkg-config coreutils

Download and Compile Emacs

# download
wget -c https://github.com/emacs-mirror/emacs/archive/refs/tags/emacs-30.1.tar.gz
# or the following dev branch with tty-child-frame feature
wget -c https://github.com/emacs-mirror/emacs/archive/refs/heads/scratch/tty-child-frames.zip

# unzip and enter emacs folder
./autogen.sh
# (alt) configure terminal emacs
./configure --with-native-compilation --with-tree-sitter --with-gnutls --without-x-toolkit --without-xpm --without-gif --without-tiff --with-sqlite3
# (alt) configure gui emacs
./configure --with-native-compilation --with-tree-sitter --with-sqlite3 --with-rsvg --without-x-toolkit
# compile
sudo make install

MacOS: libgccjit failed to compile and run? see: d12frosted/homebrew-emacs-plus#680 (comment)

Have tree-sitter problem? see: link. Or download tree-sitter pre-built binaries here.

Setup $HOME/.emacs.d/init.el

(defvar +emacs/repo-directory "~/Desktop/emacs.d")
(load (concat +emacs/repo-directory "/init.el"))

C/C++ Dev Tools

  • clangd, clang-format, clang-tidy
# ubuntu
sudo apt install clangd, clang-format, clang-tidy
# macos
brew install clangd, clang-format, clang-tidy
  • cpplint
pip3 install cpplint
  • cmake-format
pip3 install cmake-format
git clone https://github.com/universal-ctags/ctags.git --depth=1
cd ctags
./autogen.sh
./configure --prefix=$HOME/.local
make
make install

Others

alias et='tmux attach -t emacs-session || tmux new -s emacs-session "emacs -nw"'

Sync between different machine?

Try: https://syncthing.net/

sudo dnf install -y syncthing # fedora
brew install syncthing # macos

For ios, see: https://github.com/pixelspark/sushitrain?tab=readme-ov-file (WARNING: this app may not be avaliable in your country)

Start sync daemon at user level:

systemctl --user start syncthing.service
systemctl --user status syncthing.service

Upgrade cluade code and acp

curl -fsSL https://claude.ai/install.sh | bash
npm install -g @anthropic-ai/claude-code # deprecated
npm install -g @zed-industries/claude-code-acp

About

My personal emacs config

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •