theme = "ashen"

[editor]
line-number = "relative"
undercurl = true
true-color = true
# Not sure if I should enable this by default...
# maybe it's better to just get used to using the clipboards separately?
# Wouldn't be a bad idea to encorporate two clipboards into my workflow,
# especially for stuff like swapping selections and stuff...
# default-yank-register = '+'
cursorline = true
bufferline = "multiple"
color-modes = true
scrolloff = 2
jump-label-alphabet = "tnseriplfuwydhcxoaqz"
# minimum severity to show
end-of-line-diagnostics = "disable"
# rulers = [120]

[editor.whitespace.render]
tab = "all"
space = "none"
newline = "all"

[editor.whitespace.characters]
newline = ""
tab = ""
# tabpad = "·"
tabpad = " "

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.statusline]
mode.normal = "NRM"

[editor.lsp]
display-inlay-hints = true
display-messages = true
# TODO: disable auto signature help
# and set a binding for it instead
auto-signature-help = true

[editor.inline-diagnostics]
cursor-line = "disable"
other-lines = "disable"

[editor.indent-guides]
render = true
# character = "|"
skip-levels = 1

[editor.soft-wrap]
enable = true
wrap-indicator = ""

[keys.insert]
C-k = "signature_help"

[keys.normal]
C-k = "signature_help"
C-g = [":new", ":insert-output lazygit", ":buffer-close!", ":redraw"]
"\\" = ":format"
"+" = ":reflow"
ret = "goto_word"
m = "move_char_left"
n = "move_visual_line_down"
e = "move_visual_line_up"
i = "move_char_right"
h = "insert_mode"
H = "insert_at_line_start"
w = "move_next_sub_word_start"
b = "move_prev_sub_word_start"
l = "move_next_sub_word_end"
L = "move_next_long_word_end"
j = "search_next"
J = "search_prev"
N = "join_selections"
A-N = "join_selections_space"
C-q = ":qa"
C-Q = ":qa!"
C-m = "jump_view_left"
M = ":bp"
I = ":bn"
C-n = "jump_view_down"
C-e = "jump_view_up"
C-i = "jump_view_right"
X = "extend_line_above"
# A-x = "toggle_line_select"
D = "kill_to_line_end"
A-d = "kill_to_line_start"

[keys.normal."["]
x = "extend_line_above"
[keys.normal.space]
x = ":bc"

# UI settings and stuff
[keys.normal.space.u]
D = ':toggle end-of-line-diagnostics hint disable'
d = ':toggle inline-diagnostics.cursor-line disable hint'
w = ':toggle soft-wrap.enable'
s = ':set soft-wrap.wrap-at-text-width true'
S = ':set soft-wrap.wrap-at-text-width false'
k = ":toggle lsp.auto-signature-help"
h = ':toggle lsp.display-inlay-hints'

[keys.select.g]
m = "extend_to_line_start"
i = "extend_to_line_end"
I = "extend_to_line_end_newline"
[keys.select]
X = "extend_line_above"
ret = "extend_to_word"
m = "extend_char_left"
n = "extend_visual_line_down"
e = "extend_visual_line_up"
i = "extend_char_right"
j = "extend_search_next"
J = "extend_search_prev"
l = "extend_next_sub_word_end"
L = "extend_next_long_word_end"
[keys.normal.k]
m = "match_brackets"
k = "match_brackets"
s = "surround_add"
r = "surround_replace"
d = "surround_delete"
a = "select_textobject_around"
i = "select_textobject_inner"

[keys.select.k]
m = "match_brackets"
k = "match_brackets"
s = "surround_add"
r = "surround_replace"
d = "surround_delete"
a = "select_textobject_around"
i = "select_textobject_inner"

[keys.normal."C-w"]
m = "jump_view_left"
C-m = "jump_view_left"
n = "jump_view_down"
C-n = "jump_view_down"
i = "jump_view_right"
C-i = "jump_view_right"
e = "jump_view_up"
C-e = "jump_view_up"
M = "swap_view_left"
N = "swap_view_down"
E = "swap_view_up"
I = "swap_view_right"
d = "wclose"
V = ":vsplit-new"
S = ":hsplit-new"
h = "no_op"
j = "no_op"
k = "no_op"
l = "no_op"
H = "no_op"
J = "no_op"
K = "no_op"
L = "no_op"

[keys.normal.space.w]
m = "jump_view_left"
C-m = "jump_view_left"
n = "jump_view_down"
C-n = "jump_view_down"
i = "jump_view_right"
C-i = "jump_view_right"
e = "jump_view_up"
C-e = "jump_view_up"
M = "swap_view_left"
N = "swap_view_down"
E = "swap_view_up"
I = "swap_view_right"
d = "wclose"
V = ":vsplit-new"
S = ":hsplit-new"
h = "no_op"
j = "no_op"
k = "no_op"
l = "no_op"
H = "no_op"
J = "no_op"
K = "no_op"
L = "no_op"

[keys.normal.g]
z = "goto_window_center"
m = "goto_line_start"
i = "goto_line_end"
I = "goto_line_end_newline"
n = "move_line_down"
e = "move_line_up"
l = "goto_last_line"

[keys.normal.backspace]
d = "delete_selection_noyank"
c = "change_selection_noyank"
