EMACS简单使用

Table of Contents

1 emacs的安装

1.1 emacs组成

1.1.1 emacs安装包和依赖库

emacs的安装包地址 emacs的依赖库

1.2 64位emacs安装

1.2.1 安装emacs

1.2.2 安装依赖

1.2.3 emacs的安装

配置字体生成.emacs文件和.emacs.d目录 配置等宽字体

2 emacs插件安装方式

2.1 指令安装

设置源

(setq package-archives '(("gnu"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
                         ("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(package-initialize) ;; You might already have this line

2.2 菜单方式安装

3 spacemacs安装

3.1 spacemacs安装

3.1.1 设置清华源

(defun dotspacemacs/user-init ()
(setq configuration-layer--elpa-archives
    '(("melpa-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
      ("org-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/")
      ("gnu-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
  )

3.1.2 设置全屏

3.1.3 设置logo

3.1.4 设置neotree和编码字体

(setq projectile-switch-project-action 'neotree-projectile-action)
(setq neo-show-hidden-files nil)
(setq neo-smart-open t)
(global-set-key [f2] 'neotree-toggle)
(set-language-environment "UTF-8")

3.1.5 指定安装包

(defun dotspacemacs/layers ()
  (setq-default
   dotspacemacs-additional-packages '(yasnippet)))

4 golang开发环境安装

4.1 安装golang的支持

4.2 安装自动代码补全

4.3 安装HTML、javascript支持

4.4 环境变量设置

4.4.1 设置系统变量

HOME

4.4.2 golang添加第三方支持

直接执行

go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-find-references
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v github.com/derekparker/delve/cmd/dlv
go get -u -v github.com/alecthomas/gometalinter
go get -u -v github.com/zmb3/gogetdoc
go get -u -v github.com/lukehoban/go-outline
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/cweill/gotests/...
go get -u -v github.com/fatih/gomodifytags
go get -u -v github.com/monochromegane/the_platinum_searcher/...

下载库执行

go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/cmd/guru
go get golang.org/x/tools/cmd/goimports
go get golang.org/x/tools/cmd/godoc
go get github.com/nsf/gocode
go get github.com/rogpeppe/godef
go get github.com/golang/lint/golint
go get github.com/lukehoban/go-find-references
go get sourcegraph.com/sqs/goreturns
go get github.com/derekparker/delve/cmd/dlv
go get github.com/alecthomas/gometalinter
go get github.com/zmb3/gogetdoc
go get github.com/lukehoban/go-outline
go get github.com/tpng/gopkgs
go get github.com/acroca/go-symbols
go get github.com/cweill/gotests/...
go get github.com/fatih/gomodifytags
go get github.com/monochromegane/the_platinum_searcher/...
gocode set propose-builtins true 
gometalinter --install --update

gocode的propose-builtins(默认为false,不会自动联想go语言内置的类型、常量和方法等)

(setq gofmt-command "goimports")

4.4.3 分设gopath

4.4.4 显示菜单

M+x menu

4.4.5 快速查找指令

M+x

5 拆包即用golang开发环境

Created: 2017-05-09 二 11:12

Validate