diff --git a/home/programs/emacs/config.org b/home/programs/emacs/config.org index a9bc4fa..4dad7a0 100644 --- a/home/programs/emacs/config.org +++ b/home/programs/emacs/config.org @@ -35,7 +35,7 @@ ; :states 'normal :states 'motion :prefix "SPC" - :non-normal-prefix "C-SPC")) + :non-normal-prefix "C-SPC")) #+END_SRC Base keys @@ -52,13 +52,13 @@ w - multiple cursors "c" (general-simulate-key "C-c" :which-key "C-c") "u" (general-simulate-key "C-u" :which-key "C-u") "x" (general-simulate-key "C-x" :which-key "C-x") - + "m" '(:ignore t :which-key "mode") "mx" 'nil - + ;; Help "h" (general-simulate-key "" :which-key "C-h") - + ;; Insert "i" '(:ignore t :which-key "C-h") "ix" 'nil @@ -68,7 +68,7 @@ w - multiple cursors ;; "pl" 'list-packages ;; Quit operations - "q" '(:ignore t :which-key "quit emacs") + "q" '(:ignore t :which-key "quit emacs") "qq" 'kill-emacs "qz" 'delete-frame @@ -124,14 +124,14 @@ General keys * Essentials ** Basic config - + Stop emacs from using dialog windows #+BEGIN_SRC emacs-lisp (setq use-dialog-box nil) #+END_SRC - -Save sessions + +Save sessions #+BEGIN_SRC emacs-lisp ;; (desktop-save-mode 1) @@ -165,7 +165,7 @@ Put backup files in emacs.d/temp ; "wh" '(evil-window-left :which-key "←") ; "wj" '(evil-window-down :which-key "↓") ; "wk" '(evil-window-up :which-key "↑") - ; "wl" '(evil-window-right :which-key "→")) + ; "wl" '(evil-window-right :which-key "→")) ([remap evil-ex-search-forward] 'swiper) ([remap evil-ex-search-backward] 'swiper-backward) @@ -181,17 +181,17 @@ Put backup files in emacs.d/temp :config - ;; :q should kill the current buffer rather than quitting emacs entirely - (evil-ex-define-cmd "q" 'kill-this-buffer) - ;; Need to type out :quit to close emacs - (evil-ex-define-cmd "quit" 'evil-quit) + ;; :q should kill the current buffer rather than quitting emacs entirely + (evil-ex-define-cmd "q" 'kill-this-buffer) + ;; Need to type out :quit to close emacs + (evil-ex-define-cmd "quit" 'evil-quit) (evil-set-initial-state 'messages-buffer-mode 'normal) (evil-set-initial-state 'dashboard-mode 'normal) (evil-mode 1)) #+END_SRC - + #+BEGIN_SRC elisp (use-package evil-collection @@ -254,7 +254,7 @@ Ivy-rich adds extra columns to a few of the Counsel commands to provide more inf "ik" '(counsel-yank-pop :which-key "from kill-ring") "bb" '(counsel-ibuffer :which-key "choose buffer") "fe" '(counsel-flycheck :which-key "find error")) - + :bind (("M-x" . counsel-M-x) ("C-x b" . counsel-ibuffer) ("C-x C-f" . counsel-find-file) @@ -266,16 +266,16 @@ Ivy-rich adds extra columns to a few of the Counsel commands to provide more inf #+BEGIN_SRC emacs-lisp (use-package org - :general (leader-key - "o" '(:ignore t :which-key "org") - "oa" '(org-agenda :which-key "agenda") - "ox" '(org-toggle-checkbox :which-key "[X]") - "oe" '(org-edit-src-code :which-key "Edit SRC") - ; Insert - "io" '(:ignore t :which-key "org") - "ios" 'org-insert-structure-template) + :general (leader-key + "o" '(:ignore t :which-key "org") + "oa" '(org-agenda :which-key "agenda") + "ox" '(org-toggle-checkbox :which-key "[X]") + "oe" '(org-edit-src-code :which-key "Edit SRC") + ; Insert + "io" '(:ignore t :which-key "org") + "ios" 'org-insert-structure-template) :config - (setq org-src-tab-acts-natively nil)) + (setq org-src-tab-acts-natively nil)) #+END_SRC Improved version of org-bullets @@ -283,7 +283,7 @@ Improved version of org-bullets #+BEGIN_SRC emacs-lisp (use-package org-superstar :hook (org-mode-hook . org-superstar-mode) - :config + :config (setq org-startup-indented t) ;; Indent according to section (setq org-startup-with-inline-images t)) ;; Display images in-buffer by default #+END_SRC @@ -305,9 +305,9 @@ Evil bindings for org mode (setq org-directory "~/org/")) #+END_SRC -** Notes +** Notes *** Project notes - + #+BEGIN_SRC emacs-lisp (defvar notes-folder "~/.emacs.d/notes") #+END_SRC @@ -319,14 +319,14 @@ Evil bindings for org mode (defun get-notes () (interactive) (if (projectile-project-p) - (let - ((note-path (format-note-path (projectile-project-root)))) + (let + ((note-path (format-note-path (projectile-project-root)))) (unless (file-exists-p note-path) - (when (y-or-n-p (format "%s does not exist. Create it?" note-path)) + (when (y-or-n-p (format "%s does not exist. Create it?" note-path)) (make-directory (file-name-directory note-path) t) (make-empty-file note-path))) (find-file note-path)) - ;; else + ;; else (message "Couldn't find project folder"))) (leader-key @@ -355,7 +355,7 @@ Evil bindings for org mode ("Zsh" . "$XDG_CONFIG_HOME/zsh/.zshrc") ("Config-selector" . "$HOME/.scripts/rofi/config-selector") ("Configfiles" . "$HOME/.scripts/rofi/configfiles"))) - + (defun find-config-file () "Chooses a config-file from dotfiles and opens it in a new buffer" (interactive) @@ -365,6 +365,13 @@ Evil bindings for org mode (leader-key "fc" '(find-config-file :which-key "find config file")) #+END_SRC +** Envrc + +#+BEGIN_SRC emacs-lisp +(use-package envrc + :hook (after-init . envrc-global-mode)) +#+END_SRC + * Look and Feel ** Theme doom-theme can be used to set a theme from the doom package @@ -372,64 +379,64 @@ For every other theme, use load-theme #+BEGIN_SRC emacs-lisp (use-package monokai-theme - :config - (setq monokai-user-variable-pitch t) - (progn + :config + (setq monokai-user-variable-pitch t) + (progn - (defvar after-load-theme-hook nil - "Hook run after a color theme is loaded using `load-theme'.") + (defvar after-load-theme-hook nil + "Hook run after a color theme is loaded using `load-theme'.") - (defadvice load-theme (after run-after-load-theme-hook activate) - "Run `after-load-theme-hook'." - (run-hooks 'after-load-theme-hook)) + (defadvice load-theme (after run-after-load-theme-hook activate) + "Run `after-load-theme-hook'." + (run-hooks 'after-load-theme-hook)) - (defun customize-monokai () - "Customize monokai theme" - (if (member 'monokai custom-enabled-themes) - (custom-theme-set-faces - 'monokai - '(py-object-reference-face ((t (:foreground "#FFA500")))) - '(py-decorators-face ((t (:foreground "#FFA500")))) - '(py-variable-name-face ((t (:foreground "#FFA500")))) - '(py-exception-name-face ((:foreground "#FFA500"))) - '(py-class-name-face ((:foreground "#FFA500"))) - '(py-pseudo-keyword-face ((:foreground "#FFA500"))) - '(py-builtins-face ((:foreground "#FFA500")))))) + (defun customize-monokai () + "Customize monokai theme" + (if (member 'monokai custom-enabled-themes) + (custom-theme-set-faces + 'monokai + '(py-object-reference-face ((t (:foreground "#FFA500")))) + '(py-decorators-face ((t (:foreground "#FFA500")))) + '(py-variable-name-face ((t (:foreground "#FFA500")))) + '(py-exception-name-face ((:foreground "#FFA500"))) + '(py-class-name-face ((:foreground "#FFA500"))) + '(py-pseudo-keyword-face ((:foreground "#FFA500"))) + '(py-builtins-face ((:foreground "#FFA500")))))) - (add-hook 'after-load-theme-hook 'customize-monokai))) + (add-hook 'after-load-theme-hook 'customize-monokai))) (load-theme 'monokai t) #+END_SRC ** Centaur-tabs - - #+BEGIN_SRC emacs-lisp - (use-package centaur-tabs - :demand - :config - (setq - centaur-tabs-set-icons t - centaur-tabs-gray-out-icons 'buffer - centaur-tabs-height 32 - centaur-tabs-set-modified-marker t - centaur-tabs-modified-marker "•" - centaur-tabs-set-bar 'under - x-underline-at-descent-line t - centaur-tabs-style "wave") - - (centaur-tabs-headline-match) - (centaur-tabs-mode t) - - ; TODO: configure centaur-tabs-active-bar-face and colors - :general (leader-key - "bg" '(centaur-tabs-counsel-switch-group :which-key "choose tab group") - "b M-p" '(centaur-tabs-backward-group :which-key "previous group") - "b M-n" '(centaur-tabs-forward-group :which-key "next group") - "bp" '(centaur-tabs-backward-tab :which-key "previous tab") - "bn" '(centaur-tabs-forward-tab :which-key "next tab"))) - #+END_SRC - + #+BEGIN_SRC emacs-lisp + (use-package centaur-tabs + :demand + :config + (setq + centaur-tabs-set-icons t + centaur-tabs-gray-out-icons 'buffer + centaur-tabs-height 32 + centaur-tabs-set-modified-marker t + centaur-tabs-modified-marker "•" + centaur-tabs-set-bar 'under + x-underline-at-descent-line t + centaur-tabs-style "wave") + + (centaur-tabs-headline-match) + (centaur-tabs-mode t) + + ; TODO: configure centaur-tabs-active-bar-face and colors + + :general (leader-key + "bg" '(centaur-tabs-counsel-switch-group :which-key "choose tab group") + "b M-p" '(centaur-tabs-backward-group :which-key "previous group") + "b M-n" '(centaur-tabs-forward-group :which-key "next group") + "bp" '(centaur-tabs-backward-tab :which-key "previous tab") + "bn" '(centaur-tabs-forward-tab :which-key "next tab"))) + #+END_SRC + #+BEGIN_SRC emacs-lisp (defun centaur-tabs-hide-tab (x) "Do no to show buffer X in tabs." @@ -456,10 +463,10 @@ For every other theme, use load-theme ;; Is not magit buffer. (and (string-prefix-p "magit" name) - (not (file-name-extension name))) + (not (file-name-extension name))) ))) #+END_SRC - + ** Modeline #+BEGIN_SRC emacs-lisp @@ -469,14 +476,14 @@ For every other theme, use load-theme ;; How tall the mode-line should be. It's only respected in GUI. ;; If the actual char height is larger, it respects the actual height. (setq doom-modeline-height 25) - + ;; How wide the mode-line bar should be. It's only respected in GUI. (setq doom-modeline-bar-width 3) - + ;; The limit of the window width. ;; If `window-width' is smaller than the limit, some information won't be displayed. (setq doom-modeline-window-width-limit fill-column) - + ;; How to detect the project root. ;; The default priority of detection is `ffip' > `projectile' > `project'. ;; nil means to use `default-directory'. @@ -485,7 +492,7 @@ For every other theme, use load-theme ;; to hanle sub-projects. ;; You can specify one if you encounter the issue. (setq doom-modeline-project-detection 'project) - + ;; Determines the style used by `doom-modeline-buffer-file-name'. ;; ;; Given ~/Projects/FOSS/emacs/lisp/comint.el @@ -506,98 +513,98 @@ For every other theme, use load-theme ;; with tramp, please try `file-name' style. ;; Please refer to https://github.com/bbatsov/projectile/issues/657. (setq doom-modeline-buffer-file-name-style 'relative-to-project) - + ;; Whether display icons in the mode-line. ;; While using the server mode in GUI, should set the value explicitly. (setq doom-modeline-icon (display-graphic-p)) - + ;; Whether display the icon for `major-mode'. It respects `doom-modeline-icon'. (setq doom-modeline-major-mode-icon nil) - + ;; Whether display the colorful icon for `major-mode'. ;; It respects `all-the-icons-color-icons'. (setq doom-modeline-major-mode-color-icon nil) - + ;; Whether display the icon for the buffer state. It respects `doom-modeline-icon'. (setq doom-modeline-buffer-state-icon t) - + ;; Whether display the modification icon for the buffer. ;; It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'. (setq doom-modeline-buffer-modification-icon t) - + ;; Whether to use unicode as a fallback (instead of ASCII) when not using icons. (setq doom-modeline-unicode-fallback nil) - + ;; Whether display the minor modes in the mode-line. (setq doom-modeline-minor-modes nil) - + ;; If non-nil, a word count will be added to the selection-info modeline segment. (setq doom-modeline-enable-word-count nil) - + ;; Major modes in which to display word count continuously. ;; Also applies to any derived modes. Respects `doom-modeline-enable-word-count'. ;; If it brings the sluggish issue, disable `doom-modeline-enable-word-count' or ;; remove the modes from `doom-modeline-continuous-word-count-modes'. (setq doom-modeline-continuous-word-count-modes '(markdown-mode gfm-mode org-mode)) - + ;; Whether display the buffer encoding. (setq doom-modeline-buffer-encoding t) - + ;; Whether display the indentation information. (setq doom-modeline-indent-info nil) - + ;; If non-nil, only display one number for checker information if applicable. (setq doom-modeline-checker-simple-format t) - + ;; The maximum number displayed for notifications. (setq doom-modeline-number-limit 99) - + ;; The maximum displayed length of the branch name of version control. (setq doom-modeline-vcs-max-length 12) - + ;; Whether display the workspace name. Non-nil to display in the mode-line. (setq doom-modeline-workspace-name t) - + ;; Whether display the perspective name. Non-nil to display in the mode-line. (setq doom-modeline-persp-name t) - + ;; If non nil the default perspective name is displayed in the mode-line. (setq doom-modeline-display-default-persp-name nil) - + ;; If non nil the perspective name is displayed alongside a folder icon. (setq doom-modeline-persp-icon t) - + ;; Whether display the `lsp' state. Non-nil to display in the mode-line. (setq doom-modeline-lsp t) - + ;; Whether display the GitHub notifications. It requires `ghub' package. (setq doom-modeline-github nil) - + ;; The interval of checking GitHub. (setq doom-modeline-github-interval (* 30 60)) - + ;; Whether display the modal state icon. ;; Including `evil', `overwrite', `god', `ryo' and `xah-fly-keys', etc. (setq doom-modeline-modal-icon nil) - + ;; Whether display the mu4e notifications. It requires `mu4e-alert' package. (setq doom-modeline-mu4e nil) - + ;; Whether display the gnus notifications. (setq doom-modeline-gnus t) - + ;; Whether gnus should automatically be updated and how often (set to 0 or smaller than 0 to disable) (setq doom-modeline-gnus-timer 2) - + ;; Whether groups should be excludede when gnus automatically being updated. (setq doom-modeline-gnus-excluded-groups '("dummy.group")) - + ;; Whether display the IRC notifications. It requires `circe' or `erc' package. (setq doom-modeline-irc t) - + ;; Function to stylize the irc buffer names. (setq doom-modeline-irc-stylize 'identity) - + ;; Whether display the environment version. (setq doom-modeline-env-version t) ;; Or for individual languages @@ -607,7 +614,7 @@ For every other theme, use load-theme (setq doom-modeline-env-enable-go t) (setq doom-modeline-env-enable-elixir t) (setq doom-modeline-env-enable-rust t) - + ;; Change the executables to use for the language version string (setq doom-modeline-env-python-executable "python") ; or `python-shell-interpreter' (setq doom-modeline-env-ruby-executable "ruby") @@ -615,14 +622,14 @@ For every other theme, use load-theme (setq doom-modeline-env-go-executable "go") (setq doom-modeline-env-elixir-executable "iex") (setq doom-modeline-env-rust-executable "rustc") - + ;; What to dispaly as the version while a new one is being loaded (setq doom-modeline-env-load-string "...") - + ;; Hooks that run before/after the modeline version string is updated (setq doom-modeline-before-update-env-hook nil) (setq doom-modeline-after-update-env-hook nil)) - + (column-number-mode) #+END_SRC @@ -631,7 +638,7 @@ For every other theme, use load-theme #+BEGIN_SRC emacs-lisp (set-face-attribute 'default nil :family "Fira Code" - :height 130 + :height 130 :weight 'normal :width 'normal) @@ -641,7 +648,7 @@ For every other theme, use load-theme (set-fontset-font (frame-parameter nil 'font) 'japanese-jisx0208 - '("Droid Sans Japanese" . "unicode-bmp")) + '("Noto Sans CJK JP" . "unicode-bmp")) #+END_SRC @@ -660,7 +667,7 @@ In order for this to work, the [[https://github.com/tonsky/FiraCode/issues/211#i (use-package dashboard :init (setq dashboard-set-heading-icons t) - (setq dashboard-set-file-icons t) + (setq dashboard-set-file-icons t) (setq dashboard-image-banner-max-height (/ (frame-pixel-height) 3)) (setq dashboard-startup-banner (concat user-emacs-directory "/logo.svg")) @@ -673,13 +680,13 @@ In order for this to work, the [[https://github.com/tonsky/FiraCode/issues/211#i (setq dashboard-projects-switch-function 'counsel-projectile-switch-project-by-name) (dashboard-setup-startup-hook) - + :custom ; (dashboard-banner-logo-title "Execution >> Idea") (dashboard-banner-logo-title "Emacs") :config - (set-face-attribute 'dashboard-banner-logo-title nil :font "Droid Sans" :height 300)) + (set-face-attribute 'dashboard-banner-logo-title nil :font "Noto Sans" :height 300)) #+END_SRC ** Window @@ -694,17 +701,17 @@ In order for this to work, the [[https://github.com/tonsky/FiraCode/issues/211#i #+BEGIN_SRC emacs-lisp (global-display-line-numbers-mode) -(setq +(setq display-line-numbers-type 'relative scroll-margin 5) ;; Disable line numbers for some modes (dolist (mode '(term-mode-hook shell-mode-hook - treemacs-mode-hook + treemacs-mode-hook eshell-mode-hook)) (add-hook mode (lambda () (display-line-numbers-mode 0)))) - + (setq display-line-numbers-type 'relative) @@ -733,7 +740,7 @@ Adds the relative path to the project root into the header (defun lsp-mode-setup () (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) (lsp-headerline-breadcrumb-mode) - + (general-nmap "gr" 'lsp-find-references "gd" 'lsp-find-definition @@ -749,7 +756,7 @@ Adds the relative path to the project root into the header (lsp-mode . lsp-enable-which-key-integration)) :init (setq - lsp-keymap-prefix "C-c l" + lsp-keymap-prefix "C-c l" lsp-completion-provider :capf) :config (setq @@ -763,18 +770,18 @@ Adds the relative path to the project root into the header lsp-modeline-code-actions-enable t lsp-modeline-diagnostics-enable t - lsp-ui-doc-position 'right - lsp-ui-doc-max-height 40 - lsp-ui-doc-enable nil - lsp-ui-sideline-delay 0.05 - lsp-ui-sideline-show-code-actions nil) + lsp-ui-doc-position 'right + lsp-ui-doc-max-height 40 + lsp-ui-doc-enable nil + lsp-ui-sideline-delay 0.05 + lsp-ui-sideline-show-code-actions nil) (lsp-enable-which-key-integration t) - - (add-to-list 'company-backends '(company-capf company-dabbrev)) - :bind ( - :map lsp-mode-map - ("M-RET" . lsp-execute-code-action)) + (add-to-list 'company-backends '(company-capf company-dabbrev)) + + :bind ( + :map lsp-mode-map + ("M-RET" . lsp-execute-code-action)) :general (leader-key "l" (general-simulate-key "C-c l" :which-key "LSP")) @@ -782,23 +789,23 @@ Adds the relative path to the project root into the header ([remap xref-find-references] #'lsp-ui-peek-find-references) ([remap xref-find-definitions] 'lsp-ui-peek-find-definitions) - (leader-key - "j" '(:ignore t :which-key "LSP OWN") - "ja" 'lsp-format-buffer - "jf" 'lsp-format-buffer - "jh" 'lsp-describe-thing-at-point - "jr" 'lsp-restart-workspace - "jd" 'lsp-goto-implementation - "jt" 'lsp-goto-type-definition - "jx" 'lsp-ui-doc-mode - "j " 'lsp-rename) + (leader-key + "j" '(:ignore t :which-key "LSP OWN") + "ja" 'lsp-format-buffer + "jf" 'lsp-format-buffer + "jh" 'lsp-describe-thing-at-point + "jr" 'lsp-restart-workspace + "jd" 'lsp-goto-implementation + "jt" 'lsp-goto-type-definition + "jx" 'lsp-ui-doc-mode + "j " 'lsp-rename) - (general-nmap - "K" 'lsp-ui-doc-glance)) + (general-nmap + "K" 'lsp-ui-doc-glance)) #+END_SRC *** lsp-ui - + All the config for lsp-ui can be found in the lsp block. This is because lsp automatically loads lsp-ui and any code inside this block will not get executed. This is only in order to install lsp-ui. @@ -822,7 +829,7 @@ Mainly used in order to see the tree of objects, functions and so on. Ivy integration for lsp-mode. Mainly used in order to choose from the tree of objects, functions and so on. - + #+BEGIN_SRC emacs-lisp (use-package lsp-ivy :after lsp @@ -836,7 +843,7 @@ Mainly used in order to choose from the tree of objects, functions and so on. :init (setq company-idle-delay 0.1 ; show autocompletion after n seconds company-async-timeout 15 ; completion may be slow - company-tooltip-idle-delay 0.1 + company-tooltip-idle-delay 0.1 company-minimum-prefix-length 1 ; show suggestions after only one character (insted of several) company-tooltip-align-annotations t) @@ -889,19 +896,19 @@ Nice looking completions :config (setq flycheck-highlighting-mode 'lines) - - (set-face-attribute 'flycheck-error nil + + (set-face-attribute 'flycheck-error nil :family "Fira Code" - :background "#773131" + :background "#773131" :weight 'normal :width 'normal) - (set-face-attribute 'flycheck-warning nil + (set-face-attribute 'flycheck-warning nil :family "Fira Code" - :background "#767731" + :background "#767731" :weight 'normal :width 'normal) - + :general (leader-key "!" (general-simulate-key "C-u C-c !" :which-key "Flycheck"))) (global-flycheck-mode 1) @@ -931,10 +938,9 @@ Nice looking completions #+BEGIN_SRC elisp (use-package projectile :init - (setq projectile-project-search-path '("~/git/" - "~/git/temp/" - "~/git/appkom/" - "~/git/pvv/")) + (setq projectile-project-search-path '("~/git/" + "~/pvv/" + "~/work/")) (setq projectile-switch-project-action #'projectile-dired) :custom ((projectile-completion-system 'ivy)) @@ -974,25 +980,25 @@ Nice looking completions #+END_SRC ** REST Client - + restclient ** Search - + Swiper is used for finding local occurences of a word inside a buffer. #+BEGIN_SRC elisp (use-package swiper :general (leader-key - "s" '(swiper :which-key "search"))) + "s" '(swiper :which-key "search"))) #+END_SRC Ag is used for project-wide search ** Snippets - + Yasnippet - + #+BEGIN_SRC emacs-lisp (use-package yasnippet :init (yas-global-mode t) @@ -1045,7 +1051,7 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions- #+END_SRC ** Version Control - + #+BEGIN_SRC emacs-lisp (use-package magit :general (leader-key @@ -1067,8 +1073,8 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions- "gff" '(magit-find-file :which-key "Find file") "gfg" '(magit-find-git-config-file :which-key "Find gitconfig file") "gfc" '(magit-show-commit :which-key "Find commit") - - + + "gl" '(:ignore t :which-key "list") ;; "glg" '(gist-list :which-key "List gists") "glr" '(magit-list-repositories :which-key "List repositories") @@ -1095,14 +1101,27 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions- * Langugages ** C/C++ +** Coq + +#+BEGIN_SRC emacs-lisp +(use-package company-coq + :mode "\\.v\\'" + :after (company) + :hook (coq-mode-hook . company-coq-mode) + :config + (setq + proof-three-window-enable t + coq-prog-args '())) +#+END_SRC + ** Dart / Flutter #+BEGIN_SRC emacs-lisp -(use-package dart-mode - :mode "\\.dart\\'") - -(use-package lsp-dart - :hook 'dart-mode-hook) +;; (use-package dart-mode +;; :mode "\\.dart\\'") +;; +;; (use-package lsp-dart +;; :hook 'dart-mode-hook) #+END_SRC ** Elm @@ -1110,43 +1129,43 @@ https://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions- Major mode for elm #+BEGIN_SRC emacs-lisp -(use-package elm-mode - :mode ("\\.elm\\'" . elm-mode) - :after (company) - :config (add-to-list 'company-backends 'elm-company) - - :general (leader-key elm-mode-map - - "mc" '(:ignore t :which-key "compile") - "mcb" 'elm-compile-buffer - "mcm" 'elm-compile-main - "mct" 'elm-test-project - "mcr" 'elm-reactor - "mcb" 'elm-preview-buffer - "mcp" 'elm-preview-main - - "mh" '(:ignore t :which-key "docs") - "mhd" 'elm-documentation-lookup - "mhh" 'elm-oracle-doc-at-point - "mht" 'elm-oracle-type-at-point - - "m." 'elm-repl-load - "mp" 'elm-repl-push - "md" 'elm-repl-push-decl - - "mi" 'elm-import - "me" 'elm-expose-at-point - "ms" 'elm-sort-imports - "mf" 'elm-format-buffer - "mv" 'elm-package-catalog)) +;;(use-package elm-mode +;; :mode ("\\.elm\\'" . elm-mode) +;; :after (company) +;; :config (add-to-list 'company-backends 'elm-company) +;; +;; :general (leader-key elm-mode-map +;; +;; "mc" '(:ignore t :which-key "compile") +;; "mcb" 'elm-compile-buffer +;; "mcm" 'elm-compile-main +;; "mct" 'elm-test-project +;; "mcr" 'elm-reactor +;; "mcb" 'elm-preview-buffer +;; "mcp" 'elm-preview-main +;; +;; "mh" '(:ignore t :which-key "docs") +;; "mhd" 'elm-documentation-lookup +;; "mhh" 'elm-oracle-doc-at-point +;; "mht" 'elm-oracle-type-at-point +;; +;; "m." 'elm-repl-load +;; "mp" 'elm-repl-push +;; "md" 'elm-repl-push-decl +;; +;; "mi" 'elm-import +;; "me" 'elm-expose-at-point +;; "ms" 'elm-sort-imports +;; "mf" 'elm-format-buffer +;; "mv" 'elm-package-catalog)) #+END_SRC Proper error-providing to flycheck to flycheck #+BEGIN_SRC emacs-lisp -(use-package flycheck-elm - :after (flycheck elm-mode) - :hook (elm-mode-hook . flycheck-elm-setup)) +;;(use-package flycheck-elm +;; :after (flycheck elm-mode) +;; :hook (elm-mode-hook . flycheck-elm-setup)) #+END_SRC LSP mode @@ -1158,7 +1177,7 @@ npm i -g @elm-tooling/elm-language-server #+END_SRC #+BEGIN_SRC emacs-lisp -(add-hook 'elm-mode-hook 'lsp) +;;(add-hook 'elm-mode-hook 'lsp) #+END_SRC ** Emacs Lisp @@ -1176,40 +1195,40 @@ Package for highlighting defined macros/functions/variables/symbols in emacs Major mode for haskell #+BEGIN_SRC emacs-lisp -(use-package haskell-mode - :general (leader-key haskell-mode-map - - "mh" '(haskell-hide-toggle :which-key "hide") - "mH" '(haskell-hide-toggle-all :which-key "hide all") - - "mc" '(:ignore t :which-key "cabal") - "mcf" '(haskell-cabal-visit-file :which-key "cabal file") - "mcb" '(haskell-process-cabal-build :which-key "build"))) +;;(use-package haskell-mode +;; :general (leader-key haskell-mode-map +;; +;; "mh" '(haskell-hide-toggle :which-key "hide") +;; "mH" '(haskell-hide-toggle-all :which-key "hide all") +;; +;; "mc" '(:ignore t :which-key "cabal") +;; "mcf" '(haskell-cabal-visit-file :which-key "cabal file") +;; "mcb" '(haskell-process-cabal-build :which-key "build"))) #+END_SRC Hlint is a linter for suggesting better ways to write certain pieces of code. It requires [[https://github.com/mpickering/apply-refact][apply-refact]] to be installed #+BEGIN_SRC emacs-lisp -(use-package hlint-refactor - :hook (haskell-mode-hook . hlint-refactor-mode) - :general (leader-key haskell-mode-map - "mr" '(hlint-refactor-refactor-buffer :which-key "refactor suggestion"))) +;;(use-package hlint-refactor +;; :hook (haskell-mode-hook . hlint-refactor-mode) +;; :general (leader-key haskell-mode-map +;; "mr" '(hlint-refactor-refactor-buffer :which-key "refactor suggestion"))) #+END_SRC Hindent is a reformatter for properly indenting haskell code (haskell can be quite picky about the indentation, so this is actually pretty useful not only for readability). It requires the hindent executable #+BEGIN_SRC emacs-lisp -(use-package hindent - :hook (haskell-mode-hook . hindent-mode)) +;;(use-package hindent +;; :hook (haskell-mode-hook . hindent-mode)) #+END_SRC #+BEGIN_SRC emacs-lisp -(use-package lsp-haskell - :hook (haskell-mode-hook . lsp) - (haskell-literate-mode-hook . lsp)) +;;(use-package lsp-haskell +;; :hook (haskell-mode-hook . lsp) +;; (haskell-literate-mode-hook . lsp)) #+END_SRC flycheck-haskell? @@ -1222,75 +1241,75 @@ Java LSP using the Eclipse JDT Language server install jdtls from AUR #+BEGIN_SRC emacs-lisp -(use-package lsp-java - :init - ; (setq lsp-java-server-install-dir "/usr/share/java/jdtls/") - (setenv "JAVA_HOME" "/usr/lib/jvm/default") - (setq - lsp-java-java-path (substitute-in-file-name "$JAVA_HOME/bin/java") - lsp-java-jdt-download-url "https://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz") - ; :hook (java-mode-hook . lsp) - :config - (add-hook 'java-mode-hook 'flycheck-mode) - (add-hook 'java-mode-hook 'company-mode) - (add-hook 'java-mode-hook 'lsp) - :general (leader-key java-mode-map - ;; LSP Java commands - "mi" '(lsp-java-organize-imports :which-key "Organize imports") - "mc" '(lsp-java-build-project :which-key "Perform partial or full build for the projects") - ;; lsp-java-update-project-configuration - Update project configuration - ;; lsp-java-actionable-notifications - Resolve actionable notifications - ;; lsp-java-update-user-settings - Update user settings (Check the options in the table bellow.) - ;; lsp-java-update-server - Update server instalation. - "mg" '(:ignore t :which-key "Generate") - "mgs" '(lsp-java-generate-to-string :which-key "Generate toString method") - "mge" '(lsp-java-generate-equals-and-hash-code :which-key "Generate equals and hashCode methods") - "mgo" '(lsp-java-generate-overrides :which-key "Generate method overrides") - "mgg" '(lsp-java-generate-getters-and-setters :which-key "Generate getters and setters") - ;; Refactoring - ;; LSP Java provides rich set of refactorings via Eclipse JDT Language Server code actions and some of them are bound to Emacs commands: - - "mr" '(:ignore t :which-key "Refactor") - "mr" '(lsp-java-extract-to-constant :which-key "Extract constant refactoring") - "mr" '(lsp-java-add-unimplemented-methods :which-key "Extract constant refactoring") - "mr" '(lsp-java-create-parameter :which-key "Create parameter refactoring") - "mr" '(lsp-java-create-field :which-key "Create field refactoring") - "mr" '(lsp-java-create-local :which-key "Create local refactoring") - "mr" '(lsp-java-extract-method :which-key "Extract method refactoring") - "mr" '(lsp-java-add-import :which-key "Add missing import") - - ;; Testing support - "mt" '(:ignore t :which-key "JUnit") - "mtr" '(lsp-jt-report-open :which-key "open test report") - "mtb" '(lsp-jt-browser :which-key "Browse tests and run/debug them.") - ;; ^^^ ** Use x to run the test(s) under point; d to debug the tests under point. R to refresh. ** Support for GUI operations. - "mtl" '(lsp-jt-lens-mode :which-key "test lenses mode") - - ;; Dependency viewer - "md" '(lsp-java-dependency-list :which-key "View java dependencies"))) +;;(use-package lsp-java +;; :init +;; ; (setq lsp-java-server-install-dir "/usr/share/java/jdtls/") +;; (setenv "JAVA_HOME" "/usr/lib/jvm/default") +;; (setq +;; lsp-java-java-path (substitute-in-file-name "$JAVA_HOME/bin/java") +;; lsp-java-jdt-download-url "https://download.eclipse.org/jdtls/snapshots/jdt-language-server-latest.tar.gz") +;; ; :hook (java-mode-hook . lsp) +;; :config +;; (add-hook 'java-mode-hook 'flycheck-mode) +;; (add-hook 'java-mode-hook 'company-mode) +;; (add-hook 'java-mode-hook 'lsp) +;; :general (leader-key java-mode-map +;; ;; LSP Java commands +;; "mi" '(lsp-java-organize-imports :which-key "Organize imports") +;; "mc" '(lsp-java-build-project :which-key "Perform partial or full build for the projects") +;; ;; lsp-java-update-project-configuration - Update project configuration +;; ;; lsp-java-actionable-notifications - Resolve actionable notifications +;; ;; lsp-java-update-user-settings - Update user settings (Check the options in the table bellow.) +;; ;; lsp-java-update-server - Update server instalation. +;; "mg" '(:ignore t :which-key "Generate") +;; "mgs" '(lsp-java-generate-to-string :which-key "Generate toString method") +;; "mge" '(lsp-java-generate-equals-and-hash-code :which-key "Generate equals and hashCode methods") +;; "mgo" '(lsp-java-generate-overrides :which-key "Generate method overrides") +;; "mgg" '(lsp-java-generate-getters-and-setters :which-key "Generate getters and setters") +;; ;; Refactoring +;; ;; LSP Java provides rich set of refactorings via Eclipse JDT Language Server code actions and some of them are bound to Emacs commands: +;; +;; "mr" '(:ignore t :which-key "Refactor") +;; "mr" '(lsp-java-extract-to-constant :which-key "Extract constant refactoring") +;; "mr" '(lsp-java-add-unimplemented-methods :which-key "Extract constant refactoring") +;; "mr" '(lsp-java-create-parameter :which-key "Create parameter refactoring") +;; "mr" '(lsp-java-create-field :which-key "Create field refactoring") +;; "mr" '(lsp-java-create-local :which-key "Create local refactoring") +;; "mr" '(lsp-java-extract-method :which-key "Extract method refactoring") +;; "mr" '(lsp-java-add-import :which-key "Add missing import") +;; +;; ;; Testing support +;; "mt" '(:ignore t :which-key "JUnit") +;; "mtr" '(lsp-jt-report-open :which-key "open test report") +;; "mtb" '(lsp-jt-browser :which-key "Browse tests and run/debug them.") +;; ;; ^^^ ** Use x to run the test(s) under point; d to debug the tests under point. R to refresh. ** Support for GUI operations. +;; "mtl" '(lsp-jt-lens-mode :which-key "test lenses mode") +;; +;; ;; Dependency viewer +;; "md" '(lsp-java-dependency-list :which-key "View java dependencies"))) #+END_SRC Maven integration #+BEGIN_SRC emacs-lisp - (use-package maven-test-mode - :hook (java-mode-hook . maven-test-mode) - ;; (spacemacs/declare-prefix-for-mode 'java-mode "mm" "maven") - ;; (spacemacs/declare-prefix-for-mode 'java-mode "mmg" "goto") - ;; (spacemacs/declare-prefix-for-mode 'java-mode "mmt" "tests")) - ;; :config - ;; (progn - ;; (spacemacs|hide-lighter maven-test-mode) - ;; (spacemacs/set-leader-keys-for-minor-mode 'maven-test-mode - :general (leader-key maven-test-mode-map - "mm" '(:ignore t :which-key "Maven") - "mmga" 'maven-test-toggle-between-test-and-class - "mmgA" 'maven-test-toggle-between-test-and-class-other-window - "mmta" 'maven-test-all - "mmt C-a" 'maven-test-clean-test-all - "mmtb" 'maven-test-file - "mmti" 'maven-test-install - "mmtt" 'maven-test-method)) +;; (use-package maven-test-mode +;; :hook (java-mode-hook . maven-test-mode) +;; ;; (spacemacs/declare-prefix-for-mode 'java-mode "mm" "maven") +;; ;; (spacemacs/declare-prefix-for-mode 'java-mode "mmg" "goto") +;; ;; (spacemacs/declare-prefix-for-mode 'java-mode "mmt" "tests")) +;; ;; :config +;; ;; (progn +;; ;; (spacemacs|hide-lighter maven-test-mode) +;; ;; (spacemacs/set-leader-keys-for-minor-mode 'maven-test-mode +;; :general (leader-key maven-test-mode-map +;; "mm" '(:ignore t :which-key "Maven") +;; "mmga" 'maven-test-toggle-between-test-and-class +;; "mmgA" 'maven-test-toggle-between-test-and-class-other-window +;; "mmta" 'maven-test-all +;; "mmt C-a" 'maven-test-clean-test-all +;; "mmtb" 'maven-test-file +;; "mmti" 'maven-test-install +;; "mmtt" 'maven-test-method)) #+END_SRC #+BEGIN_SRC emacs-lisp @@ -1298,7 +1317,7 @@ Maven integration #+END_SRC -malabar-mode +malabar-mode emacs-eclim ? @@ -1307,11 +1326,11 @@ emacs-eclim ? Typescript mode and hook for activating lsp #+BEGIN_SRC emacs-lisp -(use-package typescript-mode - :mode "\\.ts\\'" - :hook (typescript-mode . lsp) - :config - (setq typescript-indent-level 2)) +;;(use-package typescript-mode +;; :mode "\\.ts\\'" +;; :hook (typescript-mode . lsp) +;; :config +;; (setq typescript-indent-level 2)) #+END_SRC Install lsp server with @@ -1322,25 +1341,25 @@ npm i -g typescript-language-server; npm i -g typescript js2-mode js-doc -js2-refactor +js2-refactor npm.el ** Json #+BEGIN_SRC emacs-lisp -(use-package json-mode - :mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" - :hook (json-mode . lsp) - ; :config - ; (set-electric! 'json-mode :chars '(?\n ?: ?{ ?})) - :general (leader-key json-mode-map - "mp" '(json-mode-show-path :which-key "Copy path") - "mt" 'json-toggle-boolean - "md" 'json-mode-kill-path - "mx" 'json-nullify-sexp - "m+" 'json-increment-number-at-point - "m-" 'json-decrement-number-at-point - "mf" 'json-mode-beautify)) +;;(use-package json-mode +;; :mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" +;; :hook (json-mode . lsp) +;; ; :config +;; ; (set-electric! 'json-mode :chars '(?\n ?: ?{ ?})) +;; :general (leader-key json-mode-map +;; "mp" '(json-mode-show-path :which-key "Copy path") +;; "mt" 'json-toggle-boolean +;; "md" 'json-mode-kill-path +;; "mx" 'json-nullify-sexp +;; "m+" 'json-increment-number-at-point +;; "m-" 'json-decrement-number-at-point +;; "mf" 'json-mode-beautify)) #+END_SRC (use-package! counsel-jq @@ -1353,102 +1372,102 @@ npm.el "s" #'counsel-jq)) ** LaTeX - + AUCTeX The reason the package is called "tex" and not "auctex" is explained [[https://emacs.stackexchange.com/questions/41321/when-to-specify-a-package-name-in-use-packages-ensure-tag/41324#41324][here]] - + #+BEGIN_SRC emacs-lisp -(use-package tex - ;; :after (pdf-tools) - :ensure auctex - :mode ("\\.tex\\'" . LaTeX-mode) - :config - (setq - TeX-source-correlate-method 'synctex - TeX-source-correlate-start-server t - TeX-auto-save t - TeX-parse-self t - ; reftex-plug-into-AUCTeX t - TeX-PDF-mode t) ; Use PDF instead of DVI - - (setq-default - TeX-master "main.tex" - TeX-engine 'default) ; default | xetex | luatex - - (TeX-source-correlate-mode t) ; - - (add-hook 'LaTeX-mode-hook - (lambda () - (reftex-mode t) - (flyspell-mode t))) - - :general (leader-key - "mc" '(TeX-command-run-all :which-key "Compile") - "me" '(TeX-engine-set :which-key "Set engine") - "mv" '(TeX-view :which-key "view"))) +;;(use-package tex +;; ;; :after (pdf-tools) +;; :ensure auctex +;; :mode ("\\.tex\\'" . LaTeX-mode) +;; :config +;; (setq +;; TeX-source-correlate-method 'synctex +;; TeX-source-correlate-start-server t +;; TeX-auto-save t +;; TeX-parse-self t +;; ; reftex-plug-into-AUCTeX t +;; TeX-PDF-mode t) ; Use PDF instead of DVI +;; +;; (setq-default +;; TeX-master "main.tex" +;; TeX-engine 'default) ; default | xetex | luatex +;; +;; (TeX-source-correlate-mode t) ; +;; +;; (add-hook 'LaTeX-mode-hook +;; (lambda () +;; (reftex-mode t) +;; (flyspell-mode t))) +;; +;; :general (leader-key +;; "mc" '(TeX-command-run-all :which-key "Compile") +;; "me" '(TeX-engine-set :which-key "Set engine") +;; "mv" '(TeX-view :which-key "view"))) #+END_SRC - + Completions for AUCTeX #+BEGIN_SRC emacs-lisp -(use-package company-auctex - :after auctex - :hook LaTeX-mode - :config - (company-auctex-init) - (add-to-list 'company-backends 'company-yasnippet) - (company-mode)) - - ;; :config - ;; (add-to-list '+latex--company-backends #'company-auctex-environments nil #'eq) - ;; (add-to-list '+latex--company-backends #'company-auctex-macros nil #'eq)) +;; (use-package company-auctex +;; :after auctex +;; :hook LaTeX-mode +;; :config +;; (company-auctex-init) +;; (add-to-list 'company-backends 'company-yasnippet) +;; (company-mode)) +;; +;; ;; :config +;; ;; (add-to-list '+latex--company-backends #'company-auctex-environments nil #'eq) +;; ;; (add-to-list '+latex--company-backends #'company-auctex-macros nil #'eq)) #+END_SRC Support for compiling documents with the LaTeXmk tool #+BEGIN_SRC emacs-lisp -(use-package auctex-latexmk - :after auctex - (auctex-latexmk-setup) - (setq auctex-latexmk-inherit-TeX-PDF-mode t)) +;; (use-package auctex-latexmk +;; :after auctex +;; (auctex-latexmk-setup) +;; (setq auctex-latexmk-inherit-TeX-PDF-mode t)) #+END_SRC PDF viewer #+BEGIN_SRC emacs-lisp -(use-package pdf-tools - ;; :hook - - ;; (add-hook 'pdf-view-mode-hook (lambda () - ;; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs - :init - ;; (pdf-tools-install) - (setq - TeX-view-program-selection '((output-pdf "pdf-tools")) - TeX-view-program-list '(("pdf-tools" "TeX-pdf-tools-sync-view"))) - - :config - (setq-default pdf-view-display-size 'fit-page) - (setq pdf-annot-activate-created-annotations t) - - (add-hook 'TeX-after-compilation-finished-functions ;; Update PDF buffers after successful LaTeX runs - #'TeX-revert-document-buffer) - - :general (leader-key pdf-view-mode-map - "mf" 'isearch-forward - "mb" 'isearch-backward)) +;; (use-package pdf-tools +;; ;; :hook +;; +;; ;; (add-hook 'pdf-view-mode-hook (lambda () +;; ;; (bms/pdf-midnite-amber))) ; automatically turns on midnight-mode for pdfs +;; :init +;; ;; (pdf-tools-install) +;; (setq +;; TeX-view-program-selection '((output-pdf "pdf-tools")) +;; TeX-view-program-list '(("pdf-tools" "TeX-pdf-tools-sync-view"))) +;; +;; :config +;; (setq-default pdf-view-display-size 'fit-page) +;; (setq pdf-annot-activate-created-annotations t) +;; +;; (add-hook 'TeX-after-compilation-finished-functions ;; Update PDF buffers after successful LaTeX runs +;; #'TeX-revert-document-buffer) +;; +;; :general (leader-key pdf-view-mode-map +;; "mf" 'isearch-forward +;; "mb" 'isearch-backward)) #+END_SRC Some functions to help with efficient writing of environments etc. #+BEGIN_SRC emacs-lisp -(use-package cdlatex - :general (leader-key - "mis" 'cdlatex-sub-superscript - "mip" 'cdlatex-lr-pair - "mie" 'cdlatex-environment)) -#+END_SRC +;; (use-package cdlatex +;; :general (leader-key +;; "mis" 'cdlatex-sub-superscript +;; "mip" 'cdlatex-lr-pair +;; "mie" 'cdlatex-environment)) +#+END_SRC Preview math inside the buffer @@ -1470,24 +1489,24 @@ Preview pane Some math functions #+BEGIN_SRC emacs-lisp -(leader-key LaTeX-mode-map - "mm" '(:ignore t :which-key "Insert math") - "mm^" '(LaTeX-math-wedge :which-key "∧") - "mmv" '(LaTeX-math-vee :which-key "∨") - "mm=>" '(LaTeX-math-Rightarrow :which-key "=>") - "mm->" '(LaTeX-math-rightarrow :which-key "->") - "mm<==" '(LaTeX-math-Leftarrow :which-key "<=") - "mm<-" '(LaTeX-math-leftarrow :which-key "<-") - "mm<=>" '(LaTeX-math-Leftrightarrow :which-key "<=>") - "mm==" '(LaTeX-math-equiv :which-key "≡") - "mm!=" '(LaTeX-math-neq :which-key "≠") - "mmn" '(LaTeX-math-neg :which-key "¬") - "mma" '(LaTeX-math-forall :which-key "∀") - "mme" '(LaTeX-math-exists :which-key "∃") - "mmt" '(LaTeX-math-top :which-key "⊤") - "mmT" '(LaTeX-math-bot :which-key "⊥") - "mm." '(LaTeX-math-therefore :which-key "∴") - "mm," '(LaTeX-math-because :which-key "∵")) +;; (leader-key LaTeX-mode-map +;; "mm" '(:ignore t :which-key "Insert math") +;; "mm^" '(LaTeX-math-wedge :which-key "∧") +;; "mmv" '(LaTeX-math-vee :which-key "∨") +;; "mm=>" '(LaTeX-math-Rightarrow :which-key "=>") +;; "mm->" '(LaTeX-math-rightarrow :which-key "->") +;; "mm<==" '(LaTeX-math-Leftarrow :which-key "<=") +;; "mm<-" '(LaTeX-math-leftarrow :which-key "<-") +;; "mm<=>" '(LaTeX-math-Leftrightarrow :which-key "<=>") +;; "mm==" '(LaTeX-math-equiv :which-key "≡") +;; "mm!=" '(LaTeX-math-neq :which-key "≠") +;; "mmn" '(LaTeX-math-neg :which-key "¬") +;; "mma" '(LaTeX-math-forall :which-key "∀") +;; "mme" '(LaTeX-math-exists :which-key "∃") +;; "mmt" '(LaTeX-math-top :which-key "⊤") +;; "mmT" '(LaTeX-math-bot :which-key "⊥") +;; "mm." '(LaTeX-math-therefore :which-key "∴") +;; "mm," '(LaTeX-math-because :which-key "∵")) #+END_SRC ;; Nicely indent lines that have wrapped when visual line mode is activated @@ -1527,69 +1546,69 @@ Some math functions :defer t :init (add-to-list '+latex--company-backends #'+latex-symbols-company-backend nil #'eq)) - + *** NTNU style macros - + - [ ] TODO: add support for indentation - + #+BEGIN_SRC emacs-lisp (defun ntnu/expand-truth-table () (interactive) (save-excursion (let - (start - end - (l/rep (lambda (pat repl) - (setq - start (evil-range-beginning (evil-visual-range)) + (start + end + (l/rep (lambda (pat repl) + (setq + start (evil-range-beginning (evil-visual-range)) end (evil-range-end (evil-visual-range))) (replace-regexp pat repl nil start end)))) - ;; (evil-ex-substitute start end '("[tT]") "\\\\T" '("g"))))) - (funcall l/rep "[tT]" "\\\\T") - (funcall l/rep "[fF]" "\\\\F") - (funcall l/rep " " " & ") - (funcall l/rep "$" " \\\\\\\\")))) + ;; (evil-ex-substitute start end '("[tT]") "\\\\T" '("g"))))) + (funcall l/rep "[tT]" "\\\\T") + (funcall l/rep "[fF]" "\\\\F") + (funcall l/rep " " " & ") + (funcall l/rep "$" " \\\\\\\\")))) #+END_SRC ** Lua ** Markdown #+BEGIN_SRC emacs-lisp -(use-package markdown-mode - :commands (markdown-mode gfm-mode) - :mode (("README\\.md\\'" . gfm-mode) - ("\\.md\\'" . markdown-mode) - ("\\.markdown\\'" . markdown-mode)) - :init - (setq markdown-enable-math t ; syntax highlighting for latex fragments - markdown-enable-wiki-links t - markdown-italic-underscore t - markdown-asymmetric-header t - markdown-fontify-code-blocks-natively t - markdown-gfm-additional-languages '("sh") - markdown-make-gfm-checkboxes-buttons t - markdown-content-type "application/xhtml+xml" - markdown-css-paths - ; markdown-command "multimarkdown" - '("https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css" - "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/github.min.css") - markdown-xhtml-header-content - (concat "" - "" - "" - "" - "")) - :general (leader-key markdown-mode-map - "m'" 'markdown-edit-code-block - "mo" 'markdown-open - "mp" 'markdown-preview - "me" 'markdown-export - ; "mp" 'grip-mode) - - "mi" '(:ignore t :which-key "insert") - ; "mit" 'markdown-toc-generate-toc - "mii" 'markdown-insert-image - "mil" 'markdown-insert-link)) +;;(use-package markdown-mode +;; :commands (markdown-mode gfm-mode) +;; :mode (("README\\.md\\'" . gfm-mode) +;; ("\\.md\\'" . markdown-mode) +;; ("\\.markdown\\'" . markdown-mode)) +;; :init +;; (setq markdown-enable-math t ; syntax highlighting for latex fragments +;; markdown-enable-wiki-links t +;; markdown-italic-underscore t +;; markdown-asymmetric-header t +;; markdown-fontify-code-blocks-natively t +;; markdown-gfm-additional-languages '("sh") +;; markdown-make-gfm-checkboxes-buttons t +;; markdown-content-type "application/xhtml+xml" +;; markdown-css-paths +;; ; markdown-command "multimarkdown" +;; '("https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css" +;; "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/styles/github.min.css") +;; markdown-xhtml-header-content +;; (concat "" +;; "" +;; "" +;; "" +;; "")) +;; :general (leader-key markdown-mode-map +;; "m'" 'markdown-edit-code-block +;; "mo" 'markdown-open +;; "mp" 'markdown-preview +;; "me" 'markdown-export +;; ; "mp" 'grip-mode) +;; +;; "mi" '(:ignore t :which-key "insert") +;; ; "mit" 'markdown-toc-generate-toc +;; "mii" 'markdown-insert-image +;; "mil" 'markdown-insert-link)) #+END_SRC ** Python @@ -1597,7 +1616,7 @@ Some math functions Major mode for python #+BEGIN_SRC emacs-lisp -(use-package python-mode) +;; (use-package python-mode) #+END_SRC Palintirs python LSP server @@ -1605,29 +1624,29 @@ Palintirs python LSP server To be installed from the arch community repos: python-language-server #+BEGIN_SRC emacs-lisp -(setq lsp-pyls-plugins-autopep8-enabled nil) -(setq lsp-pyls-plugins-yapf-enabled t) -(add-hook 'python-mode-hook 'lsp) +;; (setq lsp-pyls-plugins-autopep8-enabled nil) +;; (setq lsp-pyls-plugins-yapf-enabled t) +;; (add-hook 'python-mode-hook 'lsp) #+END_SRC #+BEGIN_SRC emacs-lisp -(defun prettify-python () - (set-face-attribute font-lock-keyword-face nil :font "CMU Serif" :slant 'italic :height 160) - (setq prettify-symbols-alist '( - ("def" . "f") - ("lambda" . "λ") - ("delta" . "Δ") - ("for" . "∀") - ("not in" . "∉") - ("in" . "∈") - ("return" . "→") - ("->" . "→") - ("\\n" . "⏎") - ("!=" . "≠") - ("not" . "¬") - ("and" . "^") - ("or" . "∨") - ("pi" . "π")))) +;; (defun prettify-python () +;; (set-face-attribute font-lock-keyword-face nil :font "CMU Serif" :slant 'italic :height 160) +;; (setq prettify-symbols-alist '( +;; ("def" . "f") +;; ("lambda" . "λ") +;; ("delta" . "Δ") +;; ("for" . "∀") +;; ("not in" . "∉") +;; ("in" . "∈") +;; ("return" . "→") +;; ("->" . "→") +;; ("\\n" . "⏎") +;; ("!=" . "≠") +;; ("not" . "¬") +;; ("and" . "^") +;; ("or" . "∨") +;; ("pi" . "π")))) ;; (add-hook 'python-mode-hook 'prettify-symbols-mode) ;; (add-hook 'python-mode-hook 'prettify-python) @@ -1637,48 +1656,48 @@ To be installed from the arch community repos: python-language-server ** Rust #+BEGIN_SRC emacs-lisp -(use-package rustic - :bind (:map rustic-mode-map - ("M-j" . lsp-ui-imenu) - ("M-?" . lsp-find-references) - ("C-c C-c l" . flycheck-list-errors) - ("C-c C-c a" . lsp-execute-code-action) - ("C-c C-c r" . lsp-rename) - ("C-c C-c q" . lsp-workspace-restart) - ("C-c C-c Q" . lsp-workspace-shutdown) - ("C-c C-c s" . lsp-rust-analyzer-status)) - :config - ;; uncomment for less flashiness - ;; (setq lsp-eldoc-hook nil) - ;; (setq lsp-enable-symbol-highlighting nil) - ;; (setq lsp-signature-auto-activate nil) - - ;; comment to disable rustfmt on save - (setq rustic-format-on-save t) - (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook)) - -(defun rk/rustic-mode-hook () - ;; so that run C-c C-c C-r works without having to confirm, but don't try to - ;; save rust buffers that are not file visiting. Once - ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should - ;; no longer be necessary. - (when buffer-file-name - (setq-local buffer-save-without-query t))) +;; (use-package rustic +;; :bind (:map rustic-mode-map +;; ("M-j" . lsp-ui-imenu) +;; ("M-?" . lsp-find-references) +;; ("C-c C-c l" . flycheck-list-errors) +;; ("C-c C-c a" . lsp-execute-code-action) +;; ("C-c C-c r" . lsp-rename) +;; ("C-c C-c q" . lsp-workspace-restart) +;; ("C-c C-c Q" . lsp-workspace-shutdown) +;; ("C-c C-c s" . lsp-rust-analyzer-status)) +;; :config +;; ;; uncomment for less flashiness +;; ;; (setq lsp-eldoc-hook nil) +;; ;; (setq lsp-enable-symbol-highlighting nil) +;; ;; (setq lsp-signature-auto-activate nil) +;; +;; ;; comment to disable rustfmt on save +;; (setq rustic-format-on-save t) +;; (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook)) +;; +;; (defun rk/rustic-mode-hook () +;; ;; so that run C-c C-c C-r works without having to confirm, but don't try to +;; ;; save rust buffers that are not file visiting. Once +;; ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should +;; ;; no longer be necessary. +;; (when buffer-file-name +;; (setq-local buffer-save-without-query t))) #+END_SRC -flycheck-rust +flycheck-rust cargo.el - Cargo support for Emacs. ** Shellscripts ** Yaml ** Web-dev - - #+BEGIN_SRC emacs-lisp - (use-package emmet-mode - :hook (sgml-mode-hook . emmet-mode) - (html-mode-hook . emmet-mode) - (css-mode-hook . emmet-mode)) - #+END_SRC + +#+BEGIN_SRC emacs-lisp +;; (use-package emmet-mode +;; :hook (sgml-mode-hook . emmet-mode) +;; (html-mode-hook . emmet-mode) +;; (css-mode-hook . emmet-mode)) +#+END_SRC web-m @@ -1718,8 +1737,8 @@ web-m #+END_SRC ** Multiple Cursors - -evil-mc + +evil-mc #+BEGIN_SRC emacs-lisp ;; (use-package multiple-cursors @@ -1755,11 +1774,11 @@ evil-mc #+BEGIN_SRC emacs-lisp (use-package treemacs - + :init (with-eval-after-load 'winum (define-key winum-keymap (kbd "M-0") 'treemacs-select-window)) - + :config (progn (setq treemacs-collapse-dirs (if (executable-find "python") 3 0) @@ -1804,7 +1823,7 @@ evil-mc (treemacs-git-mode 'deferred)) (`(t . _) (treemacs-git-mode 'simple)))) - + :bind (:map global-map ("M-0" . treemacs-select-window) @@ -1813,12 +1832,12 @@ evil-mc ("C-x t B" . treemacs-bookmark) ("C-x t C-t" . treemacs-find-file) ("C-x t M-t" . treemacs-find-tag))) - + :general (leader-key "t" '(:ignore t :which-key "treemacs") "tt" 'treemacs) #+END_SRC - + Evil navigation #+BEGIN_SRC emacs-lisp @@ -1832,7 +1851,7 @@ Projectile integration (use-package treemacs-projectile :after (treemacs projectile)) #+END_SRC - + LSP integration #+BEGIN_SRC emacs-lisp @@ -1860,13 +1879,13 @@ Icons for dired #+BEGIN_SRC emacs-lisp (use-package which-key - :config + :config (setq which-key-idle-delay 0.3) (setq which-key-popup-type 'frame) (which-key-mode) (which-key-setup-side-window-right-bottom) ; (which-key-setup-minibuffer) - (set-face-attribute 'which-key-local-map-description-face nil + (set-face-attribute 'which-key-local-map-description-face nil :weight 'bold)) #+END_SRC @@ -1931,12 +1950,12 @@ Make a header comment using the [[https://github.com/cacalabs/toilet][toilet]] u #+BEGIN_SRC emacs-lisp ;; (use-package! flycheck-popup-tip ;; :config (flycheck-popup-tip-error-prefix "E -> ")) -;; +;; ;; (defun scroll-error-up () ;; (interactive) ;; (message (prin1-to-string flycheck-popup-tip-object)) ;; (popup-scroll-up flycheck-popup-tip-object)) -;; +;; ;; (defun scroll-error-down () ;; (interactive) ;; (popup-scroll-down flycheck-popup-tip-object)) @@ -1983,7 +2002,7 @@ Doom bindings: https://github.com/hlissner/doom-emacs/blob/develop/modules/confi https://github.com/hlissner/doom-emacs/blob/develop/modules/config/default/%2Bevil-bindings.el ** Youtube - + *** System crafters Most of the config is made with great help from a video series made by System Crafters called "Emacs from Scratch" Config: https://github.com/daviwil/emacs-from-scratch @@ -2003,14 +2022,14 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el *** Prioritized [1/5] - [-] IDE stuff [3/5] - [ ] magit [0/1] - - [ ] evil keybindings + - [ ] evil keybindings - [-] company-mode [2/6] - - [X] LSP integration - - [X] open on CTRL-SPC - - [ ] scroll with M-[jk] - - [ ] close on enter - - [ ] Path autocompletion company - - [ ] Yasnippets in company + - [X] LSP integration + - [X] open on CTRL-SPC + - [ ] scroll with M-[jk] + - [ ] close on enter + - [ ] Path autocompletion company + - [ ] Yasnippets in company - [X] helpful - [X] projectile - [X] flycheck @@ -2034,10 +2053,10 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el - [X] conceal levels (prettify-symbols) - [X] snippets - [ ] bibtex [0/1] - - [ ] set up reftex + - [ ] set up reftex - [ ] Castel like way of opening geogebra/inkscape - [X] Shortcut to config files - - [ ] Add toggler for menubar + - [ ] Add toggler for menubar *** Fix LSP mode [1/4] - [X] Fix LSP UI @@ -2052,7 +2071,7 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el - [ ] toggle breadcrumb - [ ] peek-definitions - [ ] peek-references - - [ ] lsp-ui-imenu + - [ ] lsp-ui-imenu - [-] Fix some languages [3/8] - [X] Elm - [X] Java @@ -2063,7 +2082,7 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el - [ ] Yaml - [ ] Json - [ ] Toggle error modes in flycheck (warnings, suggestions, errors, ...) - + *** Research [1/2] - [-] Research org mode [3/5] - [X] How to add agenda entries @@ -2076,20 +2095,20 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el - [X] Research yasnippets [2/2] - [X] How to add language specific snippets? - [X] Snippet format - + *** Smaller tasks [1/9] - - [ ] remove star buffers from tab line -> https://www.emacswiki.org/emacs/TabBarMode - - [ ] make :q close a window [delete-window] whenever there is more than one window (except treemacs) + - [ ] remove star buffers from tab line -> https://www.emacswiki.org/emacs/TabBarMode + - [ ] make :q close a window [delete-window] whenever there is more than one window (except treemacs) - [ ] solve drag mode in org mode (conflict with evil-org dragging) - [-] Dired / *messages* leader-key usage - - [ ] Dired - - [X] *messages* + - [ ] Dired + - [X] *messages* - [ ] Fix esc key - [ ] ag-search-file - [X] Lambda conceal - - [ ] remove collision between fira-code-mode and prettify-symbols - - [ ] disable next-buffer/pre in treemacs-mode-map (if exists?) - + - [ ] remove collision between fira-code-mode and prettify-symbols + - [ ] disable next-buffer/pre in treemacs-mode-map (if exists?) + *** Less Prioritized [1/10] - [X] Make a nice dashboard - [ ] Customize dashboard-heading face size (and maybe font type?) @@ -2128,7 +2147,7 @@ https://github.com/suyashbire1/emacs.d/blob/master/init.el - [ ] lookup -;; Local Variables: -;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Reload?")(load-file user-init-file))) nil t) -;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Tangle?")(org-babel-tangle))) nil t) +;; Local Variables: +;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Reload?")(load-file user-init-file))) nil t) +;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Tangle?")(org-babel-tangle))) nil t) ;; End: