diff options
Diffstat (limited to '')
-rw-r--r-- | emacs/custom/my-navigation.el | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/emacs/custom/my-navigation.el b/emacs/custom/my-navigation.el index 5d03f86..12cc557 100644 --- a/emacs/custom/my-navigation.el +++ b/emacs/custom/my-navigation.el @@ -4,56 +4,42 @@ ;;; Code: -(setq help-window-select t) - +(require 'bookmark) (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-rust-module (dir) - "Find the Cargo.toml file in a DIR." - (when-let ((root (locate-dominating-file dir "Cargo.toml"))) - (cons 'rust-module root))) - -(cl-defmethod project-root ((project (head rust-module))) - "Set the project root for PROJECT." - (cdr 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) -(add-to-list 'project-find-functions #'my/project-find-rust-module) - -(customize-set-variable 'bookmark-save-flag 1) - +(require 'recentf) +(require 'rg) + +;;; settings +(setq help-window-select t) ;; select help window when opening it + +(setq 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))) + +(setq bookmark-save-flag 1) +(setq bookmark-default-file (expand-file-name "var/bookmarks" user-emacs-directory)) + +(setq rg-group-result t) +(setq rg-show-columns t) +(setq rg-align-position-numbers t) +(setq rg-align-line-number-field-length 3) +(setq rg-align-column-number-field-length 3) +(setq rg-align-line-column-separator "#") +(setq rg-align-position-content-separator "|") + +(setq recentf-max-saved-items 500) +(setq recentf-exclude '(".gz" ".xz" ".zip" "tmp/" "/ssh:")) + +;;; bindings (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:")) +;;; hooks (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) |