mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/goto-preview: init
This commit is contained in:
parent
9caeb51238
commit
944a316881
2 changed files with 108 additions and 0 deletions
24
plugins/by-name/goto-preview/default.nix
Normal file
24
plugins/by-name/goto-preview/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "goto-preview";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
settingsExample = {
|
||||
default_mappings = false;
|
||||
height = 30;
|
||||
post_open_hook.__raw = ''
|
||||
function(_, win)
|
||||
-- Close the current preview window with <Esc> or 'q'.
|
||||
local function close_window()
|
||||
vim.api.nvim_win_close(win, true)
|
||||
end
|
||||
vim.keymap.set('n', '<Esc>', close_window, { buffer = true })
|
||||
vim.keymap.set('n', 'q', close_window, { buffer = true })
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue