Skip to content

Commit

Permalink
docs: Add daily usage entry on editing files
Browse files Browse the repository at this point in the history
Co-authored-by: Alper Cugun <github@alper.nl>
  • Loading branch information
twpayne and Alper Cugun committed Sep 16, 2024
1 parent 5644141 commit dbde967
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions assets/chezmoi.io/docs/user-guide/daily-operations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
# Daily operations

## Edit your dotfiles

Edit a dotfile with:

```console
$ chezmoi edit $FILENAME
```

This will edit `$FILENAME`'s source file in your source directory. chezmoi will
not make any changes to the actual dotfile until you run `chezmoi apply`.

To automatically run `chezmoi apply` when you quit your editor, run:

```console
$ chezmoi edit --apply $FILENAME
```

To automatically run `chezmoi apply` whenever you save the file in your editor, run:

```console
$ chezmoi edit --watch $FILENAME
```

You don't have to use `chezmoi edit` to edit your dotfiles. For more
information, see [Do I have to use `chezmoi edit` to edit my
dotfiles?](frequently-asked-questions/usage.md#how-do-i-edit-my-dotfiles-with-chezmoi)

```mermaid
sequenceDiagram
participant H as home directory
participant W as working copy
participant L as local repo
participant R as remote repo
W->>W: chezmoi edit
W->>H: chezmoi apply
W->>H: chezmoi edit --apply
W->>H: chezmoi edit --watch
```

## Pull the latest changes from your repo and apply them

You can pull the changes from your repo and apply them in a single command:
Expand Down

0 comments on commit dbde967

Please sign in to comment.