spacemacs README

The project's README from github.com/syl20bnr/spacemacs. As one markdown file: README.md.

Made with Spacemacs GPLv3 Software Twitter

Spacemacs

philosophy | for whom? | screenshots | documentation | contribute | achievements | FAQ

Gitter Discord elisp state Donate Merchandise Recommend it


Quick Start

If you don't have an existing Emacs setup and want to run Spacemacs as your configuration, and if you have all prerequisites installed, you can install Spacemacs with one line:

If you do have an existing Emacs configuration, look at the full installation instructions for other options.

Introduction

Spacemacs is a new way of experiencing Emacs -- it's a sophisticated and polished set-up, focused on ergonomics, mnemonics and consistency.

Just clone and launch it, then press the space bar to explore the interactive list of carefully-chosen key bindings. You can also press the home buffer's [?] button for some great first key bindings to try.

Spacemacs can be used naturally by both Emacs and Vim users -- you can even mix the two editing styles. Being able to quickly switch between input styles, makes Spacemacs a great tool for pair-programming.

Spacemacs is currently in beta, and any contributions are very welcome.

spacemacs_python

Features

SPC h SPC.

SPC or Alt-m.

SPC b for all the buffer commands or SPC p for the project commands.

Documentation

Comprehensive documentation is available for each layer by pressing SPC h SPC.

You can also check the general documentation, quick start guide and the FAQ.

Getting Help

If you need help, ask your questions in the Gitter Chat and a member of the community will help you out.

If you prefer IRC, connect to the Gitter Chat IRC server and join the #syl20bnr/spacemacs channel.

Last but not least there are a lot of high class tutorials available on YouTube:

Prerequisites

  1. A package manager if the OS doesn't have one already.

  2. Spacemacs is an extension of a popular text editor called Emacs. So you'll need Emacs installed first.

    Spacemacs requires Emacs 28.2 or above. The development version of Emacs is not officially supported, but it should nevertheless be expected to work.

  3. git is required to download and update Spacemacs.

  4. Tar, in particular GNU Tar, is required to install and update Emacs packages used by Spacemacs.

  5. (Optional) The default font used by Spacemacs is Source Code Pro. You may customize your own font settings and choose another font. If you want to use this default font, it must be installed.

    Spacemacs also uses fallback fonts to ensure certain Unicode symbols it uses symbols appear correctly. The fonts used are determined by the OS:

    If the mode-line doesn't look similar to the picture at the top of this page, make sure you have the correct fallback font installed.

  6. (Optional) Various commands in Spacemacs needs one of the following line searching program:

    Grep is very slow but it's widely available on most systems and is used as an fallback option.

    We strongly recommend ripgrep over other line searching programs, for its blazing fast speed. The following subsections helps you to install it.

Linux

  1. Most Linux distribution ships a package manager already and if this is the case you are all set for this step.

    If it doesn't, you may need to build the softwares mentioned below from their sources.

  2. In most distributions, Emacs is installed via an emacs package from the package manager.

    N.B. DO not install XEmacs because it's not supported by Spacemacs. XEmacs is an old fork of Emacs with various subtle differences.

    N.B. Some Linux distributions support only Emacs versions older than 28.2. In this case you should build it from source instead.

  3. Very likely Git is already installed on your system. Otherwise, you should be able to install git from your system's package manager.

  4. Very likely Tar is already installed on your system. Otherwise, you should be able to install tar from your system's package manager.

  5. (Optional) If Nerd Fonts and Nanum Gothic are available from your distribution's package manager, you should install it there.

    Otherwise, the generic way to install it is:

    1. Download the latest pre-built TTF font from https://github.com/adobe-fonts/source-code-pro/releases/latest and https://fonts.google.com/specimen/Nanum+Gothic.

    2. Extract the archive and move the font files to ~/.fonts.

    3. Refresh font cache with:

    fc-cache -fv
    
  6. (Optional) If your distribution is listed here, follow the instructions. Otherwise, you can download its pre-built binary or build it from source.

