1
1

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.

.emacs.dをGitLabのprivate repositoryで管理

Last updated at Posted at 2018-08-04

はじめに

ライトなEmacsユーザーなので、ほとんどinit.elに何も書いてないんだけど、GitLabでプライベートリポジトリ作れるようになったし、gitで管理することにした。

Git

GitLabでリポジトリを作る

.から始まるprojectは作れなかった。

.gitignoreを作る

gitignore.ioってとこでEmacsって入力してコピペした。別に何もしなくても良い気もするけど。elpaフォルダは管理してなさそう。新しい環境ではpackage使ってinstallしたやつは入れ直したらいいんかな?

gitignore.io - Create Useful .gitignore Files For Your Project

gitでaddしてcommitしてpushする

こんな感じ。

git init
git remote add origin git@gitlab.com:xxx/emacs.d.git
git add .
git commit -m "Initial commit"
git push origin master

他のPCからgit clone

git clone git@gitlab.com:xxx/emacs.d.git .emacs.d

init.el

ほぼからっぽ。
C-hだけでもいいくらい。

init.el
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as des\
ired                                                                                   
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")\
) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa\
.org/packages/")) t)                                                                   
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib                               
    (add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/"\
)))))
(package-initialize)
; https://melpa.org/#/getting-started                                                  


(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
; https://dev.classmethod.jp/devenv/emacs-edit-yaml-cloudformation/                    

(define-key key-translation-map (kbd "C-h") (kbd "<DEL>"))
; https://qiita.com/takc923/items/e279f223dbb4040b1157                                 

;;; *.~ とかのバックアップファイルを作らない                                           
(setq make-backup-files nil)
;;; .#* とかのバックアップファイルを作らない                                           
(setq auto-save-default nil)
; https://qiita.com/emahiro/items/da60c24913998d857140  

おわりに

会社のメインPCのEmacsにはhelmとかmigemoとか入れてるけど、結局PC変わるとめんどくさい。普段開発で使ってるPCがラズパイ入れると5台以上あるからめんどくさい。しかも、仕事内容の関係上、ネットにつながってないPCで開発したりもする。入れなおすのもめんどくさいし、入れないとPC変わったときの違和感も大きくて、結局できるだけカスタマイズしない方がいいかもってなってる。gitで管理するようになって、また変わるかもしれんけど。でもやっぱ、会社やと情報管理の話とかproxyとかあるから、シンプルに行くのが楽かなぁ。

参考

Githubに.emacs.dを置く - Qiita

1
1
0

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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?