Skip to content

Instantly share code, notes, and snippets.

@daedroza
Last active November 12, 2024 14:39
Show Gist options
  • Save daedroza/bebbd3652479c6f3029cca7453494f6c to your computer and use it in GitHub Desktop.
Save daedroza/bebbd3652479c6f3029cca7453494f6c to your computer and use it in GitHub Desktop.
theme = "dark_plus"
[editor]
true-color = true
bufferline = "always"
color-modes = true
insert-final-newline = true
line-number = "absolute"
mouse = false
rulers = [80, 100]
scrolloff = 13
soft-wrap.enable = true
text-width = 130
popup-border = "all"
[editor.indent-guides]
render = false
character = "⸽"
skip-levels = 0
[editor.whitespace.characters]
space = " "
tab = " "
[editor.whitespace.render]
space = "trailing"
tab = "trailing"
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.statusline]
left = ["mode", "spinner", "file-name", "read-only-indicator"]
right = [
"search-position",
"diagnostics",
"selections",
"register",
"position",
"file-encoding",
"file-line-ending",
"file-type",
]
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"
[editor.lsp]
enable = true
display-messages = true
[keys.insert]
end = "no_op"
home = "no_op"
pagedown = "no_op"
pageup = "no_op"
[keys.normal.g]
# Kakoune Goto(s)
s = "goto_file_start"
k = "goto_file_start"
i = "goto_first_nonwhitespace" # This is not needed as much as we use 0
j = "goto_file_end"
# Enforce Kakoune
g = "no_op"
[keys.normal]
C-c = "no_op"
# Kakoune Selections
H = "extend_char_left"
J = "extend_line_down"
K = "extend_line_up"
L = "extend_char_right"
W = "extend_next_word_start"
E = "extend_next_word_end"
B = "extend_prev_word_start"
A-W = "extend_next_long_word_start"
A-E = "extend_next_long_word_end"
A-B = "extend_prev_long_word_start"
A-h = ["ensure_selections_forward", "flip_selections", "extend_to_line_start"]
A-l = ["ensure_selections_forward", "extend_to_line_end"]
# Kakoune Keep/Joins
A-j = "join_selections"
A-k = "keep_selections"
# Kakoune search
n = "search_next"
A-n = "extend_search_next"
N = "search_prev"
A-N = "extend_search_prev"
# QOL improvements
0 = "goto_first_nonwhitespace"
X = "extend_line_above"
esc = ["collapse_selection", "keep_primary_selection", "normal_mode"]
"}" = ["goto_next_paragraph", "align_view_center"]
"{" = ["goto_prev_paragraph", "align_view_center"]
"*" = [":clear-register /", "search_selection"]
"F5" = [":config-reload"]
[keys.normal."space"]
q = ":buffer-close"
b = "file_browser"
[keys.normal."space".g]
# TODO: Implement parital commit id finding but move diff into picker using gix crate
m = [ ":pipe-execute rm -rf /tmp/git_blame && git -C %{gitdir} --no-pager show --no-color -n1 $(git -C %{gitdir} blame -L %{linenumber},%{linenumber} %{filename} | awk '{print $1}') > /tmp/git_blame && sync && echo ':o /tmp/git_blame'", ":pipe-execute echo ':set-language diff'" ]
f = "changed_file_picker"
[keys.select]
X = ["extend_line_up", "extend_to_line_bounds"]
[keys.normal."]"]
f = [
"goto_next_function",
"flip_selections",
"collapse_selection",
"align_view_top",
]
t = [
"goto_next_class",
"flip_selections",
"collapse_selection",
"align_view_top",
]
[keys.normal."["]
f = ["goto_prev_function", "collapse_selection", "align_view_top"]
t = ["goto_prev_class", "collapse_selection", "align_view_top"]
[[language]]
name = "java"
indent = { tab-width = 4, unit = " " }
formatter = { command = "google_java_format", args = [
"--skip-javadoc-formatting",
"--aosp",
"-",
] }
# TODO: Configure bpfmt
[[language]]
name = "android-bp"
scope = "source.json5"
injection-regex = "json5"
file-types = ["bp"]
language-servers = []
comment-token = "//"
indent = { tab-width = 4, unit = " " }
[[language]]
name = "toml"
formatter = { command = "taplo", args = ["fmt", "-"] }
[[language]]
name = "lua"
formatter = { command = "stylua", args = [
"-",
"--line-endings",
"Unix",
"--indent-width",
"2",
"--indent-type",
"Spaces",
] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment