90 lines
2.1 KiB
Nix
90 lines
2.1 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
programs.nixvim = {
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
hover-nvim
|
|
];
|
|
extraConfigLua = # lua
|
|
''
|
|
require("hover").setup({
|
|
init = function()
|
|
require("hover.providers.lsp")
|
|
require("hover.providers.diagnostic")
|
|
require("hover.providers.man")
|
|
require("hover.providers.dictionary")
|
|
end,
|
|
preview_opts = {
|
|
border = 'single',
|
|
},
|
|
preview_window = true,
|
|
title = true,
|
|
mouse_providers = {
|
|
'LSP',
|
|
},
|
|
mouse_delay = 400
|
|
})
|
|
'';
|
|
# autoCmd = [
|
|
# {
|
|
# desc = "Open Hover window when hovering over a word";
|
|
# event = "CursorHold";
|
|
# pattern = "*";
|
|
# callback.__raw = ''
|
|
# function(_)
|
|
# local word = vim.fn.expand("<cword>")
|
|
# if word ~= "" then
|
|
# require('hover').hover()
|
|
# end
|
|
# end
|
|
# '';
|
|
# }
|
|
# ];
|
|
keymaps = [
|
|
{
|
|
mode = "n";
|
|
key = "K";
|
|
action = "<CMD>lua require('hover').hover()<CR>";
|
|
options = {
|
|
desc = "Open Hover Window";
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
mode = "n";
|
|
key = "gK";
|
|
action = "<CMD>lua require('hover').hover()<CR>";
|
|
options = {
|
|
desc = "Select Hover Source";
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
mode = "n";
|
|
key = "<C-p>";
|
|
action = "<CMD>lua require('hover').hover_switch('previous')<CR>";
|
|
options = {
|
|
desc = "Previous Hover Source";
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
mode = "n";
|
|
key = "<C-n>";
|
|
action = "<CMD>lua require('hover').hover_switch('next')<CR>";
|
|
options = {
|
|
desc = "Next Hover Source";
|
|
silent = true;
|
|
};
|
|
}
|
|
{
|
|
mode = "n";
|
|
key = "<MouseMove>";
|
|
action = "<CMD>lua require('hover').hover_mouse()<CR>";
|
|
options = {
|
|
desc = "Hover Mouse Support";
|
|
silent = true;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
}
|