-
Notifications
You must be signed in to change notification settings - Fork 12
Home
Mike edited this page Oct 31, 2023
·
26 revisions
(click for video)
(click for video)
- Source: example.lua#L48
function()
return {
kitty_get_text = {
extent = 'all',
ansi = false,
},
}
end
(click for video)
- Source: builtin.lua#L5
function()
return {
kitty_get_text = {
extent = 'last_cmd_output',
ansi = true,
},
}
end
(click for video)
- Source: example.lua#L72
function()
return {
kitty_get_text = {
extent = 'last_cmd_output',
ansi = false,
},
}
end
(click for video)
- Source: builtin.lua#L13
function()
return {
kitty_get_text = {
extent = 'last_visited_cmd_output',
ansi = true,
},
}
end
(click for video)
(click for video)
- Source: example.lua#L10
function()
local msg = {}
return {
callbacks = {
after_setup = function()
vim.defer_fn(function()
table.insert(
msg,
'# kitty-scrollback after_setup callback triggered @ ' .. vim.fn.strftime('%c')
)
end, 1000)
end,
after_launch = function()
vim.defer_fn(function()
table.insert(
msg,
'# kitty-scrollback after_launch callback triggered @ ' .. vim.fn.strftime('%c')
)
end, 2000)
end,
after_ready = function(kitty_data, opts)
vim.defer_fn(function()
vim.cmd.startinsert()
table.insert(
msg,
'# kitty-scrollback after_ready callback triggered @ ' .. vim.fn.strftime('%c')
)
table.insert(msg, '# kitty_data:')
table.insert(msg, '# ' .. vim.fn.json_encode(kitty_data))
table.insert(msg, '# opts:')
table.insert(msg, '# ' .. vim.fn.json_encode(vim.inspect(opts)))
vim.api.nvim_buf_set_lines(0, 0, -1, false, msg)
vim.cmd.stopinsert()
end, 3000)
end,
},
}
end
(click for video)
- Source: example.lua#L308
function()
return {
status_window = {
autoclose = true,
},
}
end
(click for video)
- Source: example.lua#L322
function()
return {
status_window = {
show_timer = true,
},
callbacks = {
after_setup = function()
vim.loop.sleep(4000)
end,
},
}
end
(click for video)
- Source: example.lua#L334
function()
return {
status_window = {
style_simple = true,
},
}
end
(click for video)
- Source: example.lua#L341
function()
return {
status_window = {
style_simple = not require('kitty-scrollback.kitty_commands').try_detect_nerd_font(),
},
}
end
(click for video)
- Source: example.lua#L56
function()
return {
kitty_get_text = {
extent = 'first_cmd_output_on_screen',
ansi = true,
},
}
end
(click for video)
- Source: example.lua#L64
function()
return {
kitty_get_text = {
extent = 'first_cmd_output_on_screen',
ansi = false,
},
}
end
(click for video)
- Source: example.lua#L80
function()
return {
kitty_get_text = {
extent = 'last_non_empty_output',
ansi = true,
},
}
end
(click for video)
- Source: example.lua#L88
function()
return {
kitty_get_text = {
extent = 'last_non_empty_output',
ansi = false,
},
}
end
(click for video)
- Source: example.lua#L104
function()
return {
kitty_get_text = {
extent = 'screen',
ansi = true,
},
}
end
(click for video)
- Source: example.lua#L112
function()
return {
kitty_get_text = {
extent = 'screen',
ansi = false,
},
}
end
(click for video)
- Source: example.lua#L120
function()
return {
kitty_get_text = {
extent = 'selection',
ansi = true,
},
}
end
(click for video)
- Source: example.lua#L137
function()
return {
kitty_get_text = {
extent = 'selection',
ansi = false,
},
}
end
(click for video)
- Source: example.lua#L128
function()
return {
kitty_get_text = {
extent = 'selection',
ansi = true,
clear_selection = false,
},
}
end
(click for video)
- Source: example.lua#L145
function()
return {
highlight_overrides = {
KittyScrollbackNvimNormal = {
fg = '#ee82ee',
bg = '#ee82ee',
},
KittyScrollbackNvimHeart = {
fg = '#ff0000',
bg = '#4b0082',
},
KittyScrollbackNvimSpinner = {
fg = '#000099',
bg = '#4b0082',
},
KittyScrollbackNvimReady = {
fg = '#4b0082',
bg = '#ffa500',
},
KittyScrollbackNvimKitty = {
fg = '#ffa500',
bg = '#000099',
},
KittyScrollbackNvimVim = {
fg = '#008000',
bg = '#000099',
},
KittyScrollbackNvimPasteWinNormal = {
link = 'IncSearch',
},
KittyScrollbackNvimPasteWinFloatBorder = {
link = 'IncSearch',
},
KittyScrollbackNvimPasteWinFloatTitle = {
link = 'IncSearch',
},
},
}
end
(click for video)
- Source: example.lua#L184
function()
vim.keymap.set({ 'v' }, 'sY', '<Plug>(KsbVisualYankLine)', {})
vim.keymap.set({ 'v' }, 'sy', '<Plug>(KsbVisualYank)', {})
vim.keymap.set({ 'n' }, 'sY', '<Plug>(KsbNormalYankEnd)', {})
vim.keymap.set({ 'n' }, 'sy', '<Plug>(KsbNormalYank)', {})
vim.keymap.set({ 'n' }, 'syy', '<Plug>(KsbYankLine)', {})
vim.keymap.set({ 'n' }, 'q', '<Plug>(KsbCloseOrQuitAll)', {})
vim.keymap.set({ 'n', 't', 'i' }, 'ZZ', '<Plug>(KsbQuitAll)', {})
vim.keymap.set({ 'n' }, '<tab>', '<Plug>(KsbToggleFooter)', {})
vim.keymap.set({ 'n', 'i' }, '<cr>', '<Plug>(KsbExecuteCmd)', {})
vim.keymap.set({ 'n', 'i' }, '<c-v>', '<Plug>(KsbPasteCmd)', {})
end
(click for video)
- Source: example.lua#L198
function()
return {
keymaps_enabled = false,
}
end
(click for video)
- Source: example.lua#L203
function()
return {
paste_window = {
filetype = 'markdown',
},
callbacks = {
after_ready = vim.schedule_wrap(function()
local msg = {
'',
'\t',
'',
'# kitty-scrollback.nvim example',
'',
'## Change paste window filetype to `markdown`',
'',
'```lua',
'paste_window = {',
' filetype = "markdown", -- change this to your desired filetype',
'},',
'```',
}
local curbuf = vim.api.nvim_get_current_buf()
vim.cmd.startinsert()
vim.fn.timer_start(250, function(t) ---@diagnostic disable-line: redundant-parameter
if curbuf ~= vim.api.nvim_get_current_buf() then
vim.fn.timer_stop(t)
vim.api.nvim_buf_set_lines(0, 0, -1, false, msg)
vim.cmd.stopinsert()
vim.fn.setcursorcharpos(2, 4)
end
end, {
['repeat'] = 12,
})
end),
},
}
end
(click for video)
- Source: example.lua#L240
function()
return {
paste_window = {
hide_footer = true,
},
}
end
(click for video)
- Source: example.lua#L247
function()
return {
paste_window = {
highlight_as_normal_win = function()
return false
end,
},
}
end
(click for video)
- Source: example.lua#L263
function()
return {
paste_window = {
yank_register_enabled = false,
},
}
end
(click for video)
- Source: example.lua#L256
function()
return {
paste_window = {
yank_register = '*',
},
}
end
(click for video)
- Source: example.lua#L270
function()
return {
paste_window = {
winblend = 50,
},
}
end
(click for video)
- Source: example.lua#L277
function()
return {
paste_window = {
winblend = 10,
winopts_overrides = function()
local h = vim.o.lines - 5 -- TODO: magic number 3 for footer and 2 for border
return {
border = 'solid',
row = 0,
col = 0,
height = h < 1 and 3 or h, -- TODO: magic number 3 for footer
width = vim.o.columns,
}
end,
footer_winopts_overrides = function()
return {
border = 'single',
title = ' kitty-scrollback.nvim ',
title_pos = 'center',
}
end,
},
}
end
(click for video)
- Source: example.lua#L301
function()
vim.o.termguicolors = true
vim.o.number = true
return {
restore_options = true,
}
end
(click for video)
- Source: example.lua#L315
function()
return {
status_window = {
enabled = false,
},
}
end
(click for video)
(click for video)
(click for video)
(click for video)
- Source: builtin.lua#L21
function()
return {
checkhealth = true,
}
end
😽 Open your Kitty scrollback buffer with Neovim. Ameowzing!