Skip to content

Latest commit

 

History

History
188 lines (167 loc) · 6.49 KB

emacs.org_archive

File metadata and controls

188 lines (167 loc) · 6.49 KB

Archived entries from file /home/ape/dotfiles/emacs.org

LSP and DAP (not used)

lsp-mode

Provides language backend to company-mode.

(use-package lsp-mode
  :commands (lsp)
  :hook ((sh-mode . lsp-mode)
         (python-mode . lsp-mode)
         (c-mode . lsp-mode)
         (c++-mode . lsp-mode)
         (markdown-mode . lsp-mode)
         (cmake-mode . lsp-mode))
  :init
  (setq lsp-keymap-prefix "C-c l") ;; or "C-l"
  :custom ((lsp-idle-delay 0.5)) ;; 0.5 is the defualt
  :config
  (lsp-enable-which-key-integration t)
  ;; Annoying stuff (uncomment to turn off)
  ;; (setq lsp-enable-links nil)
  ;; (setq lsp-signature-render-documentation nil)
  (setq lsp-headerline-breadcrumb-enable nil)
  ;; (setq lsp-ui-doc-enable nil)
  ;; (setq lsp-completion-enable-additional-text-edit nil)

  ;; `-background-index' requires clangd v8+!
  (setq lsp-clients-clangd-args '("-j=4" "-background-index" "-log=error"))
  )

The last line concerning cangd comes from mortens.dev.

lsp-ui

Provides additional lsp information to the company-mode box. The mode provides info when hoovered by mouse. lsp-ui documentation

Note: Functions also display the proceeding C++ function comments as documentation

(use-package lsp-ui
  :after lsp
  :hook (lsp-mode . lsp-ui-mode)
  :custom
  (lsp-ui-doc-position 'bottom))

lsp-ivy

lsp-ivy integrates Ivy with lsp-mode to make it easy to search for things by name in your code. When you run these commands, a prompt will appear in the minibuffer allowing you to type part of the name of a symbol in your code. Results will be populated in the minibuffer so that you can find what you’re looking for and jump to that location in the code upon selecting the result.

Try these commands with M-x:

  • lsp-ivy-workspace-symbol - Search for a symbol name in the current project workspace
  • lsp-ivy-global-workspace-symbol - Search for a symbol name in all active project workspaces.
(use-package lsp-ivy
  :after lsp)

lsp-treemacs

Shows file contents: classes functions etc

  • See lsp-treemacs-references
(use-package lsp-treemacs
  :after lsp)

Dap Debugging

Like lsp-mode but for debuggers.

(use-package dap-mode
  :after lsp
  :commands dap-mode)

Flycheck (not used) –eglot uses flymake

Checks the code for bugs on the fly.
(use-package flycheck
  :hook ((emacs-lisp-mode . flycheck-mode))
  :diminish flycheck-mode
  :after lsp)

Grammarly (not set up)

There looks to be several packages at the moment. Top two (as of 1/10/22) are installed here without proper hooks.

lsp-grammarly

Gives warning on startup for login. lsp-grammarly doc

(use-package lsp-grammarly
:ensure t
:hook (text-mode . (lambda ()
                     (require 'lsp-grammarly)
                     (lsp))))

flycheck-grammarly

Works w/o being logged in. flycheck-grammarly doc

(use-package flycheck-grammarly
:config
(setq flycheck-grammarly-check-time 0.8))

Dark+ (not used)

  • The modeline, when un-selected, has the same background as files, making it hard to delineation between vertically split windows.
(use-package doom-themes
  :defer t  )

(defun jmn-load-dark+()
  "Theme for very light time"
  (interactive)
  (disable-theme (car custom-enabled-themes))
  (load-theme 'doom-dark+ t)
  (set-face-background 'line-number
                       (face-attribute 'default :background))
  ;; default does not change filename settings when modified
  (set-face-foreground 'doom-modeline-buffer-modified "red")
  (with-eval-after-load 'org
           ;; (set-face-foreground 'org-priority (face-foreground font-lock-builtin-face))
      (setq org-todo-keyword-faces
            `(("NEXT" .  ,(face-foreground font-lock-function-name-face))
              ("HOLD" . "dark orange")))))

Jupyter Notebooks

run Jupyter in babel

Reference and https://github.com/jkitchin/scimax Cannot get zmq (Jupyter dependency) to work currently

(use-package jupyter
    :after (org))

(org-babel-do-load-languages 'org-babel-load-languages
                             (append org-babel-load-languages
                                     '((jupyter . t))))

open notebook in Emacs

If I use EIN, add the setting for displaying the figures inline.

(use-package ein
  :commands (ein:notebooklist-open)
  ;; :config
  ;; (require 'ein-loaddefs)
  ;; (require 'ein)
  ;; (define-key ein:notebook-mode-map (kbd "<C-tab>") 'my-function)
  )

completion

In EIN video, Miller says that the completion is based on auto-complete rather than company. So here we are going to try to get completion setup for EIN. Also, in EIN github, Miller says that EIN is an elpy module, so maybe we need elpy for completion?