-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathediting.el
88 lines (69 loc) · 2.39 KB
/
editing.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;;; editing.el --- Editing
;;; Commentary:
;; Editor customizations
;;; Code:
(require 'saveplace)
(defun toggle-comment-on-line-or-region ()
"Comment or uncomment current line, or region if selected."
(interactive "*")
(if (use-region-p)
(comment-or-uncomment-region (region-beginning) (region-end))
(comment-or-uncomment-region (line-beginning-position) (line-end-position))))
(defun setup-editing ()
"Setup editing."
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
(show-paren-mode 1)
(global-hl-line-mode 1)
(setq company-tooltip-align-annotations t)
;; auto complete with docstrings
(company-quickhelp-mode)
(set-default 'truncate-lines t)
(editorconfig-mode 1)
;; Replace highlighted text when you type
(delete-selection-mode 1))
(use-package multiple-cursors
:bind (("C-S-c C-S-c" . 'mc/edit-lines)
("C->" . 'mc/mark-next-like-this)
("C-<" . 'mc/mark-previous-like-this)
("C-c C-<" . 'mc/mark-all-like-this)))
(use-package emacs
:init
(setq-default indent-tabs-mode nil)
(setq-default save-place t)
(setq save-place-file (concat user-emacs-directory "places"))
(setq backup-directory-alist `(("." . ,(concat user-emacs-directory
"backups"))))
(setq auto-save-default nil)
(setq electric-indent-mode nil)
;; enable special chars in the editor, like ~ and ^.
(load-library "iso-transl")
(emojify-set-emoji-styles '(unicode))
:bind (("C-;" . 'toggle-comment-on-line-or-region)
("M-/" . 'hippie-expand)
("C-s" . 'isearch-forward-regexp)
("C-r" . 'isearch-backward-regexp)
("C-M-s" . 'isearch-forward)
("C-M-r" . 'isearch-backward)
([(control shift up)] . 'move-text-up)
([(control shift down)] . 'move-text-down)))
;; syntax checking
(use-package flycheck
:ensure t
:init (global-flycheck-mode)
:hook (add-node-modules-path))
(use-package company
:ensure t
:config
(setq company-idle-delay 0.1
company-minimum-prefix-length 1))
;; auto complete
(add-hook 'after-init-hook 'global-company-mode)
(add-hook 'after-init-hook 'setup-editing)
(add-hook 'after-init-hook #'global-emojify-mode)
(provide 'editing)
;;; editing.el ends here