summary refs log tree commit diff
path: root/emacs/custom/my-navigation.el
blob: 7c09de63f2483298f6c9e805574f0bc0fdf1981a (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;;; my-navigation.el --- Configure parts related to navigation
;;; Commentary:
;;; Code:

(require 'use-package)

(setq help-window-select t)

(use-package project
  :ensure t
  :bind-keymap ("C-c p" . project-prefix-map)
  :custom
  (project-list-file (expand-file-name "var/projects" user-emacs-directory))
  (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))))

(use-package bookmark
  :custom
  (bookmark-save-flag 1))

(use-package ls-lisp
  :ensure nil
  :custom
  (ls-lisp-use-insert-directory-program nil)
  (ls-lisp-dirs-first t))

(use-package dired
  :defer t
  :bind (("C-x C-d" . dired)
         ("C-x C-j" . dired-jump))
  :init
  (setq-default dired-dwim-target t)
  (setq-default dired-listing-switches "-alh")
  (setq dired-recursive-deletes 'always)
  (setq dired-recursive-copies 'always))

(use-package dired-x
  :ensure nil
  :hook ((dired-mode . dired-omit-mode))
  :config
  (setq dired-omit-verbose nil)
  ;; hide backup, autosave, *.*~ files
  ;; omit mode can be toggled using `C-x M-o' in dired buffer.
  (setq dired-omit-files
        (concat dired-omit-files "\\|^.DS_Store$\\|^.localized$\\|^.projectile$\\|^.git$")))

(use-package ibuffer
  :bind ("C-x C-b" . ibuffer))

(use-package recentf
  :init (recentf-mode 1)
  :config
  (setq recentf-max-saved-items 500
        recentf-exclude '(".gz" ".xz" ".zip")
        recentf-save-file (expand-file-name "var/recentf" user-emacs-directory)))

(use-package rg
  :ensure t
  :custom
  (rg-group-result t)
  (rg-show-columns t)
  (rg-align-position-numbers t)
  (rg-align-line-number-field-length 3)
  (rg-align-column-number-field-length 3)
  (rg-align-line-column-separator "#")
  (rg-align-position-content-separator "|"))

(use-package which-key
  :diminish which-key-mode
  :ensure t
  :config
  (which-key-mode))

(provide 'my-navigation)
;;; my-navigation.el ends here