macOS

  1. The most popular package manager on macOS is Homebrew, to install it:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Several options exist for installing Emacs on macOS:

    1. Emacs Plus features additional functionalities over base Emacs.

      brew tap d12frosted/emacs-plus
      
      # install latest stable release, with Spacemacs icon and native compilation
      brew install emacs-plus --with-spacemacs-icon --with-native-comp
      

      You will require the latest version of Xcode Command Line tools, which can be downloaded from the Apple Developer Portal or by running the following command:

      softwareupdate --all --install --force
      
    2. Emacs Mac Port adds native GUI support to Emacs 28. And the full list of features is available here.

      brew tap railwaycat/emacsmacport
      brew install emacs-mac
      
    3. Emacs for Mac OS X is the binary build of GNU Emacs, without any extra feature.

      brew install --cask emacs
      
  3. To install git:

    brew install git
    
  4. macOS ships with BSD Tar, but there are reports of weird issues so we require GNU Tar instead.

    brew install gnu-tar
    
  5. (Optional) To install Source Code Pro Font:

    brew tap homebrew/cask-fonts
    brew install --cask font-source-code-pro
    

    Arial Unicode MS is shipped with macOS v10.5 and later so you don't need to install it manually.

  6. (Optional) You can install ripgrep via Homebrew:

    brew install ripgrep
    

Windows

We recommend using wsl2 with wslg support especially with a pgtk build of emacs and wayland. For the installation please refer to the linux installation section. When running emacs within your wsl2 environment emacs will be handled like any other windows application.

If this is not possible you can fallback to a native windows installation, however note that this will create a lot of subtle bugs especially with tls which we will most likely not be able to help with.

If you need to follow that path we recommend to at least use a package manager like Scoop to install the needed packages.

  1. You can install Scoop via PowerShell:

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
    irm get.scoop.sh | iex
    
  2. Emacs can be installed in PowerShell:

    scoop bucket add extras
    scoop install emacs
    
  3. To install git in PowerShell:

    scoop bucket add main
    scoop install git
    
  4. Windows 10 build 17063 and later ships with BSD Tar, but it's required to install GNU Tar instead to avoid possible issues. Alternatively, if you are running an earlier version of Windows, Tar isn't installed. In either case, you can install GNU Tar via:

    scoop bucket add main
    scoop install tar
    
  5. To install Source Code Pro Font in PowerShell:

    scoop bucket add KnotUntied_scoop-fonts https://github.com/KnotUntied/scoop-fonts
    scoop install sourcecodepro
    

    MS Gothic and Lucida Sans Unicode are shipped with Windows 2003 and later so you don't need to install it manually.

  6. (Optional) You can install ripgrep in PowerShell:

    scoop bucket add main
    scoop install ripgrep
    

Install

Default Install

  1. The default installation downloads Spacemacs to the .emacs.d directory in your HOME directory.

    But in the case of Windows, HOME is not set out-of-box. We recommend you to set it as an environment variable, with the same value as environment variable HOMEPATH, which usually looks like C:\Users\<username>.

  2. Since Spacemacs will now be downloaded at "${HOME}/.emacs.d", if it already exists it'll be overridden.

    Also, if you have either "${HOME}/.emacs.el" or "${HOME}/.emacs", they will appear before Spacemacs in Emacs's initialization steps. Thus they must be renamed in order for Spacemacs to load correctly.

    To backup/rename the aforementioned files/directory, in shell:

    [ -d "${HOME}/.emacs.d" ] && mv "${HOME}/.emacs.d" "${HOME}/.emacs.d.bak"
    [ -f "${HOME}/.emacs.el" ] && mv "${HOME}/.emacs.el" "${HOME}/.emacs.el.bak"
    [ -f "${HOME}/.emacs" ] && mv "${HOME}/.emacs" "${HOME}/.emacs.bak"
    

    or in PowerShell:

    if( Test-Path -Path "${HOME}/.emacs.d" )
    {
        Rename-Item "${HOME}/.emacs.d" "${HOME}/.emacs.d.bak"
    }
    if( Test-Path -Path "${HOME}/.emacs.el" )
    {
        Rename-Item "${HOME}/.emacs.el" "${HOME}/.emacs.el.bak"
    }
    if( Test-Path -Path "${HOME}/.emacs" )
    {
        Rename-Item "${HOME}/.emacs" "${HOME}/.emacs.bak"
    }
    
  3. Now clone this repository with Git. The following work for both shell and PowerShell:

    git clone https://github.com/syl20bnr/spacemacs "${HOME}/.emacs.d"
    

    In case you have a limited internet connection or limited speed:

    git clone --depth 1 https://github.com/syl20bnr/spacemacs ~/.emacs.d
    
  4. Now you can launch Emacs and Spacemacs will be loaded.

