;;; my-navigation.el --- Configure parts related to navigation -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (setq help-window-select t) (require 'project) (customize-set-variable 'project-switch-commands '((?f "File" project-find-file) (?d "Dired" project-dired) (?b "Buffer" project-switch-to-buffer) (?e "Eshell" project-eshell) (?m "Magit status" magit-project-status) (?r "Search" rg-project))) (defun my/project-find-go-module (dir) "Find the go.mod file in a DIR." (when-let ((root (locate-dominating-file dir "go.mod"))) (cons 'go-module root))) (cl-defmethod project-root ((project (head go-module))) "Set the project root for PROJECT." (cdr project)) (add-to-list 'project-find-functions #'my/project-find-go-module) (customize-set-variable 'bookmark-save-flag 1) (global-set-key (kbd "C-x C-b") 'ibuffer) (global-set-key (kbd "M-g i") 'imenu) (customize-set-variable 'recentf-max-saved-items 500) (customize-set-variable 'recentf-exclude '(".gz" ".xz" ".zip" "tmp/" "/ssh:")) (add-hook 'after-init-hook 'recentf-mode) (customize-set-variable 'rg-group-result t) (customize-set-variable 'rg-show-columns t) (customize-set-variable 'rg-align-position-numbers t) (customize-set-variable 'rg-align-line-number-field-length 3) (customize-set-variable 'rg-align-column-number-field-length 3) (customize-set-variable 'rg-align-line-column-separator "#") (customize-set-variable 'rg-align-position-content-separator "|") (add-hook 'after-init-hook 'which-key-mode) (provide 'my-navigation) ;;; my-navigation.el ends here