From 355d3e236e1a61986f62ff2df9cc04d281ec1009 Mon Sep 17 00:00:00 2001 From: mattkae Date: Sat, 3 Dec 2022 09:30:55 -0500 Subject: Some better highlighting, org-moder, etc --- lisp/general.el | 30 +++++++++++++++++++++++++++--- lisp/org-custom.el | 4 ++++ 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/general.el b/lisp/general.el index c4a3d2f..871491c 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -12,6 +12,9 @@ kept-old-versions 2 version-control t) +;; Auto revert mode to reload disk +(global-auto-revert-mode 1) + ;; menu bars (menu-bar-mode -1) (toggle-scroll-bar -1) @@ -47,6 +50,14 @@ ;; Smart parentheses (smartparens-global-mode 1) +(with-eval-after-load 'smartparens + (sp-with-modes + '(c++-mode c-mode javascript-mode typescript-mode python-mode) + (sp-local-pair "{" nil :post-handlers '(:add ("||\n[i]" "RET"))))) + +;; Show number of matches +(setq isearch-lazy-highlight t) +(setq isearch-lazy-count t) ;; Minimap (require 'minimap) @@ -275,14 +286,27 @@ (use-package tree-sitter :ensure t - :defer t) + :defer t + :config + ;; use treesitter when possible + (global-tree-sitter-mode) + ;; overwrite the default syntax-highlighting (from major modes) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode) + :hook + (prog-mode . tree-sitter-mode)) (use-package tree-sitter-langs :ensure t :defer t) -(global-tree-sitter-mode) -(add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode) +;; Highlight similar text +(use-package highlight-thing + :config + (setq highlight-thing-what-thing 'region) + (setq highlight-thing-what-thing 'word) + (setq highlight-thing-exclude-thing-under-point t) + (global-highlight-thing-mode) + (setq highlight-thing-delay-seconds 0.0)) ;; Vterm (require 'vterm) diff --git a/lisp/org-custom.el b/lisp/org-custom.el index f00924d..3a4c7e7 100644 --- a/lisp/org-custom.el +++ b/lisp/org-custom.el @@ -71,5 +71,9 @@ (add-hook 'org-mode-hook 'org-custom-hook) +(use-package org-modern + :config + (add-hook 'org-mode-hook #'org-modern-mode)) + (provide 'org-custom) ;;; org-custom.el ends here -- cgit v1.2.1