emacs使用指南 -- spacemacs模板
Emacs spacemacs模板使用
spacemacs安装,从github上下载spacemacs项目至emacs的配置文件
emacs.d
中$ git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
配置spacemacs
- 简单的配置只需要在
~/.spacemacs
中配置 - 如果需要自定义layer,则可以建立
~/.spacemacs.d
文件夹,然后在文件夹中进行配置(需要删除.spacemacs
文件) - 自定义layer可以运行
M-x Configuration-layer/create-layer
建立自定义layer
- 简单的配置只需要在
安装Package
本身spacemace自带的layer直接在配置文件
dotspacemacs-configuration-layers
中添加1
2
3
4
5
6从github添加package
(hexo :location (recipe
:repo "kuanyui/hexo.el"
:fetcher github
:files ("hexo.el")))
需要额外在MELPA安装的Package只需要在
dotspacemacs-additional-packages
中添加本地Package安装可以添加配置(或者自定义layer)
1
2(add-to-list 'load-path "~/.spacemacs.d/layers/hexo/local/hexo")
(require 'hexo)PS:local本地添加Package似乎有问题,看了issue如果在自定义layer添加本地Package的话必须自己
update-file-autoloads
magit教程
首先在git管理的文件夹中进入Magit模式
`SPC g s `或者命令行`magit-status`
提交改动文件显示Unstaged的文件,表示需要进行
git add
可以通过两种方式1. 在unstage文件夹上按`S`键 2. 命令行 `M-x magit-add`
commit文件
1. 在magit模式下可以通过`c c`或者命令行`magit-commit`进行git commit 2. 在添加commit以后,通过`C-c C-c `进行提交
Push文件至仓库
在magit模式下通过命令行`magit-push`或者`P p`进行push操作
一些常用的快捷键
`M+;` : 对本行或者选中区域注释或者取消注释