summaryrefslogtreecommitdiff
path: root/lisp/cpp.el~
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-06-07 08:23:47 -0400
committermattkae <mattkae@protonmail.com>2022-06-07 08:23:47 -0400
commitbd18a38c2898548a3664a9ddab9f79c84f2caf4a (patch)
tree95b9933376770381bd8859782ae763be81c2d72b /lisp/cpp.el~
parentb07628dddf418d4f47b858e6c35fd3520fbaeed2 (diff)
parentef160dea332af4b4fe5e2717b962936c67e5fe9e (diff)
Merge conflict
Diffstat (limited to 'lisp/cpp.el~')
-rw-r--r--lisp/cpp.el~55
1 files changed, 55 insertions, 0 deletions
diff --git a/lisp/cpp.el~ b/lisp/cpp.el~
new file mode 100644
index 0000000..a81e1ff
--- /dev/null
+++ b/lisp/cpp.el~
@@ -0,0 +1,55 @@
+(defun setup-c()
+ (setq c++-tab-always-indent 0)
+ (setq c-basic-offset 4) ;; Default is 2
+ (setq c-indent-level 4) ;; Default is 2
+ (c-set-offset 'brace-list-open 0)
+
+
+ (setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60))
+ (setq tab-width 4)
+ (electric-indent-mode 0)
+
+ ;; == irony-mode ==
+ (use-package irony
+ :ensure t
+ :defer t
+ :init
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
+ (add-hook 'objc-mode-hook 'irony-mode)
+ :config
+ ;; replace the `completion-at-point' and `complete-symbol' bindings in
+ ;; irony-mode's buffers by irony-mode's function
+ (defun my-irony-mode-hook ()
+ (define-key irony-mode-map [remap completion-at-point]
+ 'irony-completion-at-point-async)
+ (define-key irony-mode-map [remap complete-symbol]
+ 'irony-completion-at-point-async))
+ (add-hook 'irony-mode-hook 'my-irony-mode-hook)
+ (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
+ )
+
+ ;; == company-mode ==
+ (use-package company
+ :ensure t
+ :defer t
+ :init (add-hook 'after-init-hook 'global-company-mode)
+ :config
+ (use-package company-irony :ensure t :defer t)
+ (setq company-idle-delay nil
+ company-minimum-prefix-length 2
+ company-show-numbers t
+ company-tooltip-limit 20
+ company-dabbrev-downcase nil
+ company-backends '((company-irony company-gtags))
+ )
+ :bind ("C-;" . company-complete-common)
+ )
+
+ ;; Flycheck
+ (eval-after-load 'flycheck
+ '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
+
+)
+
+(provide 'cpp)