mirror of https://github.com/Chizi123/.emacs.d.git

Chizi123
2019-01-06 d070a7b257cf0c42efe058bc520a585fb166f46d
commit | author | age
8c2ab1 1 (provide 'setup-convenience)
C 2
3 ;; use ibuffer instead of default
4 (global-set-key (kbd "C-x C-b") 'ibuffer)
5
6 ;; GROUP: Convenience -> Revert
7
8 ;; update any change made on file to the current buffer
9 (global-auto-revert-mode)
10
11 ;; GROUP: Convenience -> Hippe Expand
12 ;; hippie-expand is a better version of dabbrev-expand.
13 ;; While dabbrev-expand searches for words you already types, in current;; buffers and other buffers, hippie-expand includes more sources,
14 ;; such as filenames, klll ring...
15 (global-set-key (kbd "M-/") 'hippie-expand) ;; replace dabbrev-expand
16 (setq
17  hippie-expand-try-functions-list
18  '(try-expand-dabbrev ;; Try to expand word "dynamically", searching the current buffer.
19    try-expand-dabbrev-all-buffers ;; Try to expand word "dynamically", searching all other buffers.
20    try-expand-dabbrev-from-kill ;; Try to expand word "dynamically", searching the kill ring.
21    try-complete-file-name-partially ;; Try to complete text as a file name, as many characters as unique.
22    try-complete-file-name ;; Try to complete text as a file name.
23    try-expand-all-abbrevs ;; Try to expand word before point according to all abbrev tables.
24    try-expand-list ;; Try to complete the current line to an entire line in the buffer.
25    try-expand-line ;; Try to complete the current line to an entire line in the buffer.
26    try-complete-lisp-symbol-partially ;; Try to complete as an Emacs Lisp symbol, as many characters as unique.
27    try-complete-lisp-symbol) ;; Try to complete word as an Emacs Lisp symbol.
28  )
29
30 ;; GROUP: Convenience -> HL Line
31 (global-hl-line-mode)
32
33 ;; GROUP: Convenience -> Ibuffer
34 (setq ibuffer-use-other-window t) ;; always display ibuffer in another window
35
36 ;; GROUP: Convenience -> Linum
37 (add-hook 'prog-mode-hook 'linum-mode) ;; enable linum only in programming modes
38
39 ;; GROUP: Convenience -> Whitespace
40
41 ;; whenever you create useless whitespace, the whitespace is highlighted
42 (add-hook 'prog-mode-hook (lambda () (interactive) (setq show-trailing-whitespace 1)))
43
44 ;; activate whitespace-mode to view all whitespace characters
45 (global-set-key (kbd "C-c w") 'whitespace-mode)
46
47 ;; GROUP: Convenience -> Windmove
48
49 ;; easier window navigation
50 (windmove-default-keybindings)