Skip to content

Instantly share code, notes, and snippets.

@nobusugi246
Created April 7, 2019 08:23
Show Gist options
  • Save nobusugi246/9ba50e85ddf8f355b338f44ee0888d4c to your computer and use it in GitHub Desktop.
Save nobusugi246/9ba50e85ddf8f355b338f44ee0888d4c to your computer and use it in GitHub Desktop.
emacs init.el
(require 'cl)
(global-linum-mode t)
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
;; 環境を日本語、UTF-8にする
(set-locale-environment nil)
(set-language-environment "Japanese")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(prefer-coding-system 'utf-8)
;; スタートアップメッセージを表示させない
(setq inhibit-startup-message t)
;; バックアップファイルを作成させない
(setq make-backup-files nil)
;; 終了時にオートセーブファイルを削除する
(setq delete-auto-save-files t)
;; タブにスペースを使用する
(setq-default tab-width 4 indent-tabs-mode nil)
(setq default-tab-width 4)
;; 改行コードを表示する
(setq eol-mnemonic-dos "(CRLF)")
(setq eol-mnemonic-mac "(CR)")
(setq eol-mnemonic-unix "(LF)")
;; 複数ウィンドウを禁止する
(setq ns-pop-up-frames nil)
;; ウィンドウを透明にする
;; アクティブウィンドウ/非アクティブウィンドウ(alphaの値で透明度を指定)
(add-to-list 'default-frame-alist '(alpha . (0.85 0.85)))
;; メニューバーを消す
;;(menu-bar-mode t)
;; ツールバーを消す
(tool-bar-mode -1)
;; 列数を表示する
(column-number-mode t)
;; 行数を表示する
(global-linum-mode t)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote
(kotlin-mode markdown-mode yaml-mode ddskk direx direx-grep helm powershell neotree multiple-cursors gradle-mode groovy-mode python-mode abyss-theme alect-themes ample-theme ample-zen-theme arjen-grey-theme atom-dark-theme atom-one-dark-theme badger-theme calmer-forest-theme cyberpunk-theme dark-krystal-theme dark-mint-theme darkmine-theme distinguished-theme doom-themes exotica-theme flatui-dark-theme))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(when (and (eq system-type 'darwin) (eq window-system 'ns))
(setq ns-command-modifier (quote meta))
(setq ns-alternate-modifier (quote super)))
(define-key key-translation-map (kbd "C-h") (kbd "<DEL>"))
(define-key key-translation-map (kbd "M-h") (kbd "<C-backspace>"))
(define-key key-translation-map (kbd "C-?") (kbd "C-h"))
(define-key key-translation-map (kbd "M-?") (kbd "M-h"))
(load-theme 'cyberpunk t)
(set-frame-size (selected-frame) 80 63)
(set-frame-position (selected-frame) 0 0)
;; multi cursor
(require 'multiple-cursors)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
(defun dired-open ()
(interactive)
(let ((file (dired-get-filename)))
(unless (file-directory-p file)
(start-process "open" "open" "open" file))))
(add-hook 'dired-mode-hook
(lambda ()
(define-key dired-mode-map
"z" 'dired-open)))
;; do sync
(defun dosync ()
(interactive)
(shell-command-to-string "sync"))
(global-set-key "\C-x\C-x" 'dosync)
;; some funcs
(defun 80-frame-width () (interactive) (set-frame-width (selected-frame) 80))
(defun 100-frame-width() (interactive) (set-frame-width (selected-frame) 100))
(defun 120-frame-width() (interactive) (set-frame-width (selected-frame) 120))
(defun 140-frame-width() (interactive) (set-frame-width (selected-frame) 140))
(defun 160-frame-width() (interactive) (set-frame-width (selected-frame) 160))
(defun 180-frame-width() (interactive) (set-frame-width (selected-frame) 180))
(defun 200-frame-width() (interactive) (set-frame-width (selected-frame) 200))
(defun 220-frame-width() (interactive) (set-frame-width (selected-frame) 220))
(defun set-frames (file1 file2)
(interactive)
(set-frame-width (selected-frame) 200)
(split-window-right)
(other-window 1)
(find-file file2)
(split-window-below)
(find-file file1)
(enlarge-window -7)
(other-window 2)
(enlarge-window-horizontally -17)
)
(defun reset-frames ()
(interactive)
(delete-other-windows)
(set-frame-width (selected-frame) 80)
)
(defun set-top-frame (file)
(interactive)
(split-window)
(find-file file)
(enlarge-window -7)
)
(defun set-bottom-frame (file)
(interactive)
(split-window-below)
(other-window 1)
(find-file file)
(enlarge-window -7)
)
(defun open (file)
"open command"
(interactive)
(shell-command-to-string (concat "open " file))
)
(setq compile-command "./gradlew build")
(require 'direx)
(require 'direx-grep)
(global-set-key (kbd "C-x C-j") 'direx:find-directory)
(quickrun-add-command "pwsh"
'((:command . "pwsh")
(:exec . "%c %s"))
:mode 'powershell-mode)
(require 'skk)
(global-set-key "\C-h" 'delete-backward-char)
(global-set-key "\e[3~" 'delete-char)
(global-set-key "\C-x\C-p" 'eval-print-last-sexp)
(global-set-key "\C-x\C-n" 'indent-region)
(global-set-key "\C-c\C-q" 'comment-region)
;;(global-set-key "\C-cr" 'coffee-compile-region)
(global-set-key (kbd "C-o") 'toggle-truncate-lines)
(global-set-key (kbd "C-x C-j") 'skk-mode)
(global-set-key "\C-xj" 'skk-auto-fill-mode)
(setq skk-use-azik t)
(setq skk-sticky-key "'")
(setq skk-dcomp-activate t)
(setq skk-dcomp-multiple-activate t)
(find-file "~/org/AWS.org")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment