summary refs log tree commit diff
path: root/emacs/custom/my-navigation.el
blob: 12cc557879aaf493f9dfdb6ad71a60579554cd09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
;;; my-navigation.el --- Configure parts related to navigation -*- lexical-binding: t -*-

;;; Commentary:

;;; Code:

(require 'bookmark)
(require 'project)
(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)

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

(provide 'my-navigation)

;;; my-navigation.el ends here