Reformat to Student config

This commit is contained in:
venomade committed 2026-08-16 22:50:18 +01:00
1 parent 28ebd8999d
commit 94b73b6d67
91 files changed
+785 -6603

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
# ~~~~~~~
# COLEMAK
# ~~~~~~~
map global normal n j
map global normal <a-n> <a-j>
map global normal <a-N> <a-J>
map global normal e k
map global normal i l
map global normal I L
map global normal <a-i> <a-l>
map global normal <a-I> <a-L>
map global normal j n
map global normal <a-j> <a-n>
map global normal <a-J> <a-N>
map global normal J N
map global normal l i
map global normal <a-l> <a-i>
map global normal <a-L> <a-I>
map global normal k e
map global normal K E
map global normal <a-e> <a-k>
map global normal <a-k> <a-e>
map global normal <a-E> <a-K>
map global normal <a-K> <a-E>
# Select whole lines when moving selection with J or K
map global normal N Jx
map global normal E Kx
# Make I insert before every line
map global normal L "<a-s>I"
map global goto l ''
map global goto i l -docstring 'line end'
map global goto j ''
map global goto n j -docstring 'buffer bottom'
map global goto e ''
map global goto k ''
map global goto e k -docstring 'buffer top'
+89
View File
@@ -0,0 +1,89 @@
{ config, lib, ... }:
let
c = config.colorScheme.palette;
rgb = hex: "rgb:${lib.toLower hex}";
in
{
xdg.configFile."kak/colors/nix-colorscheme.kak".text = ''
declare-option str bg_main '${rgb c.base00}'
declare-option str fg_main '${rgb c.base05}'
declare-option str bg_dim '${rgb c.base01}'
declare-option str fg_dim '${rgb c.base03}'
declare-option str bg_alt '${rgb c.base02}'
declare-option str fg_alt '${rgb c.base04}'
declare-option str bg_active '${rgb c.base02}'
declare-option str bg_inactive '${rgb c.base01}'
declare-option str red '${rgb c.base08}'
declare-option str red_bright '${rgb c.base08}'
declare-option str green '${rgb c.base0B}'
declare-option str green_bright '${rgb c.base0B}'
declare-option str yellow '${rgb c.base0A}'
declare-option str yellow_bright '${rgb c.base0A}'
declare-option str blue '${rgb c.base0D}'
declare-option str blue_bright '${rgb c.base0D}'
declare-option str purple '${rgb c.base0E}'
declare-option str purple_bright '${rgb c.base0E}'
declare-option str bg_mode_line '${rgb c.base07}'
declare-option str fg_mode_line '${rgb c.base06}'
declare-option str cursor '${rgb c.base0B}'
declare-option str bg_hl_line '${rgb c.base01}'
declare-option str fg_space '${rgb c.base03}'
declare-option str psel '${rgb c.base02}'
declare-option str ssel '${rgb c.base01}'
# For code
set-face global value '${rgb c.base05}'
set-face global type '${rgb c.base0D}'
set-face global variable '${rgb c.base0C}'
set-face global keyword '${rgb c.base0B}'
set-face global module '${rgb c.base05}'
set-face global function '${rgb c.base0A}'
set-face global string '${rgb c.base08}'
set-face global builtin '${rgb c.base0B}'
set-face global constant '${rgb c.base0B}'
set-face global comment '${rgb c.base0F}'
set-face global meta '${rgb c.base08}'
set-face global operator '${rgb c.base05}'
set-face global comma '${rgb c.base05}'
set-face global bracket '${rgb c.base0C}'
# For markup
set-face global title "%opt{purple}"
set-face global header "%opt{yellow_bright}"
set-face global bold "%opt{purple}"
set-face global italic "%opt{purple_bright}"
set-face global mono "%opt{green}"
set-face global block "%opt{blue_bright}"
set-face global link "%opt{green}"
set-face global bullet "%opt{green}"
set-face global list "%opt{fg_main}"
# Builtin faces
set-face global Default "%opt{fg_main},%opt{bg_main}"
set-face global PrimarySelection "default,%opt{psel}"
set-face global SecondarySelection "default,%opt{ssel}"
set-face global PrimaryCursor "%opt{bg_main},%opt{cursor}"
set-face global SecondaryCursor "%opt{bg_main},%opt{fg_alt}"
set-face global PrimaryCursorEol "%opt{bg_main},%opt{red_bright}"
set-face global SecondaryCursorEol "%opt{bg_main},%opt{blue}"
set-face global LineNumbers "%opt{fg_dim},%opt{bg_main}"
set-face global LineNumberCursor "%opt{fg_alt},%opt{bg_main}+b"
set-face global LineNumbersWrapped "%opt{bg_dim},%opt{bg_main}+i"
set-face global MenuForeground "%opt{bg_main},%opt{fg_main}+b"
set-face global MenuBackground "%opt{fg_main},%opt{bg_alt}"
set-face global MenuInfo "%opt{fg_alt},%opt{bg_alt}"
set-face global Information "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global Error "%opt{red},%opt{bg_mode_line}"
set-face global StatusLine "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global StatusLineMode "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global StatusLineInfo "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global StatusLineValue "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global StatusCursor "%opt{fg_main},%opt{blue}"
set-face global Prompt "%opt{fg_mode_line},%opt{bg_mode_line}"
set-face global MatchingChar "%opt{blue},%opt{bg_main}"
set-face global Whitespace "%opt{fg_space},%opt{bg_main}+f"
set-face global WrapMarker Whitespace
set-face global BufferPadding "%opt{bg_main},%opt{bg_main}"
'';
}
+235
View File
@@ -0,0 +1,235 @@
# ~~~~~~~
# OPTIONS
# ~~~~~~~
# Set Colorscheme to nix
colorscheme nix-colorscheme
# Set tab width
set-option global tabstop 2
set-option global indentwidth 2
# Display line numbers
add-highlighter global/ number-lines -hlcursor
# Softwrap long lines
add-highlighter global/ wrap -word -indent
# Don't show changelog at startup
set-option global startup_info_version 9999
# Add scroll margin
set-option global scrolloff 5,5
# Use ripgrep instead of grep
require-module grep
set-option global grepcmd 'rg -HUn --no-heading --sort path --vimgrep'
# Remove trailing whitespace on save
hook -group auto-trim-whitespace global BufWritePre .* %{ try %{ execute-keys -draft \%s\h+$<ret>d } }
# Disable Clippy
set-option -add global ui_options terminal_assistant=none
# Disable word completions (reduce completer functions to just filenames)
set-option global completers filename
# ~~~~~~~
# KEYBIND
# ~~~~~~~
# Buffer Keybinds
declare-user-mode buffer-mode
map global user b ':enter-user-mode buffer-mode<ret>' -docstring 'buffer...'
map global buffer-mode d ':delete-buffer<ret>' -docstring 'delete buffer'
map global buffer-mode k ':delete-buffer!<ret>' -docstring 'kill buffer'
map global buffer-mode n ':buffer-next<ret>' -docstring 'next buffer'
map global buffer-mode p ':buffer-previous<ret>' -docstring 'previous buffer'
# Comment Line
map global normal '#' ':comment-line<ret>'
# File Keybinds
declare-user-mode file-mode
map global user f ':enter-user-mode file-mode<ret>' -docstring 'file...'
map global file-mode f '<esc>:prompt -shell-script-candidates %{ fd --type f } file: %{ edit %val{text} }<ret>' -docstring 'find file'
map global file-mode c ':e ~/.config/kak/kakrc<ret>' -docstring 'open config'
map global file-mode t ':e ~/Documents/Notes/TODO.md<ret>' -docstring 'open todo'
map global file-mode a ':e ~/.config/almoxarife.yaml' -docstring 'open alconf'
# Search case-insensitive by default
map global normal '/' '/(?Si)'
map global normal '?' '?(?Si)'
map global normal '<a-/>' '<a-/>(?Si)'
map global normal '<a-?>' '<a-?>(?Si)'
# Select inner line
map global normal X x_
# Tab jumps to next snippet entry by default in insert mode
map global insert <tab> '<esc>:lsp-snippets-select-next-placeholders<ret>i'
map global insert <s-tab> '<esc>:lsp-snippets-select-next-placeholders<ret>i'
# When completion menu shows, remap tab to cycle completions — but only if not in a snippet
hook global InsertCompletionShow .* %{
try %{
execute-keys -draft 'h<a-K>\h<ret>'
try %{
eval %sh{ [ -n '${kak_opt_lsp_snippets_placeholder_groups}' ] && echo 'fail' }
map window insert <tab> <c-n>
map window insert <s-tab> <c-p>
hook -once -always window InsertCompletionHide .* %{
unmap window insert <tab> <c-n>
unmap window insert <s-tab> <c-p>
}
}
}
}
# Map tab and shift-tab to indent and dedent in normal mode
map global normal <tab> '>'
map global normal <s-tab> '<'
define-command smart-gh -docstring 'smart goto line start' \
%{
set-register c %val{cursor_column}
execute-keys gi
evaluate-commands %sh{
origin='${kak_reg_c}'
indent='${kak_cursor_column}'
if [ '${origin}' -le '${indent}' ]; then
echo 'execute-keys gh'
fi
}
}
map global goto h '<esc>:smart-gh<ret>' -docstring 'line begin (smart)'
# Window Management
declare-user-mode window-mode
map global user w ':enter-user-mode window-mode<ret>' -docstring 'window...'
map global window-mode c ':kitty-terminal-window kak -c %val{session}<ret>' -docstring 'create new window'
# ~~~
# LSP
# ~~~
eval %sh{kak-lsp}
set-option global modelinefmt "%opt{lsp_modeline} %opt{modelinefmt}"
map global user l ':enter-user-mode lsp<ret>' -docstring 'lsp...'
map global goto d <esc>:lsp-definition<ret> -docstring 'LSP definition'
map global goto r <esc>:lsp-references<ret> -docstring 'LSP references'
map global goto y <esc>:lsp-type-definition<ret> -docstring 'LSP type definition'
map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
map global object t '<a-semicolon>lsp-object Class Interface Module Namespace Struct<ret>' -docstring 'LSP class or module'
map global object d '<a-semicolon>lsp-diagnostic-object error warning<ret>' -docstring 'LSP errors and warnings'
map global object D '<a-semicolon>lsp-diagnostic-object error<ret>' -docstring 'LSP errors'
hook global WinSetOption lsp_code_action_indicator=.* %{
set-option window lsp_code_action_indicator "[A]"
}
hook global WinSetOption lsp_progress_indicator=.* %{
set-option window lsp_progress_indicator "[P]"
}
hook global GlobalSetOption lsp_modeline_message_requests=.* %{
evaluate-commands %sh{
if [ -n "$kak_hook_param_capture_0" ]; then
echo "set-option global lsp_modeline_message_requests '[M]'"
fi
}
}
# Save with formatting with :W
define-command W %{
lsp-formatting-sync
w
}
# LSP language configs
# Lua
#
#
hook global BufSetOption filetype=lua %{
set-option buffer lsp_servers %exp{
# Minimal setup for luals (Lua doesn't really work with LSP, I've tried)
[luals]
filetypes = ["lua"]
root_globs = [".git/", ".luarc.json", ".luarc.jsonc", ".editorconfig", ".kakrc"]
command = "lua-language-server"
[luals.settings.Lua]
codeLens.enable = false
completion.autoRequire = false # afaik not supported by kakoune
completion.enable = true
completion.callSnippet = "Replace"
completion.showWord = "Disable"
completion.postfix = "@"
diagnostics.enable = true
diagnostics.disable = [
"lowercase-global",
"spell-check",
]
format.enable = true
hint.enable = true
hint.paramName = "Disable"
hint.paramType = false
hover.enable = true
runtime.path = [
"?.lua",
"?/init.lua",
]
runtime.version = "Lua 5.4"
semantic.enable = false
[luals.settings.Lua.diagnostics.severity]
undefined-field = "Warning"
undefined-global = "Warning"
# [emmylua_ls]
# filetypes = ["lua"]
# root_globs = [".git/", ".luarc.json", ".editorconfig", ".kakrc", ".emmyrc.json"]
# command = "emmylua_ls"
}
}
hook global WinSetOption filetype=lua %{
add-highlighter window/emmylua_direct regex "---\s*(@(?:alias|as|class|enum|generic|return|type|overload))\s+([^\n]*)" 1:attribute 2:type
add-highlighter window/emmylua_labeled regex "---\s*(@(?:alias|cast|field|param))\s+([a-zA-Z0-9_\?]*) ([^\n]*)" 1:attribute 2:variable 3:type
add-highlighter window/emmylua_enum_variant regex '---\s*\|\s*("[^\n]*")' 1:string
}
# Typst
hook global BufSetOption filetype=typst %{
set-option buffer lsp_servers %exp{
[tinymist]
filetypes = ["typst"]
root_globs = ["*.typ"]
command = "tinymist"
[tinymist.settings]
exportPdf = "onType"
outputPath = "$root/target/$dir/$name"
}
}
# Enable LSP (Must come just before settings, after everything else lsp)
lsp-enable
# LSP Settings
lsp-diagnostic-lines-disable global
lsp-inlay-diagnostics-enable global
# lsp-inlay-code-lenses-enable global
lsp-inlay-hints-enable global
set-option global lsp_hover_anchor true
# lsp-auto-hover-enable
lsp-auto-signature-help-enable
+26
View File
@@ -0,0 +1,26 @@
{ pkgs, lib, ... }:
{
imports = [ ./colors.nix ];
home.packages = with pkgs; [
fzf
ripgrep
fd
kakoune-lsp
];
programs.kakoune = {
enable = true;
defaultEditor = true;
extraConfig = lib.concatStringsSep "\n" [
"# Venomade's kakrc - my quest for a faster editor"
(builtins.readFile ./colemak.kak)
(builtins.readFile ./config.kak)
(builtins.readFile ./plugins.kak)
];
plugins = import ./plugins.nix { inherit pkgs lib; };
};
}
+37
View File
@@ -0,0 +1,37 @@
# auto-pairs:
# location: https://github.com/alexherbo2/auto-pairs.kak
enable-auto-pairs
# nanoline:
# location: https://github.com/ftonneau/nanoline.kak
set-option global nanoline_rw_face_light rgb:000000,rgb:b1bd91
nanoline light
nanoline-format
# kakboard:
# location: https://github.com/lePerdu/kakboard
hook global WinCreate .* %{ kakboard-enable }
# state-save:
# location: https://gitlab.com/Screwtapello/kakoune-state-save
# harpoon:
# location: https://codeberg.org/raiguard/kak-harpoon
harpoon-add-bindings
# focus:
# location: https://github.com/caksoylar/kakoune-focus
map global user s ':focus-toggle<ret>' -docstring "toggle selections focus"
define-command focus-live-enable %{
focus-selections
hook -group focus window NormalIdle .* %{ focus-extend }
}
define-command focus-live-disable %{
remove-hooks window focus
focus-clear
}
# fzf:
# location: https://github.com/andreyorst/fzf.kak
require-module fzf
# map global file-mode f ':fzf-mode<ret>' -docstring 'fzf'
+79
View File
@@ -0,0 +1,79 @@
{ pkgs, lib, ... }:
[
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "auto-pairs-kak";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "alexherbo2";
repo = "auto-pairs.kak";
rev = "master";
sha256 = "sha256-V8++6qZFsUOQsg0GCC+5PpPgAHsR9mCKB4YDnNBL/QQ=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "nanoline-kak";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "ftonneau";
repo = "nanoline.kak";
rev = "master";
sha256 = "sha256-cIxMVS1ADJciFBpQNvGICujq3q+fZ3dQCoSoLc1ev54=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kakboard";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "lePerdu";
repo = "kakboard";
rev = "master";
sha256 = "sha256-cH+OmkqWiNjerC/joVSJ1D17FXM/NLki3U5/22YGGD0=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kakoune-state-save";
version = "master";
src = pkgs.fetchFromGitLab {
owner = "Screwtapello";
repo = "kakoune-state-save";
rev = "master";
sha256 = "sha256-Eknn0dTDg5DYzKbG6WykPCeaQc87JW1rwGIAphRa4oU=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kak-harpoon";
version = "trunk";
src = pkgs.fetchFromCodeberg {
owner = "raiguard";
repo = "kak-harpoon";
rev = "trunk";
hash = "sha256-jO9ceZ4MKM+yBwhXPl4duKeSJMnPRMGL/4+/UxwM8Og=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kakoune-focus";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "caksoylar";
repo = "kakoune-focus";
rev = "master";
sha256 = "sha256-VmDSGPnsuxmhiPjacH+hUBAm6hBdfoIFtW/NQx836f4=";
};
})
(pkgs.kakouneUtils.buildKakounePluginFrom2Nix {
pname = "kak-fzf";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "andreyorst";
repo = "fzf.kak";
rev = "master";
sha256 = "sha256-3aj39UW5wsDpjpDJm7HDFkCGjx6+VHrBTkEC0sjyKkI=";
};
})
]