Compare commits
12 commits
79c5447329
...
0e182b6ae4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0e182b6ae4 | ||
![]() |
7ec25cfb46 | ||
![]() |
fcbb377237 | ||
![]() |
acded15af8 | ||
![]() |
7c51fa8400 | ||
![]() |
4765f47dd0 | ||
![]() |
2d583fbd9e | ||
![]() |
d88b15ce04 | ||
![]() |
da95070616 | ||
![]() |
28fdd95747 | ||
![]() |
43c77bb737 | ||
![]() |
54aa30602f |
2 changed files with 61 additions and 4 deletions
|
@ -26,6 +26,8 @@
|
||||||
["h", "move_left_vim"],
|
["h", "move_left_vim"],
|
||||||
["<Space>", "move_right_vim"],
|
["<Space>", "move_right_vim"],
|
||||||
|
|
||||||
|
["J", "join_next_line"],
|
||||||
|
|
||||||
["i", "enter_mode", "insert"],
|
["i", "enter_mode", "insert"],
|
||||||
["a", ["enter_mode", "insert"], ["move_right"]],
|
["a", ["enter_mode", "insert"], ["move_right"]],
|
||||||
["I", ["enter_mode", "insert"], ["smart_move_begin"]],
|
["I", ["enter_mode", "insert"], ["smart_move_begin"]],
|
||||||
|
@ -60,6 +62,8 @@
|
||||||
["dw", "cut_word_right_vim"],
|
["dw", "cut_word_right_vim"],
|
||||||
["db", "cut_word_left_vim"],
|
["db", "cut_word_left_vim"],
|
||||||
["dd", "cut_internal_vim"],
|
["dd", "cut_internal_vim"],
|
||||||
|
["dG", "cut_buffer_end"],
|
||||||
|
["dgg", "cut_buffer_begin"],
|
||||||
["\"_dd", "delete_line"],
|
["\"_dd", "delete_line"],
|
||||||
|
|
||||||
["cc", ["enter_mode", "insert"], ["cut_internal_vim"]],
|
["cc", ["enter_mode", "insert"], ["cut_internal_vim"]],
|
||||||
|
@ -82,6 +86,7 @@
|
||||||
["<C-y>", "redo"],
|
["<C-y>", "redo"],
|
||||||
|
|
||||||
["/", "find"],
|
["/", "find"],
|
||||||
|
["*", "find_word_at_cursor"],
|
||||||
|
|
||||||
["<C-k>", "TODO"],
|
["<C-k>", "TODO"],
|
||||||
|
|
||||||
|
@ -93,6 +98,9 @@
|
||||||
["<C-CR>", ["move_down"], ["move_begin"]],
|
["<C-CR>", ["move_down"], ["move_begin"]],
|
||||||
["<CR>", ["move_down"], ["move_begin"]],
|
["<CR>", ["move_down"], ["move_begin"]],
|
||||||
|
|
||||||
|
["gt", "next_tab"],
|
||||||
|
["gT", "previous_tab"],
|
||||||
|
|
||||||
["0", "move_begin_or_add_integer_argument_zero"],
|
["0", "move_begin_or_add_integer_argument_zero"],
|
||||||
["1", "add_integer_argument_digit", 1],
|
["1", "add_integer_argument_digit", 1],
|
||||||
["2", "add_integer_argument_digit", 2],
|
["2", "add_integer_argument_digit", 2],
|
||||||
|
@ -120,13 +128,15 @@
|
||||||
["h", "select_left"],
|
["h", "select_left"],
|
||||||
["l", "select_right"],
|
["l", "select_right"],
|
||||||
|
|
||||||
|
["gg", "select_buffer_begin"],
|
||||||
|
["G", "select_buffer_end"],
|
||||||
|
|
||||||
["b", "select_word_left_vim"],
|
["b", "select_word_left_vim"],
|
||||||
["w", "select_word_right_vim"],
|
["w", "select_word_right_vim"],
|
||||||
["W", "select_word_right"],
|
["W", "select_word_right"],
|
||||||
["B", "select_word_left"],
|
["B", "select_word_left"],
|
||||||
["e", "select_word_right_end_vim"],
|
["e", "select_word_right_end_vim"],
|
||||||
|
|
||||||
["0", "move_begin"],
|
|
||||||
["^", "smart_move_begin"],
|
["^", "smart_move_begin"],
|
||||||
["$", "select_end"],
|
["$", "select_end"],
|
||||||
[":", "open_command_palette"],
|
[":", "open_command_palette"],
|
||||||
|
@ -154,7 +164,18 @@
|
||||||
|
|
||||||
["c", ["enter_mode", "insert"], ["cut_forward_internal"]],
|
["c", ["enter_mode", "insert"], ["cut_forward_internal"]],
|
||||||
["C", ["enter_mode", "insert"], ["cut_to_end_vim"]],
|
["C", ["enter_mode", "insert"], ["cut_to_end_vim"]],
|
||||||
["D", "cut_to_end_vim"]
|
["D", "cut_to_end_vim"],
|
||||||
|
|
||||||
|
["0", "move_begin_or_add_integer_argument_zero"],
|
||||||
|
["1", "add_integer_argument_digit", 1],
|
||||||
|
["2", "add_integer_argument_digit", 2],
|
||||||
|
["3", "add_integer_argument_digit", 3],
|
||||||
|
["4", "add_integer_argument_digit", 4],
|
||||||
|
["5", "add_integer_argument_digit", 5],
|
||||||
|
["6", "add_integer_argument_digit", 6],
|
||||||
|
["7", "add_integer_argument_digit", 7],
|
||||||
|
["8", "add_integer_argument_digit", 8],
|
||||||
|
["9", "add_integer_argument_digit", 9]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"visual line": {
|
"visual line": {
|
||||||
|
@ -169,7 +190,6 @@
|
||||||
["k", "select_up"],
|
["k", "select_up"],
|
||||||
["j", "select_down"],
|
["j", "select_down"],
|
||||||
|
|
||||||
["0", "move_begin"],
|
|
||||||
["^", "smart_move_begin"],
|
["^", "smart_move_begin"],
|
||||||
["$", "move_end"],
|
["$", "move_end"],
|
||||||
[":", "open_command_palette"],
|
[":", "open_command_palette"],
|
||||||
|
@ -191,7 +211,18 @@
|
||||||
|
|
||||||
["c", ["enter_mode", "insert"], ["cut_internal_vim"]],
|
["c", ["enter_mode", "insert"], ["cut_internal_vim"]],
|
||||||
["C", ["enter_mode", "insert"], ["cut_to_end_vim"]],
|
["C", ["enter_mode", "insert"], ["cut_to_end_vim"]],
|
||||||
["D", "cut_to_end_vim"]
|
["D", "cut_to_end_vim"],
|
||||||
|
|
||||||
|
["0", "move_begin_or_add_integer_argument_zero"],
|
||||||
|
["1", "add_integer_argument_digit", 1],
|
||||||
|
["2", "add_integer_argument_digit", 2],
|
||||||
|
["3", "add_integer_argument_digit", 3],
|
||||||
|
["4", "add_integer_argument_digit", 4],
|
||||||
|
["5", "add_integer_argument_digit", 5],
|
||||||
|
["6", "add_integer_argument_digit", 6],
|
||||||
|
["7", "add_integer_argument_digit", 7],
|
||||||
|
["8", "add_integer_argument_digit", 8],
|
||||||
|
["9", "add_integer_argument_digit", 9]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"insert": {
|
"insert": {
|
||||||
|
|
|
@ -2961,6 +2961,24 @@ pub const Editor = struct {
|
||||||
}
|
}
|
||||||
pub const delete_word_left_meta: Meta = .{ .description = "Delete previous word" };
|
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_buffer_begin(self: *Self, _: Context) Result {
|
||||||
|
const b = try self.buf_for_update();
|
||||||
|
const text, const root = try self.cut_to(move_cursor_buffer_begin, b.root);
|
||||||
|
self.set_clipboard_internal(text);
|
||||||
|
try self.update_buf(root);
|
||||||
|
self.clamp();
|
||||||
|
}
|
||||||
|
pub const cut_buffer_begin_meta: Meta = .{ .description = "Cut to the beginning of the buffer (copies cut text into clipboard)" };
|
||||||
|
|
||||||
pub fn cut_word_left_vim(self: *Self, _: Context) Result {
|
pub fn cut_word_left_vim(self: *Self, _: Context) Result {
|
||||||
const b = try self.buf_for_update();
|
const b = try self.buf_for_update();
|
||||||
const text, const root = try self.cut_to(move_cursor_word_left_vim, b.root);
|
const text, const root = try self.cut_to(move_cursor_word_left_vim, b.root);
|
||||||
|
@ -4754,6 +4772,14 @@ pub const Editor = struct {
|
||||||
}
|
}
|
||||||
pub const find_query_meta: Meta = .{ .arguments = &.{.string} };
|
pub const find_query_meta: Meta = .{ .arguments = &.{.string} };
|
||||||
|
|
||||||
|
pub fn find_word_at_cursor(self: *Self, ctx: Context) Result {
|
||||||
|
_ = ctx;
|
||||||
|
const query: []const u8 = try self.copy_word_at_cursor(self.allocator);
|
||||||
|
try self.find_in_buffer(query);
|
||||||
|
self.allocator.free(query);
|
||||||
|
}
|
||||||
|
pub const find_word_at_cursor_meta: Meta = .{ .description = "Search for the word under the cursor" };
|
||||||
|
|
||||||
fn find_in(self: *Self, query: []const u8, comptime find_f: ripgrep.FindF, write_buffer: bool) !void {
|
fn find_in(self: *Self, query: []const u8, comptime find_f: ripgrep.FindF, write_buffer: bool) !void {
|
||||||
const root = try self.buf_root();
|
const root = try self.buf_root();
|
||||||
self.cancel_all_matches();
|
self.cancel_all_matches();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue