Skip to content

Commit

Permalink
Add key bindings "C-M-[" and "C-M-]" for navigating between diff-hl h…
Browse files Browse the repository at this point in the history
…unks
  • Loading branch information
purcell committed Nov 26, 2023
1 parent 1cf308d commit f3fbd87
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@

(require 'init-ledger)
(require 'init-lua)
(require 'init-uiua)
(require 'init-terminals)

;; Extra packages which don't require any configuration
Expand Down
22 changes: 22 additions & 0 deletions lisp/init-uiua.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
;;; init-uiua.el --- Support for the Uiua programming language -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(if (maybe-require-package 'uiua-ts-mode)
(progn
;; TODO: handle duplication w.r.t. nix-ts-mode
(defun sanityinc/set-uiua-ts-auto-mode ()
(when (and (fboundp 'treesit-ready-p)
(treesit-ready-p 'uiua t)
(fboundp 'uiua-ts-mode))
(add-to-list 'auto-mode-alist '("\\.ua\\'" . uiua-ts-mode))))
(add-hook 'after-init-hook 'sanityinc/set-uiua-ts-auto-mode))
(maybe-require-package 'uiua-mode))

(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs '((uiua-mode uiua-ts-mode) . ("uiua" "lsp"))))

(maybe-require-package 'nixpkgs-fmt)

(provide 'init-uiua)
;;; init-uiua.el ends here
6 changes: 3 additions & 3 deletions lisp/init-vc.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
(add-hook 'after-init-hook 'global-diff-hl-mode)

(with-eval-after-load 'diff-hl
(define-key diff-hl-mode-map
(kbd "<left-fringe> <mouse-1>")
'diff-hl-diff-goto-hunk)))
(define-key diff-hl-mode-map (kbd "<left-fringe> <mouse-1>") 'diff-hl-diff-goto-hunk)
(define-key diff-hl-mode-map (kbd "M-C-]") 'diff-hl-next-hunk)
(define-key diff-hl-mode-map (kbd "M-C-[") 'diff-hl-previous-hunk)))

(provide 'init-vc)
;;; init-vc.el ends here

0 comments on commit f3fbd87

Please sign in to comment.