24
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spacemacs の設定 (初級者むけ)

Last updated at Posted at 2016-02-15

経緯

Windowsでのemacs設定が面倒になった.用途は主にpythonスクリプトやマークダウン,MATLABスクリプトの編集.emacs-jediやらMATLAB-modeやらを使うために設定した.Emacs習熟度は初心者を抜けて初級者ぐらいだと自負.

環境

  • Windows 10 Pro
  • NTEmacs
  • git (sourcetreeの奴)
  • Anaconda(python)

インストール

本家レポジトリhttps://github.com/syl20bnr/spacemacs) を読めば詰まることはないとおもう.

NTEmcsをインストールすると

C:\Users\hoge\AppData\Roaming\

に.emacs.dが出来たと思うのでそのディレクトリの代わりにspacemacsのレポジトリをcloneしてEmacsを起動するだけ.
特に詰まるところはなかった.vimmerか?vimmer用に設定しとこか?と聞かれるとこにNOと答えた事は覚えている.

設定

下記の参考記事を読んだが "Configuration Layer" なるものがよく理解出来なかったので全て .spcemacs に書いた(以前も設定は全てinit.elに書いてた).

C:\Users\rysk\AppData\Roaming\.spacemacs

なるファイルに色々書くだけでもちゃんと想定の動作をした.

パッケージ関連

.spacemacsを読むと,

   dotspacemacs-additional-packages
   '(
     )

なる行がある.MELPAなどにあるパッケージなら,

   dotspacemacs-additional-packages
   '(
     helm-ls-git
     epc
     jedi
     jedi-core
     rotate
     matlab-mode
     )

と書いて M-x sync-configuration-layer を実行すればインストールとロードが自動的に行われる.
あとspacemacsにはhelm他色々なパッケージがあらかじめ入っているので,気に入らないパッケージは下記のような部分にいれとけば多分loadされない.

   ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that
   dotspacemacs-excluded-packages '()

外見

フォントしか弄ってない

    dotspacemacs-default-font '("Ricty"
                               :size 19
                               :weight normal
                               :width normal
                               :powerline-scale 1.3)

その他

通常のinit.elに書くようなことは大体

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."

  ;; helm
  (global-set-key (kbd "C-;") 'helm-for-files)
  (global-set-key (kbd "C-x SPC") 'helm-M-x)
  (global-set-key (kbd "M-x") 'helm-M-x)
  (global-set-key (kbd "C-]") 'helm-ls-git-ls)
  (global-set-key (kbd "C-z") 'helm-show-kill-ring)

  ;; windmove
  (global-set-key (kbd "C-x w w") 'windmove-up)
  (global-set-key (kbd "C-x w s") 'windmove-down)
  (global-set-key (kbd "C-x w d") 'windmove-right)
  (global-set-key (kbd "C-x w a") 'windmove-left)
  (global-set-key (kbd "M-[") 'rotate-layout)

  ;;jedi
  (add-hook 'python-mode-hook 'jedi:setup)

  ;; 

  )

こんな感じで書いたら動いた.

感想

  • helm とか大抵の定番が最初から入ってて楽
  • 見た目もなかなか
  • windowsでも問題なし
  • そんなに重くもない
  • (Vimmerは使わないんじゃないかな…)

参考記事

24
23
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
23

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?