-
Notifications
You must be signed in to change notification settings - Fork 1
/
extra.el
65 lines (56 loc) · 1.64 KB
/
extra.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;; Markdown
(use-package markdown-mode
:ensure t
:defer t
:commands
(markdown-mode gfm-mode)
:mode
("\\.md\\'" . gfm-mode)
("\\.markdown\\'" . gfm-mode))
;; browse-url
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "google-chrome-stable")
(when (eq system-type 'windows-nt)
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "c:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe"))
(global-set-key (kbd "C-c C-c C-p") 'browse-url-of-file)
;; YAML
(use-package yaml-mode
:ensure t
:defer t
:mode
("\\.yml\\'" . yaml-mode))
(add-hook 'yaml-mode-hook
(lambda ()
(and (string= (file-name-base) "vault") (ansible-vault-mode 1))))
;; CSS
(setq css-indent-offset 2)
;; dumb-jump: 関数宣言まで移動
(use-package dumb-jump
:defer t
:bind
([(super b)] . dumb-jump-go)
([(super shift b)] . dumb-jump-back)
:config
(setq dumb-jump-mode t
dumb-jump-selector 'ivy
dumb-jump-use-visible-window nil))
;; Ivy
(use-package ivy
:ensure t
:diminish ivy-mode
:config
(ivy-mode 1))
;; LaTeX
(defun pd ()
(interactive)
(save-buffer)
(let ((filename (buffer-file-name (window-buffer (minibuffer-selected-window)))))
(message (shell-command-to-string (concat "uplatex " filename " && dvipdfmx $(echo " filename " | sed -e s/\.tex$/.dvi/)")))))
(defun png2xbb ()
(interactive)
(message (shell-command-to-string (concat "find ./png/ -type f -regextype posix-basic -regex '.*.\\(png\\|jpg\\)' -exec extractbb {} \\;"))))
;; デーモンを起動
(require 'server)
(unless (server-running-p)
(server-start))