diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-06-30 10:40:17 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-06-30 11:15:37 +0530 |
| commit | d60ddc467397f0074f21576ca8ea9e1b1b78a2bd (patch) | |
| tree | fea85335f22df3152c59abc0367c862142757677 /autoload | |
| parent | 7bee16c7013ef1da84e723b1ced976f432d5b77a (diff) | |
| download | kakoune-config-d60ddc467397f0074f21576ca8ea9e1b1b78a2bd.tar.gz kakoune-config-d60ddc467397f0074f21576ca8ea9e1b1b78a2bd.zip | |
Add memos integration
Diffstat (limited to 'autoload')
| -rw-r--r-- | autoload/+init.kak | 8 | ||||
| -rw-r--r-- | autoload/lsp-config.kak | 6 | ||||
| -rw-r--r-- | autoload/notes.kak | 37 |
3 files changed, 48 insertions, 3 deletions
diff --git a/autoload/+init.kak b/autoload/+init.kak index 898c04b..0fc5183 100644 --- a/autoload/+init.kak +++ b/autoload/+init.kak @@ -6,8 +6,10 @@ nop %sh{ ln -sf "$kak_runtime/autoload/plugins" "$kak_config/autoload/plugins" 2>/dev/null || true } -# Disabled treesitter because eh +# treesitter (disabled for now) # eval %sh{kak-tree-sitter -dksvv --init "${kak_session}" --with-highlighting --with-text-objects} + +# kcr eval %sh{kcr init kakoune} colorscheme phenax @@ -16,9 +18,9 @@ set-option global incsearch true set-option global indentwidth 2 set-option global tabstop 2 set-option -add global path "**" -set-option global startup_info_version 20250603 +set-option global startup_info_version 20260521 set-option global scrolloff 10,3 -set-option -add global ui_options terminal_enable_mouse=false terminal_set_title=true terminal_status_on_top=true +set-option -add global ui_options terminal_enable_mouse=false terminal_status_on_top=true # Modeline set-option global modelinefmt \ diff --git a/autoload/lsp-config.kak b/autoload/lsp-config.kak index cf62930..9f11f56 100644 --- a/autoload/lsp-config.kak +++ b/autoload/lsp-config.kak @@ -18,6 +18,12 @@ lsp-inlay-diagnostics-enable global map global user l ': enter-user-mode lsp<ret>' -docstring 'LSP mode' map global lsp t ': lsp-type-definition<ret>' -docstring 'LSP type definition' +unmap global lsp f +unmap global lsp y +unmap global lsp ] +unmap global lsp [ +unmap global lsp 0 +unmap global lsp 9 # map global user t ':enter-user-mode tree-sitter<ret>' -docstring 'Treesitter mode' 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 Struct<ret>' -docstring 'LSP class interface or struct' diff --git a/autoload/notes.kak b/autoload/notes.kak index 3d360a4..ae92e9b 100644 --- a/autoload/notes.kak +++ b/autoload/notes.kak @@ -1,3 +1,40 @@ +declare-user-mode notes +map global user n ': enter-user-mode notes<ret>' -docstring 'Notes' +map global notes n ': new-memo<ret>' -docstring 'New note' + define-command create-log -params 1.. %{ connect run env "EDITOR=kcr edit" "%val{config}/scripts/logger.sh" %arg{@} } + +declare-option str memos_last_saved_id + +define-command new-memo %{ + set global memos_last_saved_id %{} + edit -scratch '*memos-note*' + # TODO: templates +} + +hook global BufCreate '[*]memos-note[*]' %{ + set-option buffer filetype markdown + map buffer user s ': save-memo-buffer<ret>' + # TODO: use write somehow? +} + +define-command save-memo-buffer %{ + evaluate-commands %sh{ + name=$(cat /tmp/.kak-memo-response | jq '.name') + if [ -z "$name" ]; then + echo "execute-keys -draft ',%<a-|>~/scripts/memos.sh create > /tmp/.kak-memo-response<ret>'" + else + echo "execute-keys -draft ',%<a-|>~/scripts/memos.sh update $name > /tmp/.kak-memo-response<ret>'" + fi + } + + evaluate-commands %sh{ + name=$(cat /tmp/.kak-memo-response | jq '.name') + echo "set global memos_last_saved_id %{$name}" + rm -f /tmp/.kak-memo-response 2>/dev/null || true + } + + info 'Saved' +} |
