about summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-09-15 22:37:03 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2018-09-15 22:37:03 +0700
commit24969b7afcb3586de441cd151bad7721b740ad41 (patch)
tree28cc15609af4fd6e9cfaf47146ae56788e2fbd25 /emacs
parent6e9ef6328cf834e1c8e60e0d99fa29af4c727915 (diff)
downloaddotfiles-24969b7afcb3586de441cd151bad7721b740ad41.tar.gz
Update 2018-09-15
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init.el50
1 files changed, 38 insertions, 12 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el
index fa93993..8947236 100644
--- a/emacs/.emacs.d/init.el
+++ b/emacs/.emacs.d/init.el
@@ -12,33 +12,61 @@
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
+ '(ac-auto-show-menu nil)
+ '(ac-auto-start nil)
+ '(ac-expand-on-auto-complete nil)
+ '(ac-trigger-key "M-RET")
  '(ansi-color-names-vector
-   ["#2e3436" "#a40000" "#4e9a06" "#c4a000"
-    "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
+   ["#2e3436" "#a40000" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
  '(column-number-mode t)
- '(cua-mode t nil (cua-base))
  '(custom-enabled-themes (quote (tango)))
- '(package-selected-packages (quote (geiser slime pdf-tools)))
+ '(package-selected-packages (quote (magit geiser slime pdf-tools)))
  '(scroll-bar-mode nil)
  '(show-paren-mode t)
  '(tool-bar-mode nil)
  '(whitespace-style
-   (quote (face trailing spaces newline space-mark newline-mark))))
+   (quote
+    (face trailing spaces newline space-mark newline-mark))))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
- '(default ((t (:family "Latin Modern Mono" :foundry "UKWN"
-                :slant normal :weight normal :height 120 :width normal))))
+ '(default ((t (:family "Latin Modern Mono" :foundry "UKWN" :slant normal :weight normal :height 120 :width normal))))
  '(whitespace-space ((t (:foreground "gray")))))
 
-(cua-mode)
+(savehist-mode 1)
 (setq-default inhibit-splash-screen t)
-(setq-default fill-column 80)
+(setq-default fill-column 79)
 (add-hook 'prog-mode-hook 'ruler-mode)
 (setq-default indent-tabs-mode nil)
 (add-hook 'find-file-hook 'whitespace-mode)
+(global-set-key (kbd "C-<return>") #'cua-rectangle-mark-mode)
+
+(defun c-lineup-arglist-tabs-only (ignored)
+  "Line up argument lists by tabs, not spaces"
+  (let* ((anchor (c-langelem-pos c-syntactic-element))
+         (column (c-langelem-2nd-pos c-syntactic-element))
+         (offset (- (1+ column) anchor))
+         (steps (floor offset c-basic-offset)))
+    (* (max steps 1)
+       c-basic-offset)))
+
+(add-hook 'c-mode-common-hook
+          (lambda ()
+            ;; Add kernel style
+            (c-add-style
+             "linux-tabs-only"
+             '("linux" (c-offsets-alist
+                        (arglist-cont-nonempty
+                         c-lineup-gcc-asm-reg
+                         c-lineup-arglist-tabs-only))))))
+
+(add-hook 'c-mode-hook
+          (lambda ()
+            (setq indent-tabs-mode t)
+            (setq show-trailing-whitespace t)
+            (c-set-style "linux-tabs-only")))
 
 (add-hook 'scheme-mode-hook
           (lambda ()
@@ -47,9 +75,7 @@
             (setq-default geiser-repl-use-other-window nil)
             (setq-default geiser-repl-query-on-kill-p nil)))
 (add-hook 'python-mode-hook
-          (lambda ()
-            (setq fill-column 79)
-            (setq comment-fill-column 72)))
+          (lambda () (setq comment-fill-column 72)))
 ; The SBCL binary and command-line arguments
 (setq inferior-lisp-program "/usr/local/bin/sbcl --noinform")
 (when window-system (set-frame-size (selected-frame) 80 25))