added * command in vim mode
This commit is contained in:
parent
7c51fa8400
commit
acded15af8
2 changed files with 10 additions and 1 deletions
|
@ -86,6 +86,7 @@
|
|||
["<C-y>", "redo"],
|
||||
|
||||
["/", "find"],
|
||||
["*", "find_word_at_cursor"],
|
||||
|
||||
["<C-k>", "TODO"],
|
||||
|
||||
|
@ -187,7 +188,7 @@
|
|||
["mW", "set_global_mark", 87],
|
||||
["mX", "set_global_mark", 88],
|
||||
["mY", "set_global_mark", 89],
|
||||
["mZ", "set_global_mark", 90]
|
||||
["mZ", "set_global_mark", 90],
|
||||
|
||||
["'A", "goto_global_mark", 65],
|
||||
["'B", "goto_global_mark", 66],
|
||||
|
|
|
@ -4772,6 +4772,14 @@ pub const Editor = struct {
|
|||
}
|
||||
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 {
|
||||
const root = try self.buf_root();
|
||||
self.cancel_all_matches();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue