© Page 253 Turing Notes, 2020 –

The original video address: www.bilibili.com/video/BV13g…

At the beginning of Emacs experience

Tutorial introduction

The concept of the original video version (the one with * is also the concept of the text version) :

  • * Take a look at Emacs, the legendary editor
  • Each class lasts about five minutes, no crap, dry shit
  • * One skill or knowledge point per class, easy to learn
  • * It is also a learning process for me, making progress together
  • * Novice perspective, to learn from the old bird, to the master

Emacs profile

  • The explained version isGNU Emacs, not other derivative versions
  • GNU Emacs was launched in 1984,Richard StallmanInitiate and maintain
  • GNU Top level project
  • Competitors VIM, VSCode, etc
  • Cross-platform, the kernel interpreter is written in C and extended by the ELisp language

Emacs installed

Windows

It is recommended to install using a package manager such as Scoop or Chocolatey.

scoop bucket add extras
scoop install emacs
Copy the code
choco install emacs
Copy the code

Alternatively, you can download and unpack them from the Emacs website.

www.gnu.org/software/em…

Or download the beta version (version relatively new, function is actually quite stable) : alpha.gnu.org/gnu/emacs/p…

Linux

You are advised to use the package manager delivered with the distribution, for example:

# Ubuntu / Debian
sudo apt install emacs

# Fedora
sudo dnf install emacs

# Arch
sudo pacman -S emacs
Copy the code

Or you can download the source code from the official website to compile and install.

www.gnu.org/software/em…

macOS

Homebrew Package Manager is recommended for installation.

brew install --cask emacs
Copy the code

Or you can download it from the official website and drag it to the Applications directory to use it.

www.gnu.org/software/em…

Emacs version

As of this writing:

  • Latest version: 28.1 (April 4, 2022)
  • Unstable version in development: 29.0.50

The original tutorial is a 27.2 demo version, compatible with 28/29 (so you can use the latest 28.1 directly when using this tutorial). Before installation, check whether the package manager is installed in the correct version.

Note: Over time, I have generally improved the version to 28.1+ from the beginning of 2022.

# Windows
scoop info emacs

# Linux
apt info emacs
dnf info emacs

# macOS
brew info emacs
Copy the code

Start Emacs, and then view the version. M-x emacs-version

Or view the version on the command line. emacs –version

Emacs met

Green: menu bar

Red: Toolbar

Yellow: Edit area

Blue: Status bar

Purple: Interaction area (output information, M-X operations, etc.)

Basic operational shorthand

Not too much, just a little bit of cursor movement.

  • C, on behalf ofCTRLkey
  • M, on behalf ofMetaKey, usually ALT (part of the keyboard is ESC)

Cursor movement, before forming muscle memory can be memorized by shorthand:

  • C-n, Nextline (shorthand: Nextline)
  • C-p, Previous line (shorthand: Previous line)
  • C-f, move Forward one character
  • C-b, one character back (shorthand: Backforward)
  • C-k, delete from cursor position to end (shorthand: Kill)
  • C-a, go back to the beginning of the line.
  • C-e, End of line
  • M – <, back to the beginning of the edit area (shorthand: <)
  • M – >, the last position to the editing area (shorthand: >)
  • C-v, scroll down a screen
  • M-v, scroll up a screen

Bring the document

C-h t ; Shorthand Help Tutorial

View the meanings of shortcut keys:

C-h k ; Shorthand Help Keybind

View function definitions and shortcut key bindings:

C-h f ; Shorthand Help Function

Make some changes to the look

Configure M-X customize graphically

  • The menu bar menu bar – mode
  • Toolbar tool – bar – mode
  • Scroll bar scroll bar – mode

Experience configuration using the configuration file

Create a file ~/.emacs and write:

(menu-bar-mode - 1)
(tool-bar-mode - 1)
(scroll-bar-mode - 1)
Copy the code

Restart Emacs to see what it actually looks like.

Emacs configuration Experience

Getting to know configuration Files

Emacs configuration files are located in the following order:

  1. ~/.emacs
  2. ~/.emacs.d
  3. ~/.config/emacs/init.el

The first is a single file configuration; The second is more engineering; The third is only available for ≥27 versions.

The tutorial will start with the first one and gradually move into the second one.

