summaryrefslogtreecommitdiff
path: root/config.org
diff options
context:
space:
mode:
authoryuzu-eva <stevenhu@web.de>2023-04-03 13:09:52 +0200
committeryuzu-eva <stevenhu@web.de>2023-04-03 13:09:52 +0200
commitdc536cd2b9980a71f5569b11822fbdfd1b91376f (patch)
tree5ce96e1281305cd26b7717c63c37de82e5d7c220 /config.org
parenta4edc54d04b7d58a5d35b94582d90b0f4e288f05 (diff)
feat: added irony, autocompletion backend for C/C++
Diffstat (limited to 'config.org')
-rw-r--r--config.org28
1 files changed, 28 insertions, 0 deletions
diff --git a/config.org b/config.org
index a926691..1925763 100644
--- a/config.org
+++ b/config.org
@@ -539,8 +539,36 @@ Company is an autocompletion frontend
#+begin_src emacs-lisp
(use-package company
:ensure t
+ :config
+ (setq company-idle-delay 0)
+ (setq company-minimum-prefix-length 3)
:init
(add-hook 'after-init-hook 'global-company-mode))
+
+ (with-eval-after-load 'company
+ (define-key company-active-map (kbd "M-n") nil)
+ (define-key company-active-map (kbd "M-p") nil)
+ (define-key company-active-map (kbd "C-n") 'company-select-next)
+ (define-key company-active-map (kbd "C-p") 'company-select-previous))
+#+end_src
+
+** Initialize =company-irony=
+
+Autocompletion backend for C and C++
+
+#+begin_src emacs-lisp
+ (use-package company-irony
+ :ensure t
+ :config
+ (require 'company)
+ (add-to-list 'company-backends 'company-irony))
+
+ (use-package irony
+ :ensure t
+ :config
+ (add-hook 'c++-mode-hook 'irony-mode)
+ (add-hook 'c-mode-hook 'irony-mode)
+ (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
#+end_src
* Custom keybinds