Alternative Install Location

To install Spacemacs in a different location, we first need to introduce how Spacemacs is loaded:

When Emacs is started, it looks for the init file in a deterministic way. The default installation exploits it by occupying "${HOME}/.emacs.d/init.el" and let Emacs use it as its init file.

In other word, in default installation, Emacs find and load "${HOME}/.emacs.d/init.el", which is then responsible to load other files in "${HOME}/.emacs.d".

If you want to install Spacemacs to a different location, you need to make sure it's loaded by Emacs in one of its init file.

For example, if you've cloned Spacemacs to "${HOME}/Spacemacs", and if you use "${HOME}/.emacs.el" as Emacs init file, then the following lines in "${HOME}/.emacs.el":

;; load Spacemacs's initialization file, "~" is equivalent to "${HOME}"
(load-file "~/Spacemacs/init.el")

First Launch and Configuration

  1. After cloning Spacemacs, the first time when you launch Emacs, Spacemacs will automatically install the essential packages it requires. This step is the bootstrap.

  2. Once the bootstrap packages are installed, Spacemacs checks whether you have an customization file "${HOME}/.spacemacs", known as dotspacemacs:

    • If it already exists, Spacemacs loads it as the configuration.
    • Otherwise, you need to answer a few questions and Spacemacs will generate the dotspacemacs file for you.

    If you are new to Emacs and/or Spacemacs, it's fine to just accept the default choices. They can be changed in the dotspacemacs file later.

  3. Spacemacs will download and install remaining packages it will require, according to your dotspacemacs. When the all the packages have been installed, restart Emacs to complete the installation.

  4. dotspacemacs is the configuration file for Spacemacs, it's self explanatory and is written in Emacs Lisp. Read general documentation and quick start guide for more information.

  5. In case you want to store your dotspacemacs at another location, say under "${HOME}/.spacemacs.d":

    • First set the environment variable SPACEMACSDIR to "${HOME}/.spacemacs.d".
    • Move "${HOME}/.spacemacs" to "${HOME}/.spacemacs.d/init.el".

    In other word, set SPACEMACSDIR to the parent directory of your dotspacemacs, and move dotspacemacs to the said directory.

For Linux users, create spacemacs.desktop in ~/.local/share/applications/ using this .desktop file as a reference. Change the Name parameter to Name=Spacemacs and the Icon parameter to Icon=/PATH/TO/EMACSD/core/banners/img/spacemacs.png where PATH/TO/EMACSD is the path to your .emacs.d directory, by default ~/.emacs.d.

For macOS users, you need to download the .icns version of the logo and simply change the logo on the Dock.

Notes

Update

Spacemacs relies solely on a rolling update scheme based on the latest changes available. To update Spacemacs, simply pull the latest changes from the develop branch:

  1. Close Emacs and update the git repository:

    git pull --rebase
    
  2. Restart Emacs to complete the upgrade.

After updating Spacemacs, you should also check if any updates are available for your packages. On the Spacemacs Home Buffer SPC b h, click (press RET) on the [Update Packages] button, or use the convenient keybinding SPC f e U

Upgrading from the deprecated master branch

If you are still on the old master branch (i.e., if git branch --show-current shows master instead of develop), you need to upgrade to develop first.

Quotes

Quote by ashnur:

«I feel that spacemacs is an aircraft carrier and I am playing table tennis
on the deck as a freerider.»

Quote by deuill:

«I LOVE SPACEMACS AND MAGIT

 That is all»

Contributions

Spacemacs is a community-driven project, it needs you to keep it up to date and to propose great and useful configurations for all the things!

Before contributing, be sure to consult the contribution guidelines and conventions.

Communities

Spacemacs Everywhere

