diff --git a/src/keybind/builtin/vim.json b/src/keybind/builtin/vim.json index 21aa567..a1f647e 100644 --- a/src/keybind/builtin/vim.json +++ b/src/keybind/builtin/vim.json @@ -60,6 +60,7 @@ ["dw", "cut_word_right_vim"], ["db", "cut_word_left_vim"], ["dd", "cut_internal_vim"], + ["dG", "cut_buffer_end"], ["\"_dd", "delete_line"], ["cc", ["enter_mode", "insert"], ["cut_internal_vim"]], diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 48b13b1..51a492f 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -2961,6 +2961,15 @@ pub const Editor = struct { } pub const delete_word_left_meta: Meta = .{ .description = "Delete previous word" }; + pub fn cut_buffer_end(self: *Self, _: Context) Result { + const b = try self.buf_for_update(); + const text, const root = try self.cut_to(move_cursor_buffer_end, b.root); + self.set_clipboard_internal(text); + try self.update_buf(root); + self.clamp(); + } + pub const cut_buffer_end_meta: Meta = .{ .description = "Cut to the end of the buffer (copies cut text into clipboard)" }; + pub fn cut_word_left_vim(self: *Self, _: Context) Result { const b = try self.buf_for_update(); const text, const root = try self.cut_to(move_cursor_word_left_vim, b.root);