Why not use the Bull configuration

  • What are the danniu configuration
  1. Spacemacs
  2. Centaur Emacs
  3. Doom Emacs
  4. Steve Purcell
  5. Redguardtoo (Chen Bin, become emacs expert author in one year)
  • My advice
  1. Of course, daniu configuration is recommended. Daniu configuration is the best and has experienced the test of time and project. Even if you do not use it daily in the future, it is of great learning value.
  2. Why you don’t use it: You must have been using it for a long time before you wanted to learn, configure, and build something of your own after learning about Emacs. And you are strongly advised to add or subtract based on the configuration of Daniel.

My configuration github.com/cabins/emac…

First line of Emacs configuration code

You’ve experienced turning off menu bars, toolbars, scrollbars, etc. Now try turning off the startup screen:

(setq inhibit-startup-screen t)
Copy the code

Reboot Emacs and see?

Software sources

  • What is a software source, and the source from which you install third-party plug-ins (or is it more appropriate to call it a plug-in source?)? .
  • Why use software sources? Different software sources have different packages, so in order to find more needed packages.
  • Why change to domestic software sources? Some software sources may not be accessible, and some software sources may not have ideal speed when connected in China.
(setq package-archives
      '(("melpa" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
        ("gnu" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
        ("org" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/org/")))
Copy the code

Install the first Emacs extension

Before installing the extension, refresh the index of the software source.

;; Occasionally, signature verification fails
(setq package-check-signature nil) 

;; Initialize the package manager
(require 'package)
(unless (bound-and-true-p package--initialized)
    (package-initialize))

;; Updated the software source index
(unless package-archive-contents
    (package-refresh-contents))

;; The first extension, use-package, is used to centrally manage packages in batches
(unless (package-installed-p 'use-package)
    (package-refresh-contents)
    (package-install 'use-package))
Copy the code

Manage extensions using use-package

  • What is the use – package
  • How to use

The simplest format

(use-package restart-emacs)
Copy the code

Common formats

(use-package SOME-PACKAGE-NAME
             :ensure t ; Whether it is necessary to ensure that it is installed
             :defer t ; In many cases, you can speed up Emacs startup with or without lazy loading
             :init (setq...).; Initial Configuration
             :config(...).; Basic configuration parameters after initialization
             :bind(...).; Shortcut Key Binding
             :hook(...).; Hook the binding
             )
Copy the code

Recommended configurations:

;; 'use-package-always-ensure' avoids adding ":ensure t" to every package
;; 'use-package-always-defer' avoids the need to add ":defer t" to each package
(setq use-package-always-ensure t
      use-package-always-defer t
      use-package-enable-imenu-support t
      use-package-expand-minimally t)
Copy the code

Change the theme

The initial tutorial demo uses the Gruvbox-theme theme.

(use-package gruvbox-theme
             :init (load-theme 'gruvbox-dark-soft t))
Copy the code

Configure a nice Mode Line for the initial tutorial.

(use-package smart-mode-line
  :init
  (setq sml/no-confirm-load-theme t
        sml/theme 'respectful)
  (sml/setup))
Copy the code

But later I prefer to use the built-in Modus theme (28+), aesthetic thing, it’s up to you.

Engineering management configuration (1) Function splitting

At this point, ~/.emacs is configured with a lot of stuff that is starting to look messy:

  • Initialize the Elpa
  • Install the extension
  • Add the theme

It’s time to sort it out. It’s like a development project. Try splitting the configuration into separate files for different functions. Such as:

  • Lisp /init-elpa.el is used to store elPA and Package initialization
  • Lisp /init-package.el is used to store installed extensions
  • Lisp /init-ui.el is used to store the configuration related to the interface theme
  • How do you tie them together in an initialization file (call)?

Engineering management configuration (2) file loading and invocation

Set the load destination directory to load-path first.

(add-to-list 'load-path (expand-file-name (concat user-emacs-directory "lisp")))
Copy the code

Each file exposes the name of the external call through provide. Such as:

(provide 'init-ui)
Copy the code

Then in the init.el file call it via require:

(require 'init-ui)
Copy the code

About custom configuration

It is recommended to write a separate file, which will not be committed to Git when open source. Such as, custom. El

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
Copy the code

So that’s going to write some configuration that I did through the graphical interface right here.

Operating system

The later part of the configuration will generate different configuration codes based on the operating system, so it is necessary to determine the operating system.

(defconst *is-mac* (eq system-type 'darwin))
(defconst *is-linux* (eq system-type 'gnu/linux))
(defconst *is-windows* (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)))
Copy the code

The Windows judgment can also be put a bit wider:

(defconst *is-windows* (memq system-type '(ms-dos windows-nt cygwin)))
Copy the code

The macOS platform maps the Command key to Meta

For a Mac keyboard, The Command key is closer to x than a Windows keyboard, so it’s customary to change the mapping to Meta. If you don’t need this setting, don’t bother.

(when *is-mac* (setq mac-command-modifier 'meta)
               (setq mac-option-modifier 'none))
Copy the code

Fix Emacs stuttering on Windows by modifying fonts

The solution is to change the font. In the initial version, I would suggest changing the font like this:

In the current scenario I would recommend changing the font like this:

(defvar cn-fonts-list '("Black" "STHeiti" Microsoft Yahei "Wenquan translated micron black")
  "Define a candidate list of Chinese fonts to use.")

(defvar en-fonts-list '("Cascadia Code" "Courier New" "Monaco" "Ubuntu Mono")
  "Define a candidate list of English fonts to use.")

(defvar emoji-fonts-list '("Apple Color Emoji" "Segoe UI Emoji" "Noto Color Emoji" "Symbola" "Symbol")
  "Define an Emoji font candidate list.")

;;; ###autoload
(defun tenon--font-setup ()
  "Font setup."

  (interactive)
  (let* ((cf (tenon--available-font cn-fonts-list))
	     (ef (tenon--available-font en-fonts-list))
         (em (tenon--available-font emoji-fonts-list)))
    (when ef
      (dolist (face '(default fixed-pitch fixed-pitch-serif variable-pitch))
	    (set-face-attribute face nil :family ef)))
    (when em
      (dolist (charset `(unicode unicode-bmp ,(if (> emacs-major-version 27) 'emoji 'symbol)))
        (set-fontset-font t charset em nil 'prepend)))
    (when cf
      (dolist (charset '(kana han cjk-misc bopomofo))
	    (set-fontset-font t charset cf))
      (setq face-font-rescale-alist
	        (mapcar (lambda (item) (cons item 1.2)) `(,cf ,em))))))
Copy the code

You can use cn-fonts-list in your custom.el to customize fonts without rewriting the configuration code.

It is recommended to add a bit of boot configuration

Set the code of the system to avoid garbled code everywhere. In my original tutorial, I suggested that you write:

(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
Copy the code

In fact, this is what I would recommend in the latest configuration. These two lines of code are sufficient.

(prefer-coding-system 'utf-8)
(unless *is-windows*
    (set-selection-coding-system 'utf-8))
Copy the code

Set the garbage collection threshold to speed up startup.

(setq gc-cons-threshold most-positive-fixnum)
Copy the code

Test Startup Time

The startup time is measured using the benchmark-init package.

(use-package benchmark-init
             :init (benchmark-init/activate)
             :hook (after-init . benchmark-init/deactivate))
Copy the code

After the startup is complete, you can execute:

M-x benchmarks-init /show-durations-tree or M-x benchmarks-init /show-durations-tabulated to view the startup time details.

Interrupt command input

C-g When entering a command, you can use the shortcut key to stop entering the command.

Use y/n instead of yes/no

(defalias 'yes-or-no-p 'y-or-n-p)
Copy the code

In order to unify the project management, we can use the following use-package notation (actually it is not necessary, just one line of code, do not over-wrap) :

(use-package emacs
             :config (defalias 'yes-or-no-p 'y-or-n-p))
Copy the code

According to the line Numbers

The type of line number

Starting with Emacs 26, you can change the line number type by setting the value of the display-line-numeres-type variable. The value can be:

  • Relative, relative line number
  • Visual, visual line number
  • t

Line number configuration (it is not necessary to use use-package, just keep the next two lines of config)

(add-hook 'prog-mode-hook 'display-line-numbers-mode)
Copy the code

Emacs text editing

Select/copy/cut/paste for text editing

The selected

  • Method 1: Drag the mouse to select
  • In method two, mark the start position and then move the cursor to the end position

Copy the M – w

Shear C – w

Paste the C – y;; Shorthand Yank

Delete text editing

Scenario 1: Delete from cursor position to end of line

C-k

Scenario 2: Delete the current row

My original video tutorial suggested that there was no such shortcut by default, and that you could install an extension, Crux, which provides a series of optimized shortcut commands including this scene.

(use-package crux 
             :bind ("C-c k" . crux-smart-kill-line))
Copy the code

But there is a shortcut, c-s –

(kill-whole-line).

Scenario 3: Delete the first non-null character before/after (delete consecutive whitespace)

This function is implemented through the hungry-delete extension.

(use-package hungry-delete
  :bind (("C-c DEL" . hungry-delete-backward)
         ("C-c d" . hungry-delete-forward)))
Copy the code

Text edit line/area moves up and down

Moving lines/blocks up and down is very easy in VSCode or Jetbrains family editors, but native Emacs does not provide this functionality. This is assisted by the plug-in drag-stuff.

(use-package drag-stuff
             :bind (("<M-up>" . drag-stuff-up)
                    ("<M-down>" . drag-stuff-down)))
Copy the code

Or use the move-dup plugin:

(use-package move-dup
             :hook (after-init . global-move-dup-mode))
Copy the code

Native search/replace for text editing

Emacs native provides powerful search and replace capabilities.

  • Search c-s for current location to end of document

  • Current location to the start of the document search C-R

  • Replace the M – %

Press y to confirm the replacement and n to skip the replacement. Replace all of them.

Enhanced search for text editing

The famous Ivy-charge-Swiper tripe is designed to enhance searching (and optimize a series of Minibuffer operations).

Automatic completion of text editing

The two monopolies in Emacs are auto-complete and Company (Complete Anything). Due to The Times and characteristics, Company presents an overwhelming advantage.

My earliest code suggests you write this:

For the latest code I would suggest you write it like this:

(use-package company
  :hook (after-init . global-company-mode)
  :config (setq company-minimum-prefix-length 1
                company-show-quick-access t))
Copy the code

Syntax checking for text editing

In the original tutorial I suggested you use Flycheck instead of Flymake, due to the influence of other bulls and history. But for now, I recommend using the built-in Flymake, because it already works pretty well.

(use-package flymake
  :hook (prog-mode . flymake-mode)
  :config
  (global-set-key (kbd "M-n") #'flymake-goto-next-error)
  (global-set-key (kbd "M-p") #'flymake-goto-prev-error))
Copy the code

Text editing line sorting

M-x sort-lines

Change the order of text editing

The two characters before and after the cursor are interchangeable c-T

Interchangeably the words before and after the cursor m-t

Word count for text editing

Total Buffer statistics

M-= 或者 M-x count-words-region

Selected region statistics

Select the area to be counted and run m-x count-words

A common Emacs plug-in

Crux optimizes common Emacs operations

  • The optimized version goes back to the top of the line
  • Quickly open the Emacs configuration file
  • Fast connection of two lines, etc
(use-package crux
  :bind (("C-a" . 'crux-move-beginning-of-line)
         ("C-c ^" . 'crux-top-join-line)
         ("C-x ," . 'crux-find-user-init-file)
         ("C-c k" . 'crux-smart-kill-line)))
Copy the code

In fact, I now recommend c-A and M-M for quick return to the top of the line. Such shortcuts are both built-in and explicit.

How to remember longer and longer keyboard shortcuts

If you don’t like clicking on the menu bar with your mouse, you can actually use the Which-Key plugin to help you “remember”.

(use-package which-key
  :defer nil
  :config (which-key-mode))
Copy the code

When you press a key, it tells you what the next key means. And wait for you to press it.

Emacs window management

Buffer management for window management

Buffer switch

C-x b

Kill the current Buffer

C-x k

Batch management Buffer

C-x C-b ;; Enter the Buffer list

  • d ;; Tags deleted
  • u ;; Untag the current line
  • U ;; Untag all
  • x ;; Perform operations
  • ? ;; View button Help

MiniBuffer interaction optimization for window management

The MiniBuffer shown in the lower left corner has a large eye range and is moved to a more appropriate center position.

Split screen for window management

Enable horizontal split screen C-x 3

Enable vertical split panel C-x 2

Retain only the current split screen C-x 1

Disable the split screen c-x 0

Split screen width adjustment for window management

Increase the height C minus x ^

Increase/decrease width c-x {c-x}

Quick split screen switch for window management

By default, you can use the following shortcut keys to cycle to the window: C-x O

It’s very inefficient when you have a lot of split screens. Ace-window can be used to quickly jump between Windows. There are many similar plug-ins, but this is the best solution.

(use-package ace-window 
             :bind (("M-o" . 'ace-window)))
Copy the code

Window management Tab Tab management

C minus x and t

  • 2;; A new Tab
  • 1;; Close other tabs
  • 0;; Close current Tab
  • b ;; Open Buffer in a new Tab

A programming language

Eglot achieve IDE

Github.com/joaotavora/…

In the world of Emacs programming, there are two ways to quickly implement an IDE, eglot in this section and Lsp-mode in the next section. A lot of text could be written about the contrast between the two. Here I pick a few typical ones to illustrate:

  • Eglot is lightweight, while lsp-mode is heavy
  • Eglot has no third-party dependencies. Lsp-mode has many third-party dependencies
  • The eglot implementation is adequate, but not rich; The lsp-mode function is very rich

So I’m going to explain both, and I’m going to leave it up to the reader to decide which one to use.

If you just want to experiment, you can actually install eglot through package-install, go into a file in one of the programming languages, and start with M-x Eglot. And if you like it as much as I do, here’s a guide.

(use-package eglot
  :hook ((c-mode
          c++-mode
          go-mode
          java-mode
          js-mode
          python-mode
          rust-mode
          web-mode) . eglot-ensure)
  :bind (("C-c e f" . #'eglot-format)
         ("C-c e a" . #'eglot-code-actions)
         ("C-c e i" . #'eglot-code-action-organize-imports)
         ("C-c e q" . #'eglot-code-action-quickfix))
  :config
  ;; (setq eglot-ignored-server-capabilities '(:documentHighlightProvider))
  (add-to-list 'eglot-server-programs '(web-mode "vls"(a))defun eglot-actions-before-save()
    (add-hook 'before-save-hook
              (lambda ()
                (call-interactively #'eglot-format)
                (call-interactively #'eglot-code-action-organize-imports))))
  (add-hook 'eglot--managed-mode-hook #'eglot-actions-before-save))
Copy the code

Above is my eglot configuration, adding some of the programming languages I use daily, keyboard shortcuts, and some configurations to automatically format and save/manage imported packages.

Note: You must first install the language-Server and configure the environment variables. For example, it needs to be CCLS or Clangd for C/CPP, rust-Analyzer for Rust, and GoPLS for GO.

LSP – mode to realize the IDE

The configuration of lsp-mode is relatively similar. But it has a very rich set of features to configure. The following figure shows a simplified configuration.

(use-package lsp-mode
  :commands (lsp lsp-deferred)
  :init
  (defun lsp-save-actions ()
    "LSP actions before save."
    (add-hook 'before-save-hook #'lsp-organize-imports t t)
	(add-hook 'before-save-hook #'lsp-format-buffer t t))
  :hook ((lsp-mode . #'lsp-enable-which-key-integration)
         (lsp-mode . #'lsp-save-actions)
         ((c-mode
           c++-mode
           go-mode
           java-mode
           js-mode
           python-mode
           rust-mode
           web-mode) . lsp-deferred))
  :config
  (setq lsp-auto-guess-root t
	    lsp-headerline-breadcrumb-enable nil
	    lsp-keymap-prefix "C-c l"
	    lsp-log-io nil)
  (define-key lsp-mode-map (kbd "C-c l") lsp-command-map))
Copy the code

For more information, please refer to github.com/emacs-lsp/l…

Similarly, you need to have language-Server installed and environment variables configured in advance.

Due to the richness of lsp-mode, you can also install lsp-UI to improve the graphical experience:

(use-package lsp-ui
    :after lsp-mode
    :init
    (setq lsp-ui-doc-include-signature t
	      lsp-ui-doc-position 'at-point
          lsp-ui-sideline-ignore-duplicate t)
    (add-hook 'lsp-mode-hook 'lsp-ui-mode)
    (add-hook 'lsp-ui-mode-hook 'lsp-modeline-code-actions-mode)
    :config
    (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
    (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references))
Copy the code

For debugging scenarios, you can also install dap-mode and the corresponding debugger to use it:

(use-package dap-mode
    :init
    (add-hook 'lsp-mode-hook 'dap-mode)
    (add-hook 'dap-mode-hook 'dap-ui-mode)
    (add-hook 'dap-mode-hook 'dap-tooltip-mode)
    ;; (add-hook 'python-mode-hook (lambda() (require 'dap-python)))
    ;; (add-hook 'go-mode-hook (lambda() (require 'dap-go)))
    ;; (add-hook 'java-mode-hook (lambda() (require 'dap-java)))
    )
Copy the code

Does lsp-mode look a lot richer than eglot? Note, however, that on some machines, especially Windows machines, lsp-Mode has performance issues such as stuttering, whereas eglot rarely does.

Java Special Configuration

With the ABOVE LSP client, the normal environment should be easy to configure or not need to be configured, such as GoPLS, pylsp, etc., but there are some programming language servers that require some additional configuration. In the case of C/C ++, for example, in the case of Java.

Java’s language server is the JDTLS from Eclipse, and the latest version of the JDTLS provides an executable file. For non-Windows environments, just put the bin directory in an environment variable. But the executable scripts they provide are written in Python, which cannot be turned into executable files on Windows.

So you need to generate an extra executable, or write your own version of the jdTLS.bat executable for Windows.

@echo off

set CMD_LINE_ARGS=
:setArgs
if ""%1""= ="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs

cd /d %~dp0

java^
    -Declipse.application=org.eclipse.jdt.ls.core.id1^
    -Dosgi.bundles.defaultStartLevel=4^
    -Declipse.product=org.eclipse.jdt.ls.core.product^
    -Dosgi.checkConfiguration=true^
    -Dosgi.sharedConfiguration.area=.. /config_win^-Dosgi.sharedConfiguration.area.readOnly=true^
    -Dosgi.configuration.cascaded=true^
    -noverify^
    -Xms1G^
    --add-modules=ALL-SYSTEM^
    --add-opens java.base/java.util=ALL-UNNAMED^
    --add-opens java.base/java.lang=ALL-UNNAMED^
    -jar ../plugins/org.eclipse.equinox.launcher_1.6.400.v20210924- 0641..jar^
    %CMD_LINE_ARGS%

Copy the code

Or use PyInstaller –onefile (source code below).

import os
import sys

if getattr(sys, "frozen".False):
    dir_path = os.path.dirname(os.path.dirname(os.path.abspath(sys.executable)))
else:
    dir_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

cmd = (
    "java"
    " -Declipse.application=org.eclipse.jdt.ls.core.id1"
    " -Dosgi.bundles.defaultStartLevel=4"
    " -Declipse.product=org.eclipse.jdt.ls.core.product"
    " -Dosgi.checkConfiguration=true"
    f" -Dosgi.sharedConfiguration.area={dir_path}/config_win"
    " -Dosgi.sharedConfiguration.area.readOnly=true"
    " -Dosgi.configuration.cascaded=true"
    " -noverify"
    " -Xms1G"
    " --add-modules=ALL-SYSTEM"
    " --add-opens java.base/java.util=ALL-UNNAMED"
    " --add-opens java.base/java.lang=ALL-UNNAMED"
    f" -jar {dir_path}/ plugins/org. Eclipse equinox. Launcher_1. 6.400. V20210924-0641. The jar"
    f" {' '.join(sys.argv[1:)}"
)

os.system(cmd)
Copy the code

For Windows

For a long time, many people have given the experience of using Emacs on Windows a low rating. Including me. After a while, I’d like to say that it’s not as bad as we talked about. It may not be as good as the Linux/macOS experience, but it can be used on a daily basis and could even be your workhorse editor.

Generally speaking, Windows needs to solve several aspects of the problem can be:

  • Fonts. This is the main culprit in Catton
  • If you like plug-ins like MacType, be sure to rule out Emacs, which is a pretty obvious way to get stuck
  • Some plugins are replaced, for example, VC is used to replace Magit, for example, built-in project is used to replace Pro
  • Windows can also use daemons

conclusion

The reason for the rewrite, and the fact that it will continue to be updated in the future (which is why the version number has been added to this article), is to keep my understanding and use of Emacs up to date, and to bring these updates to more beginners and those who need them. Make more like-minded friends.

Not surprisingly, I’ll probably be releasing a big version of ** a year later, although there won’t be many updates. And basically, there will be a lot more Emacs Luxe Road later (read that little volume if you’re interested). I think that’s the way to go with Emacs. If you like, you can keep up with me and the two collections. At the same time, I also welcome more content to add in, welcome to give me comments/suggestions.

Release History:

  • V0.1, video version, will be released in March 2020
  • V1.0, current version, April 2022