/
init-packages.el
125 lines (98 loc) · 3.11 KB
/
init-packages.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
;;; init-packages.el --- Install and config packages.
;;; Commentary:
;;; init-packages.el
;;; Code:
(use-package restart-emacs)
(use-package drag-stuff
:bind (("<M-up>". drag-stuff-up)
("<M-down>" . drag-stuff-down)))
;; To move drag
(use-package hungry-delete
:bind (("C-c DEL" . hungry-delete-backward) ; Not the `delete` menu on the keyborad!
("C-c d" . hungry-delete-forward)))
(use-package crux
:bind ("C-c k" . crux-smart-kill-line))
(use-package ivy
:defer 1
:demand
:hook (after-init . ivy-mode)
:config
(ivy-mode 1)
(setq ivy-use-virtual-buffers t
ivy-initial-inputs-alist nil
ivy-count-format "%d/%d "
enable-recursive-minibuffers t
ivy-re-builders-alist '((t . ivy--regex-ignore-order))))
(use-package counsel
:after (ivy)
:bind (("M-x" . counsel-M-x)
("C-x C-f" . counsel-find-file)
("C-c f" . counsel-recentf)
("C-c g" . counsel-git)))
(use-package swiper
:after ivy
:bind (("C-s" . swiper)
("C-r" . swiper-isearch-backward))
:config (setq swiper-action-recenter t
swiper-include-line-number-in-search t))
;; They require the ivy..
;; Complete plugin: company
(use-package company
:config
(setq company-dabbrev-code-everywhere t
company-dabbrev-code-modes t
company-dabbrev-code-other-buffers 'all
company-dabbrev-downcase nil
company-dabbrev-ignore-case t
company-dabbrev-other-buffers 'all
company-require-match nil
company-minimum-prefix-length 2
company-show-numbers t
company-tooltip-limit 20
company-idle-delay 0
company-echo-delay 0
company-tooltip-offset-display 'scrollbar
company-begin-commands '(self-insert-command))
(push '(company-semantic :with company-yasnippet) company-backends)
:hook ((after-init . global-company-mode)))
;; optimization some operations..
(use-package crux
:bind (("C-a" . crux-move-beginning-of-line)
("C-c ^" . crux-top-join-line)
("C-x ," . crux-find-user-init-file)
("C-c k" . crux-smart-kill-line)))
(use-package which-key
:defer nil
:config (which-key-mode))
;; the syntax check plugin
(use-package flycheck
:hook (after-init . global-flycheck-mode))
(use-package ace-window
:bind (("M-o" . 'ace-window)))
(use-package rainbow-delimiters
:diminish
:hook (prog-mode . rainbow-delimiters-mode))
(use-package highlight-parentheses
:diminish
:hook (prog-mode . highlight-parentheses-mode))
(use-package magit)
;; Automatic parenthesis pairing
(use-package elec-pair
:ensure nil
:hook (after-init . electric-pair-mode)
:init (setq electric-pair-inhibit-predicate 'electric-pair-conservative-inhibit))
;; Google translate.
(use-package go-translate
:config (setq go-translate-base-url "https://translate.google.cn"
go-translate-local-language "zh-CN" ))
;; hignlighting for current line.
(use-package beacon
:unless *is-windows*
:hook (after-init . beacon-mode))
;; this must be in here
(provide 'init-packages)
;; Local Variables:
;; coding: utf-8
;; no-byte-compile: t
;; End:
;;; init-packages.el ends here