summaryrefslogblamecommitdiff
path: root/emacs/custom/my-navigation.el
blob: 06de92ec1ba1d9a10438b0ade94b21fb918c6e53 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                                                         
               
 
         
 
                   
                  

                  
                    



                                                                  


                                                                               


















                                                                                    

                                                                              


                                                           


                                                                                                
            


                                         
         
                                         
                                           
 
                        
 
                              
;;; my-navigation.el --- Configure parts related to navigation -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

(require 'bookmark)
(require 'project)
(require 'recentf)
(require 'rg)
(require 'transient)

;;; settings
(setq help-window-select t)  ;; select help window when opening it

;; where to store the list of projects
(setq project-list-file (expand-file-name "var/projects" user-emacs-directory))

(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 "|")

;; where to store the list of recent files
(setq recentf-save-file (expand-file-name "var/recentf" user-emacs-directory))
(setq recentf-max-saved-items 500)
(setq recentf-exclude '(".gz" ".xz" ".zip" "tmp/" "/ssh:"))

;; where to store transient's history
(setq transient-history-file (expand-file-name "var/transient-history.el" user-emacs-directory))

;;; bindings
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "M-g i") 'imenu)

;;; hooks
(add-hook 'after-init-hook 'recentf-mode)
(add-hook 'after-init-hook 'which-key-mode)

(provide 'my-navigation)

;;; my-navigation.el ends here