Reordered init.el, added coding style "tastytea".

This commit is contained in:
tastytea 2019-03-31 19:26:14 +02:00
parent fcdccec888
commit 6e88cd226c
2 changed files with 79 additions and 73 deletions

150
init.el
View File

@ -1,5 +1,5 @@
;;; init.el --- tastytea's Emacs init file.
;;; Time-stamp: <2019-03-31 18:50:31 CEST>
;;; Time-stamp: <2019-03-31 19:25:20 CEST>
;;; Commentary:
;;; I am using this file with Emacs 26, but most of it will probably work with
@ -164,66 +164,7 @@
("M-<down>" . scroll-up-line)
("M-<up>" . scroll-down-line)))
;;;;;;;;;;;;;;;;;;;; Programming / C++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set coding style.
(setq c-default-style "bsd"
c-basic-offset 4)
;; (c-set-offset 'statement-cont 0)
(unless slow-computer
(use-package rtags
:pin melpa-stable
:if (executable-find "llvm-config")
:if (executable-find "clang++")
:config
(unless (and (rtags-executable-find "rc") (rtags-executable-find "rdm"))
(progn
(message "RTags is not installed!")
(rtags-install)))
(rtags-enable-standard-keybindings)
:bind
(:map c-mode-base-map
("M-." . rtags-find-symbol-at-point)
("M-," . rtags-find-references-at-point)
("M-?" . rtags-display-summary))
:hook
(c++-mode . (rtags-start-process-unless-running))
(c-mode . (rtags-start-process-unless-running))
(kill-emacs . rtags-quit-rdm)))
(use-package flycheck-rtags
:pin melpa-stable
:after (flycheck rtags)
:config
;; ensure that we use only rtags checking.
;; https://github.com/Andersbakken/rtags#optional-1
(defun my/setup-flycheck-rtags ()
(flycheck-select-checker 'rtags)
(setq-local flycheck-highlighting-mode nil)) ; Can't disable RTags overlay.
:hook
(c-mode-hook . my/setup-flycheck-rtags)
(c++-mode-hook . my/setup-flycheck-rtags))
(use-package company-rtags
:pin melpa-stable
:after (company rtags)
:custom
(rtags-completions-enabled t)
:config
;; (setq rtags-autostart-diagnostics t)
;; (rtags-diagnostics)
(push 'company-rtags company-backends))
;; cmake integration.
(unless slow-computer
(use-package cmake-ide
:after rtags
:custom
(cmake-ide-build-dir "build")
:config
(cmake-ide-setup)))
;;;;;;;;;;;;;;;;;;;; Programming / other ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;; Programming / general ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Online documentation mode.
(use-package eldoc
:hook
@ -279,15 +220,6 @@
(:map projectile-command-map
("k" . 'my/projectile-kill-buffers-and-change-tabbar-grouping))))
;; GUI for gdb and other debuggers.
(use-package realgud
:config
(defun my/load-realgud ()
(load-library "realgud"))
:bind
(:map c-mode-base-map
("C-c g" . my/load-realgud)))
;; Highlight TODO, FIXME, NOTE and so on.
(use-package hl-todo
:bind
@ -326,7 +258,7 @@
;; :hook
;; (prog-mode . highlight-indent-guides-mode))
;; Tries to find structures and jumps to them.
;; Tries to find points of interest and jumps to them.
(use-package imenu-anywhere
:after ido-completing-read+
:bind
@ -339,6 +271,80 @@
:hook
(prog-mode . highlight-doxygen-mode))
;;;;;;;;;;;;;;;;;;;; Programming / C++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set coding style.
(use-package cc-mode
:ensure nil ; Included in Emacs.
:init
(c-add-style "tastytea"
'("bsd"
(c-basic-offset . 4)))
:custom
(c-default-style "tastytea"))
(unless slow-computer
(use-package rtags
:pin melpa-stable
:if (executable-find "llvm-config")
:if (executable-find "clang++")
:config
(unless (and (rtags-executable-find "rc") (rtags-executable-find "rdm"))
(progn
(message "RTags is not installed!")
(rtags-install)))
(rtags-enable-standard-keybindings)
:bind
(:map c-mode-base-map
("M-." . rtags-find-symbol-at-point)
("M-," . rtags-find-references-at-point)
("M-?" . rtags-display-summary))
:hook
(c++-mode . (rtags-start-process-unless-running))
(c-mode . (rtags-start-process-unless-running))
(kill-emacs . rtags-quit-rdm)))
(use-package flycheck-rtags
:pin melpa-stable
:after (flycheck rtags)
:config
;; ensure that we use only rtags checking.
;; https://github.com/Andersbakken/rtags#optional-1
(defun my/setup-flycheck-rtags ()
(flycheck-select-checker 'rtags)
(setq-local flycheck-highlighting-mode nil)) ; Can't disable RTags overlay.
:hook
(c-mode-hook . my/setup-flycheck-rtags)
(c++-mode-hook . my/setup-flycheck-rtags))
(use-package company-rtags
:pin melpa-stable
:after (company rtags)
:custom
(rtags-completions-enabled t)
:config
;; (setq rtags-autostart-diagnostics t)
;; (rtags-diagnostics)
(push 'company-rtags company-backends))
;; cmake integration.
(unless slow-computer
(use-package cmake-ide
:after rtags
:custom
(cmake-ide-build-dir "build")
:config
(cmake-ide-setup)))
;; GUI for gdb and other debuggers.
(use-package realgud
:after cc-mode
:config
(defun my/load-realgud ()
(load-library "realgud"))
:bind
(:map c-mode-base-map
("C-c g" . my/load-realgud)))
;;;;;;;;;;;;;;;;;;;; Appearance ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Icons (required by doom).
(use-package all-the-icons
@ -584,7 +590,7 @@
;; If 2 files have the same name, append directory name after the filename.
(use-package uniquify
:ensure nil ; Included in emacs
:ensure nil ; Included in Emacs.
:custom
(uniquify-after-kill-buffer-p t)
(uniquify-buffer-name-style 'post-forward)

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 11422
127.0.0.1:51313 11194
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh