summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormattkae <mattkae@protonmail.com>2022-12-03 09:30:55 -0500
committermattkae <mattkae@protonmail.com>2022-12-03 09:30:55 -0500
commit355d3e236e1a61986f62ff2df9cc04d281ec1009 (patch)
tree44cd1819de2450e010ac38229f207b05f7853a9b /lisp
parente9f5b484356ef3d91749324252833db9977e7bd5 (diff)
Some better highlighting, org-moder, etc
Diffstat (limited to 'lisp')
-rw-r--r--lisp/general.el30
-rw-r--r--lisp/org-custom.el4
2 files changed, 31 insertions, 3 deletions
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