summaryrefslogtreecommitdiff
path: root/README.md
blob: 2d343fa44e89b4d28852b79fc798dead871fb4c9 (plain)
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
[![GNU ELPA](https://elpa.gnu.org/packages/breadcrumb.svg)](https://elpa.gnu.org/packages/breadcrumb.html)
# M-x breadcrumb-mode

![screenshot](./screenshot.png)

## Usage

Breadcrumbs are sequences of short strings indicating where you are in
some big tree-like maze that is probably your code.  Hopefully the
screenshot above clears it up.

* `M-x breadcrumb-mode` is global mode.  Will try to turn itself on
  conservatively and only if there's a project.

* `M-x breadcrumb-local-mode` is a buffer-local minor mode, if you
  don't want the default heuristics for turning it on everywhere.
   
There's not much more to it.  Breadcrumb will try to query `imenu.el`
and `project.el` for the best information.

## Installation

You can download breadcrumb via GNU Elpa with `M-x package-install RET breadcrumb RET`

Or if you'd like to install it manually you can download `breadcrumb.el` and put it in 
your `load-path` similar to `(add-to-list 'load-path "~/path/to/breadcrumb.el")`

## More usage

If you want some leet modeline you may also manually put the mode-line
constructs

```lisp
(:eval (breadcrumb-imenu-crumbs))
```

and

```lisp
(:eval (breadcrumb-project-crumbs))
```    

in your settings of the `mode-line-format` or `header-line-format`
variables.

## Tweaks

The shape and size of each breadcrumb groups may be tweaked via
`breadcrumb-imenu-max-length`, `breadcrumb-project-max-length`,
`breadcrumb-imenu-crumb-separator`, and
`breadcrumb-project-crumb-separator`.

The structure each of the breadcrumbs varies depending on whether
either `project.el` and `imenu.el` (or both) can do useful things for
your buffer.

For Project breadcrumbs, this depends on whether `project.el`'s
`project-current` can guess what project the current buffer belongs
to.

For Imenu breadcrumbs, this varies.  Depending on the major-mode
author's taste, the Imenu tree (in variable `imenu--index-alist`) may
have different structure.  Sometimes, minor mode also tweak the Imenu
tree in useful ways.  For example, with recent Eglot (I think Eglot
1.14+), managed buffers get extra region info added to it, which makes
Breadcrumb show "richer" paths.