2020-08-30 14:42:47 +02:00
|
|
|
;Packages
|
2020-08-29 14:43:11 +02:00
|
|
|
|
|
|
|
;; package archives
|
|
|
|
(require 'package)
|
|
|
|
(setq package-enable-at-startup nil)
|
|
|
|
(setq package-archives
|
|
|
|
'(
|
|
|
|
("ELPA" . "http://tromey.com/elpa/")
|
|
|
|
("gnu" . "http://elpa.gnu.org/packages/")
|
|
|
|
("melpa" . "https://melpa.org/packages/")
|
|
|
|
("ORG" . "https://orgmode.org/elpa/")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(package-initialize)
|
2020-12-14 08:39:02 +01:00
|
|
|
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
|
|
|
|
|
2020-12-16 10:08:49 +01:00
|
|
|
;; Remove welcome screen
|
2020-12-17 11:38:25 +01:00
|
|
|
(setq inhibit-startup-screen t)
|
2020-12-16 10:08:49 +01:00
|
|
|
|
|
|
|
;; Disable menu
|
|
|
|
(menu-bar-mode 0)
|
|
|
|
|
|
|
|
;; Enable IDO mode
|
|
|
|
(ido-mode 1)
|
2020-12-16 22:20:42 +01:00
|
|
|
(global-set-key (kbd "C-x b") 'ido-switch-buffer)
|
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
;; Remove working cl
|
|
|
|
(require 'cl-lib)
|
|
|
|
(setq byte-compile-warnings '(cl-functions))
|
|
|
|
|
2020-08-29 14:43:11 +02:00
|
|
|
;; install use-package
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
(package-refresh-contents)
|
|
|
|
(package-install 'use-package)
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Set path to store "custom-set"
|
|
|
|
(setq custom-file "~/.emacs.d/emacs-custom.el")
|
|
|
|
|
|
|
|
;; Enable awesome-tab-mode
|
|
|
|
(add-to-list 'load-path (expand-file-name "~/.emacs.d/plugins"))
|
|
|
|
(require 'awesome-tab)
|
|
|
|
(awesome-tab-mode t)
|
|
|
|
|
|
|
|
(use-package awesome-tab
|
|
|
|
:load-path "~/.emacs.d/plugins"
|
|
|
|
:config
|
|
|
|
(awesome-tab-mode t))
|
|
|
|
(awesome-tab-mode t)
|
|
|
|
|
2020-08-29 16:40:44 +02:00
|
|
|
(global-set-key (kbd "C-x j") 'awesome-tab-backward-tab)
|
|
|
|
(global-set-key (kbd "C-x k") 'awesome-tab-forward-tab)
|
2020-08-29 15:19:31 +02:00
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
;; 80-charaters mode
|
2020-08-30 14:42:47 +02:00
|
|
|
(add-hook 'text-mode-hook 'auto-fill-mode)
|
|
|
|
(setq-default fill-column 80)
|
|
|
|
|
|
|
|
(add-hook 'org-mode-hook '(lambda () (setq fill-column 80)))
|
|
|
|
(add-hook 'org-mode-hook 'auto-fill-mode)
|
2020-12-12 22:23:14 +01:00
|
|
|
(add-hook 'org-mode-hook 'turn-on-flyspell)
|
2020-08-30 14:42:47 +02:00
|
|
|
|
2020-09-01 11:39:56 +02:00
|
|
|
;; Broswer
|
|
|
|
(setq browse-url-browser-function 'browse-url-generic
|
|
|
|
browse-url-generic-program "browser-x")
|
|
|
|
|
2020-08-29 19:32:39 +02:00
|
|
|
;; Switch-window
|
|
|
|
(use-package switch-window
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(setq
|
|
|
|
switch-window-increase 4
|
|
|
|
switch-window-input-style 'minibuffer
|
|
|
|
switch-window-shortcut-style 'qwerty
|
|
|
|
switch-window-threshold 2
|
|
|
|
)
|
|
|
|
(setq
|
|
|
|
switch-window-qwerty-shortcuts
|
|
|
|
'( "a" "s" "d" "f" "g" "h" "j" "k" "l")
|
|
|
|
)
|
|
|
|
:bind
|
|
|
|
([remap other-window] . switch-window)
|
|
|
|
)
|
|
|
|
|
2020-09-16 23:18:00 +02:00
|
|
|
;; Enable japanese
|
2020-12-14 12:33:50 +01:00
|
|
|
(if (condition-case nil (require 'mozc)(error nil))
|
|
|
|
(setq ecb-be-more-like-better-yes-p t)
|
|
|
|
(message "Monz not available; not configuring") )
|
|
|
|
;(require 'mozc)
|
2020-09-16 23:18:00 +02:00
|
|
|
(setq default-input-method "japanese-mozc")
|
|
|
|
|
2020-12-17 00:15:03 +01:00
|
|
|
;; Enable Smex
|
|
|
|
(use-package smex
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(smex-initialize)
|
|
|
|
:bind
|
|
|
|
("M-x" . smex)
|
|
|
|
)
|
|
|
|
|
2020-08-29 19:32:39 +02:00
|
|
|
;; reveal dependency
|
|
|
|
(use-package htmlize
|
|
|
|
:ensure t
|
|
|
|
)
|
|
|
|
(use-package ox-reveal
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
;; maybe add auto-installer in the future
|
|
|
|
(setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js")
|
|
|
|
)
|
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
;; moveline
|
|
|
|
(use-package move-text
|
|
|
|
:ensure t
|
|
|
|
:config)
|
2020-09-01 11:39:56 +02:00
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
(global-set-key (kbd "M-<up>") 'move-text-up)
|
|
|
|
(global-set-key (kbd "M-<down>") 'move-text-down)
|
2020-12-12 22:23:14 +01:00
|
|
|
|
2020-12-18 23:02:09 +01:00
|
|
|
;; company
|
2020-12-18 16:46:24 +01:00
|
|
|
(use-package company
|
2020-09-02 09:14:30 +02:00
|
|
|
:ensure t
|
|
|
|
)
|
2020-12-18 16:46:24 +01:00
|
|
|
|
|
|
|
(require 'company)
|
|
|
|
(global-company-mode)
|
2020-12-17 00:15:03 +01:00
|
|
|
|
|
|
|
;; Shell
|
|
|
|
(add-hook 'sh-mode-hook 'company-mode)
|
2020-09-02 09:14:30 +02:00
|
|
|
|
2020-12-14 08:39:02 +01:00
|
|
|
|
2020-12-16 22:20:42 +01:00
|
|
|
;; Latex
|
2020-12-16 10:08:49 +01:00
|
|
|
;(eval-after-load 'company
|
|
|
|
; '(push 'company-robe company-backends))
|
2020-12-12 17:56:13 +01:00
|
|
|
|
|
|
|
;; Ruby
|
2020-12-17 00:15:03 +01:00
|
|
|
;(eval-after-load 'auto-complete
|
|
|
|
; '(add-to-list 'ac-modes 'inf-ruby-mode))
|
|
|
|
;(add-hook 'inf-ruby-mode-hook 'ac-inf-ruby-enable)
|
|
|
|
;(eval-after-load 'inf-ruby '
|
|
|
|
; '(define-key inf-ruby-mode-map (kbd "TAB") 'auto-complete))
|
2020-12-12 17:56:13 +01:00
|
|
|
|
2020-08-29 14:43:11 +02:00
|
|
|
;; Theme
|
2020-12-18 16:46:24 +01:00
|
|
|
(use-package dracula-theme
|
2020-08-29 14:43:11 +02:00
|
|
|
:ensure t
|
|
|
|
:config
|
2020-12-18 16:46:24 +01:00
|
|
|
(load-theme 'dracula t))
|
2020-08-29 14:43:11 +02:00
|
|
|
|
2020-08-31 15:07:30 +02:00
|
|
|
;; Sitebar dirred
|
|
|
|
(use-package dired-sidebar
|
|
|
|
:ensure t
|
|
|
|
:commands (dired-sidebar-toggle-sidebar))
|
|
|
|
|
|
|
|
(require 'dired-sidebar)
|
2020-12-16 10:08:49 +01:00
|
|
|
(global-set-key (kbd "C-x d") 'dired-sidebar-toggle-sidebar)
|
2020-08-31 15:07:30 +02:00
|
|
|
|
2020-08-29 14:43:11 +02:00
|
|
|
;; Magit
|
|
|
|
(use-package magit
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
2020-12-18 15:42:27 +01:00
|
|
|
(global-set-key (kbd "C-x g") 'magit-status)
|
2020-08-29 14:43:11 +02:00
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
;; ruby sorce code
|
|
|
|
(use-package flymake-ruby
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
|
|
|
|
|
|
|
(use-package flymake-easy
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
|
|
|
|
2020-12-18 23:02:09 +01:00
|
|
|
;;robe
|
|
|
|
(use-package robe
|
2020-12-18 16:46:24 +01:00
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
|
|
|
|
2020-12-12 17:56:13 +01:00
|
|
|
;; Error list
|
|
|
|
(define-key flymake-mode-map (kbd "M-n") 'flymake-goto-next-error)
|
|
|
|
(define-key flymake-mode-map (kbd "M-p") 'flymake-goto-prev-error)
|
|
|
|
|
2020-12-12 22:23:14 +01:00
|
|
|
;; Ruby
|
2020-12-12 17:56:13 +01:00
|
|
|
(require 'robe)
|
|
|
|
(add-hook 'ruby-mode-hook 'robe-mode)
|
|
|
|
(add-hook 'robe-mode-hook 'ac-robe-setup)
|
|
|
|
|
|
|
|
(require 'flymake-ruby)
|
|
|
|
(add-hook 'ruby-mode-hook 'flymake-ruby-load)
|
|
|
|
|
2020-12-12 22:23:14 +01:00
|
|
|
;; Docker
|
|
|
|
(use-package dockerfile-mode
|
2020-12-13 13:56:27 +01:00
|
|
|
:ensure t
|
|
|
|
:defer t)
|
2020-12-12 22:23:14 +01:00
|
|
|
|
|
|
|
;; YAML
|
2020-12-18 15:42:27 +01:00
|
|
|
(use-package flymake-yaml
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
|
|
|
|
2020-12-12 22:23:14 +01:00
|
|
|
(use-package yaml-mode
|
2020-12-13 13:56:27 +01:00
|
|
|
:ensure t
|
2020-12-18 15:45:30 +01:00
|
|
|
:config
|
2020-12-18 16:46:24 +01:00
|
|
|
)
|
2020-12-17 00:15:03 +01:00
|
|
|
|
2020-08-29 15:19:31 +02:00
|
|
|
;; Markdown-mode
|
|
|
|
(use-package markdown-mode
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
)
|
|
|
|
|
|
|
|
;; Livedown
|
|
|
|
;;; sudo npm install -g livedown
|
|
|
|
;;; (add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-livedown"))
|
2020-08-29 14:43:11 +02:00
|
|
|
(require 'livedown)
|
|
|
|
|
|
|
|
(custom-set-variables
|
|
|
|
'(livedown-autostart nil) ; automatically open preview when opening markdown files
|
|
|
|
'(livedown-open t) ; automatically open the browser window
|
|
|
|
'(livedown-port 1337) ; port for livedown server
|
|
|
|
'(livedown-browser nil)) ; browser to use
|
|
|
|
(global-set-key (kbd "C-M-m") 'livedown-preview)
|
|
|
|
|
|
|
|
;;; --- Look & Feel ---
|
|
|
|
|
2020-12-12 22:23:14 +01:00
|
|
|
;; Zoom in/out.
|
|
|
|
(global-set-key (kbd "M-+") 'text-scale-increase)
|
|
|
|
(global-set-key (kbd "M--") 'text-scale-decrease)
|
|
|
|
|
2020-08-29 14:43:11 +02:00
|
|
|
;; no toolbar:
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
|
|
|
;; line numbers:
|
|
|
|
(global-display-line-numbers-mode 1)
|
|
|
|
|
|
|
|
;; scrolling:
|
|
|
|
(setq scroll-conservatively 100)
|
|
|
|
|
2020-12-14 08:39:02 +01:00
|
|
|
;; Whitespaces
|
|
|
|
(global-whitespace-mode 1)
|
2020-12-14 10:03:25 +01:00
|
|
|
(setq whitespace-display-mappings '((space-mark 32 [?·])))
|
|
|
|
(set-face-attribute 'whitespace-space nil :background nil :foreground "gray30")
|
2020-12-14 12:32:11 +01:00
|
|
|
(setq whitespace-style (quote (face tabs spaces trailing space-before-tab newline indentation empty space-after-tab space-mark tab-mark)))
|
|
|
|
(add-hook 'before-save-hook (lambda () (delete-trailing-whitespace)))
|
2020-12-14 08:39:02 +01:00
|
|
|
|
2020-08-29 14:43:11 +02:00
|
|
|
;; no "bell" (audible notification):
|
|
|
|
(setq ring-bell-function 'ignore)
|
|
|
|
|
|
|
|
;; highlight:
|
2020-12-12 17:56:13 +01:00
|
|
|
;(global-hl-line-mode 1)
|
2020-08-29 14:43:11 +02:00
|
|
|
|
|
|
|
;; auto reloading (reverting) buffers
|
|
|
|
(global-auto-revert-mode 1)
|
|
|
|
|
|
|
|
;; disable lock files:
|
|
|
|
(setq create-lockfiles nil)
|
|
|
|
|
|
|
|
;; disable autosave:
|
|
|
|
(setq auto-save-default nil)
|
|
|
|
|
|
|
|
;; disable backups:
|
|
|
|
(setq make-backup-files nil)
|
|
|
|
|
|
|
|
;; Pass "y or n" instead of "yes or no"
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
|
|
|
;; Highlight parens
|
|
|
|
(show-paren-mode 1)
|
|
|
|
|
|
|
|
;; Candy
|
|
|
|
(global-prettify-symbols-mode 1)
|
|
|
|
|
|
|
|
;; Modeline
|
|
|
|
(column-number-mode 1)
|
|
|
|
(size-indication-mode 1)
|
|
|
|
|
|
|
|
;; Horizontal splitting
|
|
|
|
(defun split-and-follow-horizontally ()
|
|
|
|
(interactive)
|
|
|
|
(split-window-below)
|
|
|
|
(balance-windows)
|
|
|
|
(other-window 1)
|
|
|
|
)
|
|
|
|
(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally)
|
|
|
|
|
|
|
|
;; Vertical splitting
|
|
|
|
(defun split-and-follow-vertically ()
|
|
|
|
(interactive)
|
|
|
|
(split-window-right)
|
|
|
|
(balance-windows)
|
|
|
|
(other-window 1)
|
|
|
|
)
|
|
|
|
(global-set-key (kbd "C-x 3") 'split-and-follow-vertically)
|
|
|
|
|
|
|
|
;; Kill & remove split
|
|
|
|
(defun kill-and-remove-split ()
|
|
|
|
"Kill and remove split."
|
|
|
|
(interactive)
|
|
|
|
(kill-buffer)
|
|
|
|
(delete-window)
|
|
|
|
(balance-windows)
|
|
|
|
(other-window 1)
|
|
|
|
)
|
|
|
|
(global-set-key (kbd "C-x x") 'kill-and-remove-split)
|