knot.nvim/README.md

51 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2024-12-21 16:08:24 +01:00
# knot.nvim
knot.nvim is a plugin for [Neovim](https://neovim.io/) that provides a way to view and edit DNS records using [knot](https://www.knot-dns.cz/) via [knotctl](https://code.smolnet.org/micke/knotctl).
## Installation
With [lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
{
"https://code.smolnet.org/micke/knot.nvim.git",
dependencies = {
"nvim-telescope/telescope.nvim",
},
config = function()
2024-12-27 23:16:48 +01:00
require("telescope").load_extension('knot')
2024-12-21 16:08:24 +01:00
end,
},
```
## Dependencies
You need to have [knotctl](https://code.smolnet.org/micke/knotctl) installed and configured on your system.
If knotctl works for you in your terminal, it should work in this plugin as well.
## Usage
This plugin provides a Telescope picker for viewing and editing DNS records. You can summon it with:
```vim
2024-12-27 23:16:48 +01:00
:Telescope knot update
2024-12-27 23:38:21 +01:00
2024-12-27 23:16:48 +01:00
```
You can also add new records with:
```vim
:Telescope knot add
2024-12-21 16:08:24 +01:00
```
2024-12-27 23:38:21 +01:00
or delete records with:
```vim
:Telescope knot delete
```
2024-12-21 16:08:24 +01:00
or add a mapping:
```vim
2024-12-27 23:16:48 +01:00
nnoremap <leader>ka :Telescope knot add<cr>
2024-12-27 23:38:21 +01:00
nnoremap <leader>kd :Telescope knot delete<cr>
2024-12-27 23:16:48 +01:00
nnoremap <leader>ku :Telescope knot update<cr>
2024-12-21 16:08:24 +01:00
```
2024-12-22 00:02:42 +01:00
You can edit the record and when saving it with `:w` you will be asked to confirm. You can quit the buffer with `:q` or `q` to discard changes.
2024-12-21 16:08:24 +01:00
2024-12-21 15:22:23 +00:00
## Screenshots
### The finder and previewer
![Viewer](https://code.smolnet.org/micke/knot.nvim/raw/branch/main/screenshots/viewer.png)
### Editing a record
![Editor](https://code.smolnet.org/micke/knot.nvim/raw/branch/main/screenshots/editor.png)