Convert Figma logo to code with AI

seagle0128 logo.emacs.d

Centaur Emacs - A Fancy and Fast Emacs Configuration

1,954
269
1,954
3

Top Related Projects

19,200

An Emacs framework for the stubborn martian hacker

23,638

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!

6,839

An Emacs configuration bundle with batteries included

5,100

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

Emacs client/library for the Language Server Protocol

Quick Overview

seagle0128/.emacs.d is a comprehensive and well-organized Emacs configuration. It provides a feature-rich, modern Emacs setup with a focus on productivity and aesthetics. The configuration is designed to be user-friendly and easily customizable, suitable for both beginners and experienced Emacs users.

Pros

  • Extensive set of pre-configured packages and features
  • Well-documented and organized codebase
  • Regular updates and active maintenance
  • Optimized for performance with lazy-loading techniques

Cons

  • May be overwhelming for users who prefer a minimal setup
  • Some users might find the default keybindings unfamiliar
  • Potential conflicts with existing user configurations
  • Requires some time to fully understand and customize all features

Getting Started

To use this Emacs configuration:

  1. Backup your existing Emacs configuration:

    mv ~/.emacs.d ~/.emacs.d.bak
    
  2. Clone the repository:

    git clone https://github.com/seagle0128/.emacs.d.git ~/.emacs.d
    
  3. Launch Emacs and wait for the initial setup to complete.

  4. (Optional) Customize the configuration by editing ~/.emacs.d/custom.el.

For more detailed instructions and customization options, refer to the project's README file on GitHub.

Competitor Comparisons

19,200

An Emacs framework for the stubborn martian hacker

Pros of Doomemacs

  • Faster startup time and overall performance
  • More extensive and up-to-date documentation
  • Modular design with easy customization options

Cons of Doomemacs

  • Steeper learning curve for beginners
  • Less "batteries included" approach, requiring more manual configuration
  • May conflict with existing Emacs configurations

Code Comparison

.emacs.d configuration:

