Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@ Copy [`plugin/gpg.lua`](https://github.com/benoror/gpg.nvim/blob/main/plugin/gpg
}
```

## Config

### Customize file extensions

```lua
vim.filetype.add({
extension = {
gpg = "gpg",
asc = "gpg",
},
})

return {
"benoror/gpg.nvim",
ft = { "gpg", "asc", "pgp" },
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Frestein can you clarify why this line is needed beside the prev. vim.filetype.add?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ft property is used by lazy.nvim to lazy-load the plugin based on filetype, so the plugin loads only when you open files of those types. See the lazy.nvim docs here for details.
This is different from vim.filetype.add, which just sets filetype detection in Neovim.

It would be good to put the current example under a "lazy.nvim" subheading since this is a configuration example specific to that plugin manager. With the built-in plugin manager vim.pack, the configuration will be different.

}
```

Vía @Frestein [Frestein/dotfiles/dot_config/nvim/lua/plugins/extras/utils/gpg.lua](https://github.com/Frestein/dotfiles/blob/5169f2a5cae4bb992ea5c875a51f816a82e4582e/dot_config/nvim/lua/plugins/extras/utils/gpg.lua)

## Requirements

- `gpg`
Expand Down