-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhelm-common_init.el
80 lines (67 loc) · 2.95 KB
/
helm-common_init.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
(require 'helm-autoloads)
(require 'helm-files)
(require 'helm-buffers)
(require 'helm-fd)
(if (boundp 'boring-buffer-regexp-list)
(add-list-to-list 'helm-boring-buffer-regexp-list boring-buffer-regexp-list))
(if (boundp 'boring-file-regexp-list)
(add-list-to-list 'helm-boring-file-regexp-list boring-file-regexp-list))
(setq
helm-candidate-number-limit 25
helm-buffer-max-length 50 ;; buffer 的名称长一点,否则看不到完整名字。
;; 似乎我的 (window-width) 值是 93, 这里设定小于 93, C-c o 将会在右侧 split.
;; (setq-default split-width-threshold 30)
split-height-threshold nil
helm-recentf-fuzzy-match t
helm-ff-skip-boring-files t
helm-ff-guess-ffap-filenames t
helm-ff-file-name-history-use-recentf t
helm-ff-auto-update-initial-value t
helm-window-prefer-horizontal-split t
;; 必须开启 follow 模式, 才能有跟随 buffer 的 follow 效果.
helm-follow-mode-persistent t
helm-grep-save-buffer-name-no-confirm t
helm-move-to-line-cycle-in-source nil ;; 允许在多个 source 里面移动
)
;; 让 helm 弹出的窗口, 总在最下面, 当开启 follow-mode 时, 这个和 neotree 不工作.
(setq helm-always-two-windows nil) ;; this is default
(setq-default helm-display-buffer-default-height (* (frame-height) 0.618))
(setq helm-default-display-buffer-functions '(display-buffer-in-side-window))
;; change order to show recentf first.
;; (setq helm-mini-default-sources
;; '(
;; helm-source-recentf
;; helm-source-buffers-list
;; helm-source-buffer-not-found))
;; FIXME: 这个是干嘛的? 先关掉
;; (add-to-list 'helm-buffers-favorite-modes 'ruby-mode)
;; (add-to-list 'helm-buffers-favorite-modes 'enh-ruby-mode)
;; FIXME: 这里没有用 remap, 因为要改写 ido-find-file 的 hack.
(define-key global-map [(control x) (control f)] 'helm-find-files)
;; list-buffers C-x C-b switch-to-buffer C-x b
(global-set-key [(control x) (f)] 'helm-recentf)
(global-set-key [(control x) (b)] 'helm-buffers-list)
(global-set-key [(control x) (control b)] 'helm-mini)
(global-set-key [(control x) (control n)] 'helm-mini)
(global-set-key [(control x) (control p)] 'helm-resume)
;; (define-key global-map [remap dabbrev-expand] 'helm-dabbrev)
(add-hook 'helm-mode-hook
(lambda ()
(define-key helm-map (kbd "TAB") #'helm-execute-persistent-action)
(define-key helm-map (kbd "<tab>") #'helm-execute-persistent-action)
(define-key helm-map (kbd "C-i") #'helm-select-action)
(define-key helm-map (kbd "C-z") #'helm-select-action)
))
(require 'helm-imenu)
(custom-set-variables
'(helm-imenu-fuzzy-match t)
)
(require 'nerd-icons)
(require 'helm-x-icons)
(with-eval-after-load 'helm-x-icons
(customize-set-variable 'helm-x-icons-provider 'nerd-icons))
(with-eval-after-load 'helm-files
(helm-ff-icon-mode 1))
(add-to-list 'helm-imenu-all-buffer-assoc '(enh-ruby-mode . js2-mode))
(provide 'helm-common_init)
;;; helm-common_init.el ends here