(require 'init-const)
(require 'init-custom)
(require 'init-package)
(require 'init-basic)
(require 'init-ui)

Doomemacs configuration:

(doom! :input
       :completion
       :ui
       :editor
       :emacs)

The .emacs.d configuration uses a traditional approach with separate initialization files, while Doomemacs employs a declarative configuration style using modules.

23,638

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!

Pros of Spacemacs

  • More extensive and well-documented configuration options
  • Larger community and ecosystem of packages
  • Evil mode (Vim emulation) integrated by default

Cons of Spacemacs

  • Slower startup time due to larger codebase
  • Steeper learning curve for new users
  • More complex configuration process

Code Comparison

Spacemacs configuration example:

(setq-default
 dotspacemacs-configuration-layers
 '(
   helm
   auto-completion
   better-defaults
   emacs-lisp
   git
   markdown
   org
   (shell :variables shell-default-height 30 shell-default-position 'bottom)
   spell-checking
   syntax-checking
   version-control
   ))

.emacs.d configuration example:

(use-package company
  :diminish
  :defines (company-dabbrev-ignore-case company-dabbrev-downcase)
  :commands company-abort
  :bind (("M-/" . company-complete)
         ("C-M-i" . company-complete)
         :map company-active-map
         ("C-n" . company-select-next)
         ("C-p" . company-select-previous))
  :hook (after-init . global-company-mode)
  :init
  (setq company-minimum-prefix-length 2
        company-tooltip-limit 20
        company-idle-delay 0
        company-echo-delay 0
        company-show-numbers t))
6,839

An Emacs configuration bundle with batteries included

Pros of emacs.d

  • More established and mature project with a longer history
  • Extensive documentation and detailed explanations for configuration choices
  • Stronger focus on performance optimization and startup time

Cons of emacs.d

  • Less frequent updates and potentially slower adoption of new Emacs features
  • More opinionated configuration that may require more customization for individual preferences
  • Steeper learning curve for beginners due to its complexity

Code Comparison

.emacs.d:

(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024))
(setq package-native-compile t)

emacs.d:

(setq gc-cons-threshold 50000000)
(setq package-enable-at-startup nil)
(setq straight-use-package-by-default t)

Both configurations aim to improve performance, but .emacs.d tends to be more aggressive in its optimizations. emacs.d focuses on a leaner startup process by disabling package initialization at startup and using the straight.el package manager.

While both repositories offer comprehensive Emacs configurations, .emacs.d provides a more user-friendly experience with its modular structure and extensive customization options. On the other hand, emacs.d offers a more streamlined and performance-oriented approach, which may appeal to advanced users looking for a solid foundation to build upon.

5,100

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

Pros of Prelude

  • More modular and customizable structure
  • Extensive documentation and active community support
  • Faster startup time due to use of use-package

Cons of Prelude

  • Steeper learning curve for beginners
  • Less out-of-the-box functionality compared to .emacs.d
  • May require more manual configuration for specific use cases

Code Comparison

Prelude's modular approach:

(prelude-require-packages '(auctex cdlatex))
(setq prelude-latex-mode-hook 'turn-on-cdlatex)
(add-hook 'LaTeX-mode-hook (lambda ()
                             (LaTeX-math-mode)
                             (setq TeX-auto-save t)))

.emacs.d's integrated configuration:

(use-package tex
  :ensure auctex
  :hook (LaTeX-mode . (lambda ()
                        (turn-on-cdlatex)
                        (LaTeX-math-mode)
                        (setq TeX-auto-save t))))

Both repositories offer comprehensive Emacs configurations, but Prelude focuses on modularity and customization, while .emacs.d provides a more integrated, ready-to-use setup. Prelude's approach may be more appealing to experienced users who want fine-grained control, while .emacs.d might be preferable for those seeking a more streamlined, preconfigured experience.

Emacs client/library for the Language Server Protocol

Pros of lsp-mode

  • Focused specifically on Language Server Protocol (LSP) integration
  • More frequent updates and active development
  • Extensive language support with detailed configuration options

Cons of lsp-mode

  • Requires more manual setup and configuration
  • May have a steeper learning curve for new users
  • Less opinionated, which can lead to more decision-making for the user

Code Comparison

lsp-mode configuration example:

(use-package lsp-mode
  :hook ((python-mode . lsp)
         (rust-mode . lsp))
  :commands lsp
  :config
  (setq lsp-prefer-flymake nil))

.emacs.d configuration example:

(use-package centaur
  :config
  (setq centaur-lsp 'lsp-mode)
  (setq centaur-company-enable t)
  (centaur-tabs-mode t))

The lsp-mode example shows direct configuration of LSP for specific languages, while the .emacs.d example demonstrates a higher-level configuration using the Centaur package, which includes LSP setup among other features.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Centaur Emacs

Build Status Release Tag License Windows Linux macOS

Centaur Emacs

Table of Contents

This is an Emacs distribution that aims to enhance the default Emacs experience. It alters a lot of the default settings, bundles a plethora of additional packages and adds its own core library to the mix. The final product offers an easy to use Emacs configuration for Emacs newcomers and lots of additional power for Emacs power users.

It's able to run on Windows, GNU Linux and macOS. It is compatible ONLY with GNU Emacs 27.1 and above. In general you're advised to always run with the latest stable release - currently 29.2.

Features

  • Out of box.
  • Clean and Fast.
  • Quick fuzzy search.
  • Better Org/Markdown support.
  • Support multiple programming languages
    • C/C++/Object-C/C#/Java
    • Python/Ruby/Perl/PHP/Shell/Powershell/Bat
    • JavaScript/Typescript/JSON/YAML
    • HTML/CSS/XML
    • Golang/Swift/Rust/Dart/Elixir
    • ...
  • Auto completion.
  • Fly syntax check.
  • Fly spell check.
  • Git integration.
  • Project/Workspace integration.
  • Pomodor integration.
  • MPD integration.
  • Support docker.
  • Better Chinese support:
    • Chinese calendar
    • Youdao dictionary
    • Google translation
    • Pinyin search

Prerequisite

OS

  • GNU Linux
  • macOS
  • Windows (Cygwin/MSYS)

GNU Emacs

Please refer to Installing Emacs.

Dotfiles (Optional)

Recommend to use Centaur Dotfiles.

Quick Start

Install

mv ~/.emacs.d ~/.emacs.d.bak
git clone --depth 1 https://github.com/seagle0128/.emacs.d.git ~/.emacs.d

or download the zip package directly and extract to ~/.emacs.d.

If you are using Linux, you may prefer an XDG-compatible location, please use

# Please make sure ~/.emacs.d, ~/.emacs and ~/.emacs.el don't exist
git clone --depth 1 https://github.com/seagle0128/.emacs.d.git $XDG_CONFIG_HOME/emacs

or extract the zip package to $XDG_CONFIG_HOME/emacs directory.

Then start Emacs. Wait for a while to install packages at the first startup. Enjoy! :smile:

Attention: It may take long time to download packages at the first startup. It's up to your network speed. If it takes too long time and no response, check the connection or use proxy.

Note: Start Emacs with the minimal configuration for fast startup and troubleshooting.

emacs -Q -l ~/.emacs.d/init-mini.el

Update

# Update Centaur Emacs, including configurations and packages
M-x centaur-update

# Update Emacs configurations only
M-x centaur-update-config

# Update ~/.dotfiles if it exists
M-x centaur-update-dotfiles

# Update packages only
M-x centaur-update-packages

# Update all including configurations, packages and dotfiles
M-x centaur-update-all

Docker

cd ~/.emacs.d/Dockerfile
docker build -t centaur/emacs .
docker run -it centaur/emacs bash

Customization

Customize Group

M-x customize-group and select centaur. Set and save the configurations, then restart Emacs.

Manual

Add or change the configurations in custom.el, then restart Emacs.

For Example:

(setq centaur-logo nil)                        ; Logo file or nil (official logo)
(setq centaur-full-name "user name")           ; User full name
(setq centaur-mail-address "user@email.com")   ; Email address
(setq centaur-proxy "127.0.0.1:1087")          ; HTTP/HTTPS proxy
(setq centaur-socks-proxy "127.0.0.1:1086")    ; SOCKS proxy
(setq centaur-server t)                        ; Enable `server-mode' or not: t or nil
(setq centaur-icon t)                          ; Display icons or not: t or nil
(setq centaur-package-archives 'melpa)         ; Package repo: melpa, bfsu, iscas, netease, sjtu, tencent, tuna or ustc
(setq centaur-theme 'auto)                     ; Color theme: auto, random, system, default, pro, dark, light, warm, cold, day or night
(setq centaur-completion-style 'minibuffer)    ; Completion display style: minibuffer or childframe
(setq centaur-dashboard nil)                   ; Display dashboard at startup or not: t or nil
(setq centaur-lsp 'lsp-mode)                   ; Set LSP client: lsp-mode, eglot or nil
(setq centaur-lsp-format-on-save t)            ; Auto format buffers on save: t or nil
(setq centaur-lsp-format-on-save-ignore-modes '(c-mode c++-mode python-mode markdown-mode)) ; Ignore format on save for some languages
(setq centaur-tree-sitter nil)                 ; Enable tree-sitter or not: t or nil. Only available in 29+.
(setq centaur-chinese-calendar nil)            ; Support Chinese calendar or not: t or nil
(setq centaur-player t)                        ; Enable players or not: t or nil
(setq centaur-prettify-symbols-alist nil)      ; Alist of symbol prettifications. Nil to use font supports ligatures.
(setq centaur-prettify-org-symbols-alist nil)  ; Alist of symbol prettifications for `org-mode'

The default package archives is melpa. You can change it in custom.el, or set manually via M-x set-package-archives anytime.

For the personal configurations, you could put to ~/.emacs.d/custom-post.org or~/.emacs.d/custom-post.el.

Hydra

NameScopeKeybindingDescription
toggles-hydraglobal<f6>Global option toggles
window-hydraglobalC-c w/C-x o wWindow management
doom-modeline-hydradoom-modeline-modeC-<f6>Mode-line options and actions
hydra-dired-qick-sortdired-modeSOptions for dired-quick-sort
org-hydraorg-mode<Org template
dashboard-hydradashboard-modeh/?Actions for the dashboard
dumb-jump-hydraglobalC-M-jJump to definition
youdao-dictionay-hydrayoudao-dictionay-modeh/?Actions for youdao-dictionary
ztreediff-hydrazreediff-modeC-<f5>Actions for text mode directory tree
git-messenger-hydraglobalC-x v pActions for git-messenger
smerge-mode-hydrasmerge-modeC-c mActions for smerge-mode
rect-hydratext-mode, prog-modeC-<return>Actions for Rectangle
rect-hydraorg-modeS-<return>Actions for Rectangle
hideshow-hydraprog-modeC-~Actions for hideshow
lsp-ui-hydralsp-ui-modeM-<f6>Actions for lsp-ui
dap-hydradap-modeM-<f5>Actions for dap-debug
elfeed-hydraelfeed-search-mode?Actions for RSS reader elfeed
xwidget-hydraxwidget-webkit-mode?Actions for embedded webkit browser

Screenshots

Dashboard

color_icons

markdown_magit

org_classic

main_light

FAQ

  1. How to display icons correctly in Centaur Emacs?

    Generally you just use M-x centaur-install-fonts to install all necessary fonts. The manual steps are below.

    nerd-icons are necessary. Run M-x nerd-icons-install-fonts to install the resource fonts. On Windows, the fonts should be installed manually. nerd-icons supports bot GUI and TUI. If you don't like color icons, (setq nerd-icons-color-icons nil) to disable it. Please refer to nerd-icons.el for details.

  2. The packages cannot be installed, what should I do?

    Generally it's due to connection issue. Please refer to #98.

    • M-x package-refresh-contents and try again.
    • (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3").
    • Use other mirror of ELPA.
    • Change another network to retry.
  3. How to search Chinese via pinyin?

    In Emacs, C-s !. If you just want to search !, use C-s \!.

  4. How to use the Centaur Dashboard?

    If centaur-dashboard is non-nil the Centaur Dashboard will be opened at startup automatically. After startup, you could use F2 to reopen it anytime. In the dashboard, please press ? or h to get the help. You can easily jump to the sections or buttons with keybindings, e.g. Homepage(H), Session(R, L), Settings(S), Update(U), Recent Files (r), Bookmarks(m) and Projects(p).

  5. Does Centaur Emacs support Language Server Protocol (LSP)?

    The LSP feature is supported and enabled by default in Centaur Emacs. lsp-mode is the default client, and eglot is another choice. Use (setq centaur-lsp nil) to disable LSP if you don't like it.

    To use LSP you should install the language servers. Refer to lsp-mode: supported-languages or eglot: Connecting to a server for the details.

  6. How to enable plantuml in org-mode?

    Put (setq org-plantuml-jar-path "<path of plantumx.x.x.jar>") in custom.el.

  7. Why the Emacs environment variables and exec-path are different between GUI and terminal?

    Please refer to #33. You should instead set environment variables in startup files like .profile, .bash_profile or .zshenv, then Centaur Emacs is able to recognize and import the environment variables.

  8. How to use zoom-window in Centaur Emacs?

    See #169.

Donate

If you think the it's helpful for you, please consider paying a cup of coffee for me. Thank you! :smile:

Alipay      Wechat Pay

PayPal      Buy Me A Coffee