-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdefaults.lua
More file actions
97 lines (88 loc) · 6.05 KB
/
defaults.lua
File metadata and controls
97 lines (88 loc) · 6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---@class KsbBufWinData
---@field bufid integer|nil
---@field winid integer|nil
---@class KsbPasteWindowData
---@field scrollback_buffer KsbBufWinData data for the scrollback buffer
---@field paste_window KsbBufWinData data for the paste window
---@field paste_window_footer KsbBufWinData data for the paste window footer
---@class KsbCallbacks
---@field after_setup fun(kitty_data:KsbKittyData, opts:KsbOpts)|nil callback executed after initializing kitty-scrollback.nvim
---@field after_launch fun(kitty_data:KsbKittyData, opts:KsbOpts)|nil callback executed after launch started to process the scrollback buffer
---@field after_ready fun(kitty_data:KsbKittyData, opts:KsbOpts)|nil callback executed after scrollback buffer is loaded and cursor is positioned
---@field after_paste_window_ready fun(paste_window_data:KsbPasteWindowData, kitty_data:KsbKittyData, opts:KsbOpts)|nil callback executed after the paste window is opened or resized
---@class KsbKittyGetText
---@field ansi boolean|nil If true, the text will include the ANSI formatting escape codes for colors, bold, italic, etc.
---@field clear_selection boolean|nil If true, clear the selection in the matched window, if any.
---@field extent string|nil | 'screen' | 'all' | 'selection' | 'first_cmd_output_on_screen' | 'last_cmd_output' | 'last_visited_cmd_output' | 'last_non_empty_output' What text to get. The default of screen means all text currently on the screen. all means all the screen+scrollback and selection means the currently selected text. first_cmd_output_on_screen means the output of the first command that was run in the window on screen. last_cmd_output means the output of the last command that was run in the window. last_visited_cmd_output means the first command output below the last scrolled position via scroll_to_prompt. last_non_empty_output is the output from the last command run in the window that had some non empty output. The last four require shell_integration to be enabled. Choices: screen, all, first_cmd_output_on_screen, last_cmd_output, last_non_empty_output, last_visited_cmd_output, selection
---@class KsbStatusWindowIcons
---@field kitty string kitty status window icon, defaults to
---@field heart string heart status window icon, defaults to
---@field nvim string nvim status window icon, defaults to
---@class KsbStatusWindowOpts
---@field enabled boolean If true, show status window in upper right corner of the screen
---@field style_simple boolean If true, use plaintext instead of nerd font icons
---@field autoclose boolean If true, close the status window after kitty-scrollback.nvim is ready
---@field show_timer boolean If true, show a timer in the status window while kitty-scrollback.nvim is loading
---@field icons KsbStatusWindowIcons Icons displayed in the status window, defaults to
---@alias BoolOrFn boolean|fun():boolean
---@alias KsbWinOpts table<string, any>
---@alias KsbWinOptsOverrideFunction fun(paste_winopts:KsbWinOpts):KsbWinOpts
---@alias KsbWinOptsOverride KsbWinOpts|fun(paste_winopts:KsbWinOpts):KsbWinOpts
---@alias KsbFooterWinOptsOverrideFunction fun(footer_winopts:KsbWinOpts, paste_winopts:KsbWinOpts):KsbWinOpts
---@alias KsbFooterWinOptsOverride KsbWinOpts|KsbFooterWinOptsOverrideFunction
---@class KsbPasteWindowOpts
---@field highlight_as_normal_win BoolOrFn|nil If true, use Normal highlight group. If false, use NormalFloat
---@field filetype string|nil The filetype of the paste window. If nil, use the shell that is configured for kitty
---@field hide_footer boolean|nil If true, hide mappings in the footer when the paste window is initially opened
---@field winblend integer|nil The winblend setting of the window, see :help winblend
---@field winopts_overrides KsbWinOptsOverride|nil Paste float window overrides, see nvim_open_win() for configuration
---@field footer_winopts_overrides KsbFooterWinOptsOverride|nil Paste footer window overrides, see nvim_open_win() for configuration
---@field yank_register string|nil register used during yanks to paste window, see :h registers
---@field yank_register_enabled boolean|nil If true, the `yank_register` copies content to the paste window. If false, disable yank to paste window
---@class KsbOpts
---@field callbacks KsbCallbacks|nil fire and forget callback functions
---@field keymaps_enabled boolean|nil if true, enabled all default keymaps
---@field restore_options boolean|nil if true, restore options that were modified while processing the scrollback buffer
---@field highlight_overrides KsbHighlights|nil kitty-scrollback.nvim highlight overrides
---@field status_window KsbStatusWindowOpts|nil options for status window indicating that kitty-scrollback.nvim is ready
---@field paste_window KsbPasteWindowOpts|nil options for paste window that sends commands to Kitty
---@field kitty_get_text KsbKittyGetText|nil options passed to get-text when reading scrollback buffer, see `kitty @ get-text --help`
---@field checkhealth boolean|nil if true execute :checkhealth kitty-scrollback and skip setup
---@field visual_selection_highlight_mode string | 'darken' | 'kitty' | 'nvim' | 'reverse' | nil
---@field scrollback_columns integer|nil temporary column width during get-text operation to avoid hard wrapping (larger values may impact performance), see :h columns
local default_opts = {
callbacks = nil,
keymaps_enabled = true,
restore_options = false,
highlight_overrides = nil,
status_window = {
enabled = true,
style_simple = false,
autoclose = false,
show_timer = false,
icons = {
kitty = '',
heart = '', -- variants | | | ♥ | | |
nvim = '', -- variants | | |
},
},
paste_window = {
highlight_as_normal_win = nil,
filetype = nil,
hide_footer = false,
winblend = 0,
winopts_overrides = nil,
footer_winopts_overrides = nil,
yank_register = '',
yank_register_enabled = true,
},
kitty_get_text = {
ansi = true,
extent = 'all',
clear_selection = true,
},
checkhealth = false,
visual_selection_highlight_mode = 'darken',
scrollback_columns = 300,
}
return default_opts