nvim: move to lazy package manager
This commit is contained in:
42
.config/nvim/lua/plugins/peek.lua
Normal file
42
.config/nvim/lua/plugins/peek.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
return {
|
||||
'toppair/peek.nvim',
|
||||
build = 'deno task --quiet build:fast',
|
||||
config = function()
|
||||
-- default config:
|
||||
require('peek').setup({
|
||||
app = 'browser', -- open in a local browser. not deno
|
||||
|
||||
auto_load = true, -- whether to automatically load preview when
|
||||
-- entering another markdown buffer
|
||||
close_on_bdelete = true, -- close preview window on buffer delete
|
||||
|
||||
syntax = true, -- enable syntax highlighting, affects performance
|
||||
|
||||
theme = 'dark', -- 'dark' or 'light'
|
||||
|
||||
update_on_change = true,
|
||||
|
||||
-- relevant if update_on_change is true
|
||||
throttle_at = 200000, -- start throttling when file exceeds this
|
||||
-- amount of bytes in size
|
||||
throttle_time = 'auto', -- minimum amount of time in milliseconds
|
||||
-- that has to pass before starting new render
|
||||
})
|
||||
|
||||
local peek = require('peek')
|
||||
|
||||
vim.api.nvim_create_user_command('PeekOpen', function()
|
||||
if not peek.is_open() and vim.bo[vim.api.nvim_get_current_buf()].filetype == 'markdown' then
|
||||
--vim.fn.system('i3-msg split horizontal')
|
||||
peek.open()
|
||||
end
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command('PeekClose', function()
|
||||
if peek.is_open() then
|
||||
peek.close()
|
||||
--vim.fn.system('i3-msg move left')
|
||||
end
|
||||
end, {})
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user