emacs notes: Various ways to load customized configuration file for emacs configuration

 For converting emacs to c/cpp ide suppose File is ~/.emacs.d/myLspCcpp.conf

///////

(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))
///////////////////////////////////////////
Now after opening this conf file can be loaded like
1>M-x load-file <path_of_file>
2> Open this conf file in emacs n then M-x eval-buffer

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...