aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2026-06-06 00:22:13 +0530
committerAkshay Nair <phenax5@gmail.com>2026-06-06 00:22:13 +0530
commitfebadcb3c4d604605577d67019c9ecfa282c2b81 (patch)
tree7829a39c99f4ebec0480dc5bc5c585ec7fd587a5
parent1aa539001e0daceafe924c75821c0542b6e322bf (diff)
downloadkakoune-config-febadcb3c4d604605577d67019c9ecfa282c2b81.tar.gz
kakoune-config-febadcb3c4d604605577d67019c9ecfa282c2b81.zip
Add marks-add-all-buffers command to load all buffers as marks
-rw-r--r--autoload/marks.kak12
1 files changed, 12 insertions, 0 deletions
diff --git a/autoload/marks.kak b/autoload/marks.kak
index d7aea04..92f45a2 100644
--- a/autoload/marks.kak
+++ b/autoload/marks.kak
@@ -41,10 +41,22 @@ define-command marks-edit-all %{
edit %sh{ "$kak_config/scripts/marks.fnl" show-path }
}
+define-command marks-add-all-buffers %{
+ eval %sh{
+ echo "$kak_quoted_buflist" | xargs -n1 | while IFS= read file; do
+ if [ -f "$file" ]; then
+ "$kak_config/scripts/marks.fnl" add "$(realpath "$file")"
+ fi
+ done
+ }
+ marks-show
+}
+
declare-user-mode marks
map global user a ': enter-user-mode-with-count marks<ret>' -docstring 'Marks mode'
map global user <space> ': marks-select %val{count}<ret>' -docstring 'Select marks'
map global marks a ': marks-add %val{buffile} %opt{user_mode_count}<ret>' -docstring 'Create new mark from buffer'
+map global marks A ': marks-add-all-buffers<ret>' -docstring 'Load all buffer files as marks'
map global marks d ': marks-delete %val{buffile}<ret>' -docstring 'Delete mark'
map global marks C ': marks-clear<ret>' -docstring 'Clear mark'
map global marks e ': marks-edit-all<ret>' -docstring 'Open buffer to edit marks'