Once you've learned the Spacemacs key bindings, you can use them in other IDEs/tools, thanks to the following projects:

License

The license is GPLv3 for all parts specific to Spacemacs, this includes:

For the packages shipped in this repository, you can refer to the files header.

Spacemacs logo by Nasser Alshammari released under a Creative Commons Attribution-ShareAlike 4.0 International License.

Supporting Spacemacs

The best way to support Spacemacs is to contribute to it either by reporting bugs, helping the community on the Gitter Chat or sending pull requests.

You can show your love for the project by getting cool Spacemacs t-shirts, mugs and more in the Spacemacs Shop.

If you want to show your support financially, then you can contribute to Bountysource, or buy a drink for the maintainer by clicking on the Paypal badge.

If you used Spacemacs in a project, and you want to show that fact, you can use the Spacemacs badge: Built with
Spacemacs

Thank you!

spacemacs (syl20bnr/spacemacs)

Searching Database…

24.5K ·GitHub
这是什么东西?一个由社区驱动的 Emacs 发行版:一套打磨过的、开箱即用的 Emacs 配置,注重人体工学、易记的快捷键和一致性。它目前仍处于 beta 阶段,欢迎参与贡献。
Spacemacs 是一个独立的编辑器,还是在 Emacs 之上的一套配置?不是一个单独的程序:你要先安装普通的 Emacs,然后 Spacemacs 会作为你 ~/.emacs.d 里的配置,把数百个现成可用的插件按配置层(layer)的方式组织起来。
怎么把它跑起来?安装 Emacs 28.2 或更新版本、git 和 GNU tar,备份已有的 ~/.emacs.d,把本仓库克隆到 ~/.emacs.d,然后启动 Emacs。首次运行时它会自动下载安装插件,问几个问题,并生成你的 dotspacemacs 配置文件。
在使用之前需要先安装什么?Emacs 28.2 或更新版本(不支持 XEmacs)、git,以及 GNU tar。可选:Source Code Pro 字体和系统的备用字体,还有一个搜索工具——强烈推荐用 ripgrep,而不是 ag、ack 或原生的 grep。
安装之前有什么坑需要知道的?它是滚动更新的 develop 分支上的 beta 软件。默认安装会替换 ~/.emacs.d,所以请先备份;安装插件时无法禁用 https;Windows 上可能需要对 ~/.emacs.d/server 做一次所有者修复。
我用 Vim,我同事用 Emacs——我们俩都能用吗?可以,这正是它的核心理念:它同时自带两种编辑风格,你可以在它们之间切换,甚至在同一个会话里混用,这也让结对编程更方便。新手直接用默认设置就行。
它在 Windows 上也能用吗,还是只有 Mac 和 Linux?Linux、macOS 和 Windows 都支持,README 里对每个系统都有各自的安装说明;不同系统之间只有备用字体不一样。
空格键是干什么用的?几乎所有的命令都挂在易记的 SPC 前缀下——SPC b 是缓冲区(buffer)相关命令,SPC p 是项目相关命令。按下空格键会弹出一个可交互的快捷键列表,按 SPC h SPC 则可以打开文档。
layer(配置层)到底是什么?一组按约定组织好的、开箱即用的插件,面向某种语言或某类任务。你在 dotspacemacs 里启用相应的层,Spacemacs 就会自动下载并安装它们所需的插件。
更新是怎么进行的?它是滚动更新的:关闭 Emacs,拉取最新的 develop 分支,然后重新启动。再通过首页缓冲区的 Update Packages 按钮或 SPC f e U 来更新插件。还在用旧的 master 分支的用户需要先迁移到 develop 分支。
在其他 IDE 里也能用这套快捷键吗?可以——一些配套项目把 Spacemacs 风格的快捷键带到了 IntelliJ(Intellimacs)、Eclipse(Spaceclipse)和 VS Code(VSpaceCode)上,而 SpaceVim 则把同样的社区驱动发行版理念应用到了 Vim 本身。
What are similar projects?neomacs, core, LunarVim, nyxt, LightTable, Vim, toast, kickstart.nvim
Creator
syl20bnr
Size
62.1 MB
Stars
24.5K
Age
13y
Commits · 90 Days