feat(nvim): add nvim-devdocs

This commit is contained in:
Moritz Böhme 2023-09-29 20:07:30 +02:00
parent 23c7e77275
commit 28ac81cee5
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
4 changed files with 60 additions and 0 deletions

View file

@ -863,6 +863,22 @@
"type": "github" "type": "github"
} }
}, },
"nvim-devdocs": {
"flake": false,
"locked": {
"lastModified": 1695706852,
"narHash": "sha256-Hwq3iGS8mY4WISyrBoRZIzWW5aozQEy9yeYcBxKYEy4=",
"owner": "luckasRanarison",
"repo": "nvim-devdocs",
"rev": "8e0cb37b2bd35f6025074b3d4c6f62d77b21836c",
"type": "github"
},
"original": {
"owner": "luckasRanarison",
"repo": "nvim-devdocs",
"type": "github"
}
},
"nvim-treesitter": { "nvim-treesitter": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -939,6 +955,7 @@
"nix-lazy-nvim": "nix-lazy-nvim", "nix-lazy-nvim": "nix-lazy-nvim",
"nix-super": "nix-super", "nix-super": "nix-super",
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_7",
"nvim-devdocs": "nvim-devdocs",
"nvim-treesitter": "nvim-treesitter", "nvim-treesitter": "nvim-treesitter",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"rofi-wayland": "rofi-wayland", "rofi-wayland": "rofi-wayland",

View file

@ -56,6 +56,9 @@
actions-preview-nvim.flake = false; actions-preview-nvim.flake = false;
actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim"; actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim";
nvim-devdocs.flake = false;
nvim-devdocs.url = "github:luckasRanarison/nvim-devdocs";
nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim"; nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim";
# Hyprland # Hyprland

View file

@ -313,5 +313,39 @@ with builtins;
]; ];
opts = { }; opts = { };
} }
{
plugin = nvim-devdocs;
dependencies = [
{ plugin = plenary-nvim; }
{ plugin = telescope-nvim; }
{ plugin = nvim-treesitter; }
];
opts = {
previewer_cmd = lib.getExe pkgs.glow;
picker_cmd = lib.getExe pkgs.glow;
picker_cmd_args = [ "-p" ];
telescope = {
layout_strategy = "vertical";
layout_config = {
prompt_position = "top";
};
};
};
cmd = [
"DevdocsFetch"
"DevdocsInstall"
"DevdocsUninstall"
"DevdocsOpen"
"DevdocsOpenFloat"
"DevdocsOpenCurrent"
"DevdocsOpenCurrentFloat"
"DevdocsUpdate"
"DevdocsUpdateAll"
];
keys = [
{ key = "<leader>fd"; cmd = "<cmd>DevdocsOpenCurrentFloat<cr>"; desc = "Search documentation"; }
{ key = "<leader>fD"; cmd = "<cmd>DevdocsOpenFloat<cr>"; desc = "Search documentation (all installed)"; }
];
}
]; ];
} }

View file

@ -37,5 +37,11 @@ with lib.my;
version = mkVersionInput inputs.nvim-treesitter; version = mkVersionInput inputs.nvim-treesitter;
src = inputs.nvim-treesitter; src = inputs.nvim-treesitter;
}); });
nvim-devdocs = prev.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-devdocs";
version = mkVersionInput inputs.nvim-devdocs;
src = inputs.nvim-devdocs;
};
}; };
} }