diff options
Diffstat (limited to '.config/emacs/org')
-rw-r--r-- | .config/emacs/org/config.org | 114 |
1 files changed, 59 insertions, 55 deletions
diff --git a/.config/emacs/org/config.org b/.config/emacs/org/config.org index bdf0bb6..f9c82b2 100644 --- a/.config/emacs/org/config.org +++ b/.config/emacs/org/config.org @@ -251,7 +251,7 @@ (dashboard-setup-startup-hook) (setq dashboard-banner-logo-title "Welcome back to Emacs, partner!" - dashboard-startup-banner 'official + dashboard-startup-banner "/home/jozan/pics/profile/caco.png" dashboard-set-init-info nil dashboard-set-footer nil dashboard-center-content t @@ -599,61 +599,65 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer." *** lsp, ccls #+BEGIN_SRC emacs-lisp - (require 'lsp-mode) - (require 'lsp-ui) - (require 'company-lsp) - (require 'ccls) - (add-hook 'c-mode-hook (lambda () (lsp))) - (add-hook 'c++-mode-hook (lambda () (lsp))) - (add-hook 'objc-mode-hook (lambda () (lsp))) - (add-hook 'cuda-mode-hook (lambda () (lsp))) - (setq ccls-executable "/usr/local/bin/ccls") - - (defun ccls/callee () (interactive) (lsp-ui-peek-find-custom "$ccls/call" '(:callee t))) - (defun ccls/caller () (interactive) (lsp-ui-peek-find-custom "$ccls/call")) - (defun ccls/vars (kind) (lsp-ui-peek-find-custom "$ccls/vars" `(:kind ,kind))) - (defun ccls/base (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels))) - (defun ccls/derived (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels :derived t))) - (defun ccls/member (kind) (interactive) (lsp-ui-peek-find-custom "$ccls/member" `(:kind ,kind))) - - ;; References w/ Role::Role - (defun ccls/references-read () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 8))) - - ;; References w/ Role::Write - (defun ccls/references-write () - (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 16))) - - ;; References w/ Role::Dynamic bit (macro expansions) - (defun ccls/references-macro () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :role 64))) - - ;; References w/o Role::Call bit (e.g. where functions are taken addresses) - (defun ccls/references-not-call () (interactive) - (lsp-ui-peek-find-custom "textDocument/references" - (plist-put (lsp--text-document-position-params) :excludeRole 32))) - - ;; ccls/vars ccls/base ccls/derived ccls/members have a parameter while others are interactive. - ;; (ccls/base 1) direct bases - ;; (ccls/derived 1) direct derived - ;; (ccls/member 2) => 2 (Type) => nested classes / types in a namespace - ;; (ccls/member 3) => 3 (Func) => member functions / functions in a namespace - ;; (ccls/member 0) => member variables / variables in a namespace - ;; (ccls/vars 1) => field - ;; (ccls/vars 2) => local variable - ;; (ccls/vars 3) => field or local variable. 3 = 1 | 2 - ;; (ccls/vars 4) => parameter - - ;; References whose filenames are under this project - (setq company-transformers nil company-lsp-async t company-lsp-cache-candidates nil) - (setq ccls-sem-highlight-method 'font-lock) + (require 'lsp-mode) + (require 'lsp-ui) + (require 'company-lsp) + (require 'ccls) + (add-hook 'c-mode-hook (lambda () (lsp))) + (add-hook 'c++-mode-hook (lambda () (lsp))) + (add-hook 'objc-mode-hook (lambda () (lsp))) + (add-hook 'cuda-mode-hook (lambda () (lsp))) + (setq ccls-executable "/usr/local/bin/ccls") + + (defun ccls/callee () (interactive) (lsp-ui-peek-find-custom "$ccls/call" '(:callee t))) + (defun ccls/caller () (interactive) (lsp-ui-peek-find-custom "$ccls/call")) + (defun ccls/vars (kind) (lsp-ui-peek-find-custom "$ccls/vars" `(:kind ,kind))) + (defun ccls/base (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels))) + (defun ccls/derived (levels) (lsp-ui-peek-find-custom "$ccls/inheritance" `(:levels ,levels :derived t))) + (defun ccls/member (kind) (interactive) (lsp-ui-peek-find-custom "$ccls/member" `(:kind ,kind))) + + ;; References w/ Role::Role + (defun ccls/references-read () (interactive) + (lsp-ui-peek-find-custom "textDocument/references" + (plist-put (lsp--text-document-position-params) :role 8))) + + ;; References w/ Role::Write + (defun ccls/references-write () + (interactive) + (lsp-ui-peek-find-custom "textDocument/references" + (plist-put (lsp--text-document-position-params) :role 16))) + + ;; References w/ Role::Dynamic bit (macro expansions) + (defun ccls/references-macro () (interactive) + (lsp-ui-peek-find-custom "textDocument/references" + (plist-put (lsp--text-document-position-params) :role 64))) + + ;; References w/o Role::Call bit (e.g. where functions are taken addresses) + (defun ccls/references-not-call () (interactive) + (lsp-ui-peek-find-custom "textDocument/references" + (plist-put (lsp--text-document-position-params) :excludeRole 32))) + + ;; ccls/vars ccls/base ccls/derived ccls/members have a parameter while others are interactive. + ;; (ccls/base 1) direct bases + ;; (ccls/derived 1) direct derived + ;; (ccls/member 2) => 2 (Type) => nested classes / types in a namespace + ;; (ccls/member 3) => 3 (Func) => member functions / functions in a namespace + ;; (ccls/member 0) => member variables / variables in a namespace + ;; (ccls/vars 1) => field + ;; (ccls/vars 2) => local variable + ;; (ccls/vars 3) => field or local variable. 3 = 1 | 2 + ;; (ccls/vars 4) => parameter + + (setq lsp-ui-doc-header t) + (setq lsp-ui-doc-position 'top) + (setq lsp-ui-sideline-enable t) + + ;; References whose filenames are under this project + (setq company-transformers nil company-lsp-async t company-lsp-cache-candidates nil) + (setq ccls-sem-highlight-method 'font-lock) (setq lsp-enable-indentation nil) -(setq lsp-enable-completion-at-point t) - ;; (ccls-use-default-rainbow-sem-highlight) + (setq lsp-enable-completion-at-point t) + ;; (ccls-use-default-rainbow-sem-highlight) #+END_SRC ** Compilation |