feat(nvim) plugin peek

This commit is contained in:
thek4n 2023-12-30 00:00:35 +03:00
parent 92a1f63c9e
commit f34fdaf984
4 changed files with 28 additions and 5 deletions

View File

@ -26,7 +26,7 @@
addEmptyPathspec = false
[alias]
a = "!git ls-files --exclude-standard -m --others -t | fzf | cut -d' ' -f2 | xargs git add"
a = "!git ls-files --exclude-standard -m --others -t | fzf -m --bind ctrl-a:toggle-all | cut -d' ' -f2 | xargs git add"
d = diff
ds = diff --staged
dno = diff --name-only

View File

@ -13,7 +13,7 @@ opt.relativenumber = true
opt.clipboard:append { 'unnamed' }
opt.clipboard:append { 'unnamedplus' }
opt.shortmess:append { s = true, I = true} -- disable startup message
opt.shortmess:append { s = true, I = true } -- disable startup message
opt.shell = 'zsh'

View File

@ -1,13 +1,16 @@
return {
'toppair/peek.nvim',
enabled = vim.fn.executable "deno" == 1,
event = { "VeryLazy" },
enabled = vim.fn.executable("deno") == 1,
ft = {'markdown'},
keys = {
{ '<Leader>rr', "<cmd>lua require('peek').open()<CR>" }
{ '<Leader>rr', "<cmd>PeekOpen<CR>" }
},
build = 'deno task --quiet build:fast',
config = function()
require('peek').setup({
local peek = require('peek')
peek.setup({
auto_load = true,
close_on_bdelete = true,
syntax = true,
@ -18,5 +21,24 @@ return {
throttle_at = 200000,
throttle_time = 'auto',
})
if vim.fn.executable("i3-msg") then
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, {})
else
vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
end
end,
}

View File

@ -124,6 +124,7 @@ inactive-dim = 0.15
# focus-exclude = []
focus-exclude = [
"class_g = 'firefox'",
"class_g = 'webview'",
"class_g = 'Cairo-clock'",
"class_g = 'Conky'"
];