diff options
author | Matthew Kosarek <matthew@matthewkosarek.xyz> | 2024-01-01 15:55:56 -0500 |
---|---|---|
committer | Matthew Kosarek <matthew@matthewkosarek.xyz> | 2024-01-01 15:55:56 -0500 |
commit | 0b2c26b0e1fb7aaafcd2bf656b739d9b7223bc65 (patch) | |
tree | 4def5d6e13abca5557c4ff433da8581d3cff4422 | |
parent | 12668c7677e70abf2f9e336f5c2e35d253faa671 (diff) |
oodles of improvements, I don't even know anymore!
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | init.el | 7 | ||||
-rw-r--r-- | lisp/cpp.el | 13 | ||||
-rw-r--r-- | lisp/general.el | 46 | ||||
-rw-r--r-- | lisp/mk.el | 4 | ||||
-rw-r--r-- | lisp/org-custom.el | 2 |
6 files changed, 66 insertions, 9 deletions
@@ -22,4 +22,5 @@ request games eln-cache .projectile -session.*
\ No newline at end of file +session.* +emojis
\ No newline at end of file @@ -38,8 +38,9 @@ (use-package autothemer :ensure t) -(load-file "~/.emacs.d/lisp/kanagawa-theme.el") -(load-theme 'kanagawa t) +(load-theme 'modus-operandi) +;(load-file "~/.emacs.d/lisp/kanagawa-theme.el") +;(load-theme 'kanagawa t) ;; (use-package material-theme ;; :ensure t ;; :config @@ -75,7 +76,7 @@ '(custom-safe-themes '("a6f9dd4844bfbfaf1162f04ae3c52070154ef28d18b5d482566015cf429492b0" "f149d9986497e8877e0bd1981d1bef8c8a6d35be7d82cba193ad7e46f0989f6a" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" default)) '(package-selected-packages - '(meson-mode eglot autothemer pyenv-mode pyvenv plantuml-mode ledger-mode centered-window perfect-margin-mode org-download helm-rg htmlize mood-line org-super-agenda material-theme esup glsl-mode fast-scroll yasnippet-snippets jsdoc helm-slack slack smart-mode-line magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2)) + '(dart-mode yaml-mode meson-mode eglot autothemer pyenv-mode pyvenv plantuml-mode ledger-mode centered-window perfect-margin-mode org-download helm-rg htmlize mood-line org-super-agenda material-theme esup glsl-mode fast-scroll yasnippet-snippets jsdoc helm-slack slack smart-mode-line magit rust-mode xref-js2 web-mode vterm-toggle vscode-dark-plus-theme treemacs-projectile tree-sitter-langs tide tern smartparens rtags req-package rainbow-mode pythonic python-mode perfect-margin org-roam org-notify org-modern org-bullets org-alert minimap markdown-mode json-mode js2-refactor js2-highlight-vars js-doc ido-vertical-mode hl-todo highlight-thing highlight-indent-guides helm-projectile helm-posframe helm-ag good-scroll go-mode git-gutter-fringe git-commit flycheck-irony evil eslint-fix emojify eldoc-box drag-stuff doom-themes dashboard css-eldoc counsel company-quickhelp company-irony cmake-mode cmake-ide auctex all-the-icons ac-js2)) '(safe-local-variable-values '((js-indent-level . 4))) '(warning-suppress-types '((comp)))) (custom-set-faces diff --git a/lisp/cpp.el b/lisp/cpp.el index 5bb04a8..eb7660e 100644 --- a/lisp/cpp.el +++ b/lisp/cpp.el @@ -13,15 +13,22 @@ (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-cont-non-empty '+) (c-set-offset 'argslist-close '+) + (c-set-offset 'statement-cont 0) ) (add-hook 'c-mode-common-hook 'setup-c) -(defun create-cpp-class() - "Create a cpp class." - (interactive "Enter the name of the class: ") +(defun mk/cpp/generate-compile-commands-cmake() + "Regenerates a compile_commands.json database" + (interactive) + (shell-command (format "cd %s && cmake -S . -B build -D CMAKE_EXPORT_COMPILE_COMMANDS=1" (projectile-project-root))) ) +(defun maybe-regenerate-compile-commands() + (if (string= (buffer-file-name) "CMakeLists.txt") + (mk/cpp/generate-compile-commands-cmake))) + +(add-hook 'after-save-hook 'maybe-regenerate-compile-commands) (provide 'cpp) ;;; cpp.el ends here diff --git a/lisp/general.el b/lisp/general.el index 9b3f6c9..4b51b9b 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -32,6 +32,33 @@ :weight 'normal :width 'normal) +; Taken from: https://emacs.stackexchange.com/questions/55059/ligatures-with-the-jetbrains-mono-font +(defconst jetbrains-ligature-mode--ligatures + '("-->" "//" "/**" "/*" "*/" "<!--" ":=" "->>" "<<-" "->" "<-" + "<=>" "==" "!=" "<=" ">=" "=:=" "!==" "&&" "||" "..." ".." + "|||" "///" "&&&" "===" "++" "--" "=>" "|>" "<|" "||>" "<||" + "|||>" "<|||" ">>" "<<" "::=" "|]" "[|" "{|" "|}" + "[<" ">]" ":?>" ":?" "/=" "[||]" "!!" "?:" "?." "::" + "+++" "??" "###" "##" ":::" "####" ".?" "?=" "=!=" "<|>" + "<:" ":<" ":>" ">:" "<>" "***" ";;" "/==" ".=" ".-" "__" + "=/=" "<-<" "<<<" ">>>" "<=<" "<<=" "<==" "<==>" "==>" "=>>" + ">=>" ">>=" ">>-" ">-" "<~>" "-<" "-<<" "=<<" "---" "<-|" + "<=|" "/\\" "\\/" "|=>" "|~>" "<~~" "<~" "~~" "~~>" "~>" + "<$>" "<$" "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</>" "</" "/>" + "<->" "..<" "~=" "~-" "-~" "~@" "^=" "-|" "_|_" "|-" "||-" + "|=" "||=" "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#=" + "&=")) + +(sort jetbrains-ligature-mode--ligatures (lambda (x y) (> (length x) (length y)))) + +(dolist (pat jetbrains-ligature-mode--ligatures) + (set-char-table-range composition-function-table + (aref pat 0) + (nconc (char-table-range composition-function-table (aref pat 0)) + (list (vector (regexp-quote pat) + 0 + 'compose-gstring-for-graphic))))) + ;; Don't ask to kill when we have an open line number (setq-default confirm-kill-processes nil) @@ -86,6 +113,22 @@ (setq-default left-fringe-width 20) (setq-default right-fringe-width 20) +;; Margins: https://stackoverflow.com/a/22320638/7980887 +(defun my-set-text-margins () + "Set margins in current buffer." + (setq left-margin-width 50) + (setq right-margin-width 50)) + +(add-hook 'text-mode-hook 'my-set-text-margins) + +(defun my-set-prog-margins () + "Set margins in current buffer." + (setq left-margin-width 25) + (setq right-margin-width 25)) + +(add-hook 'prog-mode-hook 'my-set-prog-margins) + + ;; Highlight todos (use-package hl-todo :ensure t @@ -248,7 +291,8 @@ :bind ("<f2>" . #'eglot-rename) :config (add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd")) - (add-hook 'c-mode-common-hook 'eglot-ensure)) + (add-hook 'c-mode-common-hook 'eglot-ensure) + (add-hook 'dart-mode-hook 'eglot-ensure)) (set-face-underline 'eglot-highlight-symbol-face t) @@ -69,5 +69,9 @@ (other-window -1)))))) (bind-key* (kbd "C-c f r") 'mk/rename-file) +(defun mk/meow () + (interactive) + (print "Meow!")) + (provide 'mk) ;;; mk.el ends here diff --git a/lisp/org-custom.el b/lisp/org-custom.el index 3353171..96bf819 100644 --- a/lisp/org-custom.el +++ b/lisp/org-custom.el @@ -66,7 +66,7 @@ ("C-c n f" . org-roam-node-find) ("C-c n i" . org-roam-node-insert) ("C-c n g" . org-roam-graph) - ("C-c n j" . org-roam-dailies-capture-today) + ("C-c n j" . org-roam-dailies-goto-today) ("C-c n t" . org-roam-tag-add) ("C-c n a" . org-roam-alias-add) ("C-c n c" . org-capture) |