Skip to content

Commit

Permalink
Update README.md and header
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescherti committed Nov 19, 2024
1 parent c6e6460 commit 1d72fed
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ The *outline-indent.el* Emacs package offers a similar functionality to Vim's `s
- [Installation](#installation)
- [Activation](#activation)
- [Manual activation](#manual-activation)
- [Auto activation](#auto-activation)
- [Adjusting the shift width](#adjusting-the-shift-width)
- [Automatic activation using hooks](#automatic-activation-using-hooks)
- [Adjusting the shift width and default offset](#adjusting-the-shift-width-and-default-offset)
- [Usage](#usage)
- [Functions specific to outline-indent-minor-mode](#functions-specific-to-outline-indent-minor-mode)
- [outline-indent-promote and outline-indent-demote](#outline-indent-promote-and-outline-indent-demote)
Expand Down Expand Up @@ -78,7 +78,7 @@ Once installed, the minor mode can be activated using:
(outline-indent-minor-mode)
```

### Auto activation
### Automatic activation using hooks

The minor mode can also be automatically activated for a certain mode. For example for Python and YAML:
``` emacs-lisp
Expand All @@ -91,7 +91,7 @@ The minor mode can also be automatically activated for a certain mode. For examp
(add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)
```

### Adjusting the shift width
### Adjusting the shift width and default offset

You can adjust the `outline-indent-shift-width` and `outline-indent-default-offset` according to your preferences. While the default value of 1 is adequate for most modes, setting the appropriate value ensures that the promote and demote functions correctly adjust the indentation of blocks. For example:
``` emacs-lisp
Expand Down
28 changes: 25 additions & 3 deletions outline-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
;; :custom
;; (outline-indent-ellipsis " ▼ "))
;;
;; Usage:
;; ------
;; Activation:
;; -----------
;; Once installed, the minor mode can be activated using:
;; (outline-indent-minor-mode)
;;
;; Activation using a hook:
;; ------------------------
;; The minor mode can also be automatically activated for a certain mode. For
;; example for Python and YAML:
;; ;; Python
Expand All @@ -66,11 +68,31 @@
;; (add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
;; (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)
;;
;; Adjusting the shift width and default offset
;; --------------------------------------------
;; You can adjust the outline-indent-shift-width and
;; outline-indent-default-offset according to your preferences. While the
;; default value of 1 is adequate for most modes, setting the appropriate value
;; ensures that the promote and demote functions correctly adjust the
;; indentation of blocks.
;;
;; For example:
;; ;; Python
;; (dolist (hook '(python-mode python-ts-mode-hook))
;; (add-hook hook #'(lambda()
;; (setq-local outline-indent-default-offset 4)
;; (setq-local outline-indent-shift-width 4))))
;;
;; ;; YAML
;; (dolist (hook '(yaml-mode yaml-ts-mode-hook))
;; (add-hook hook #'(lambda()
;; (setq-local outline-indent-default-offset 2)
;; (setq-local outline-indent-shift-width 2)))
;;
;; Links:
;; ------
;; - More information about outline-indent (Frequently asked questions, usage...):
;; https://github.com/jamescherti/outline-indent.el
;;

;;; Code:

Expand Down

0 comments on commit 1d72fed

Please sign in to comment.