added dG vim binding

This commit is contained in:
Robert Burnett 2025-05-11 18:59:16 -05:00 committed by CJ van den Berg
parent 79c5447329
commit 54aa30602f
2 changed files with 10 additions and 0 deletions

View file

@ -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"]],

View file

@ -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);