emacs Notes: How to configure for c/c++ ide

 (require 'package)

;;(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)

(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)

(package-initialize)


(setq package-selected-packages '(lsp-mode yasnippet lsp-treemacs helm-lsp

    projectile hydra flycheck company avy which-key helm-xref dap-mode))


(when (cl-find-if-not #'package-installed-p package-selected-packages)

  (package-refresh-contents)

  (mapc #'package-install package-selected-packages))


;; sample `helm' configuration use https://github.com/emacs-helm/helm/ for details

(helm-mode)

(require 'helm-xref)

(define-key global-map [remap find-file] #'helm-find-files)

(define-key global-map [remap execute-extended-command] #'helm-M-x)

(define-key global-map [remap switch-to-buffer] #'helm-mini)


(which-key-mode)

(add-hook 'c-mode-hook 'lsp)

(add-hook 'c++-mode-hook 'lsp)


(setq gc-cons-threshold (* 100 1024 1024)

      read-process-output-max (* 1024 1024)

      treemacs-space-between-root-nodes nil

      company-idle-delay 0.0

      company-minimum-prefix-length 1

      lsp-idle-delay 0.1)  ;; clangd is fast


(with-eval-after-load 'lsp-mode

  (add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)

  (require 'dap-cpptools)

  (yas-global-mode))

No comments:

Post a Comment

If you have any doubts, please let me know.

Various types of salts effect on health (discussion with gemenie)

Is  rock salt or bitnoon helps in digestion or just a airuvedic nuska This is for informational purposes only. For medical advice or diagnos...