diff --git a/.gitignore b/.gitignore index 7775240..ab67048 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /tree-sitter/ /tramp /dape-breakpoints +flycheck_init.el diff --git a/init.el b/init.el index bffd780..637ed07 100644 --- a/init.el +++ b/init.el @@ -229,6 +229,26 @@ Interactively, force the recompile if called with a prefix." :config (recentf-mode 1)) +;; bookmarks +(use-package bookmark + :ensure nil + :bind ("C-c b" . my/bookmark-find-file) + :config + (defun my/bookmark-find-file (&optional name) + "Run `find-file' in or on bookmark NAME. +If NAME points to a directory, run `find-file' with `default-directory' in that +directory. Otherwise, run `find-file' on that file." + (interactive (list (bookmark-completing-read + "Find file in" bookmark-current-bookmark))) + (unless name + (error "No bookmark specified")) + (bookmark-maybe-historicize-string name) + (when-let ((file (bookmark-get-filename name))) + (if (file-directory-p file) + (let ((default-directory (file-name-as-directory file))) + (call-interactively 'find-file)) + (find-file file))))) + ;; kitty keyboard protocol (use-package kkp :config