Open 0x2CA opened 2 months ago
editor::ToggleComments
.g ]
and g [
ctrl-w
ones make sense.] x
and [x
we already have: https://github.com/zed-industries/zed/blob/6f59515dd1f2823d58c34942df82e8e8d21035cd/assets/keymaps/vim.json#L370-L371The space
ones I'm not so sure about, since space
as a leader is a bit of a custom thing and I don't think we should introduce space
as a default-leader thing (I personally use ,
)
@mrnugget
ToggleComments also missing gC
functions such as gCi}
current [ x
and ] x
only in normal ,Unable to expand selection
about the Leader key
First PR here: https://github.com/zed-industries/zed/pull/10461
For the other bindings (ctrl-w ...
and space
), I'm curious what @ConradIrwin and @baldwindavid think
@mrnugget
g c
and g c c
so those are a welcome addition.space
keybindings. I use space
as my leader key for my own bindings, but think we need to have some sort of leader support before defaulting anything with a leader key. Would be nice if we could configure a leader key in settings and then was available in the keymap as something like $ZED_LEADER
. Similarly, would like to be able to access $ZED_FILE
, $ZED_ROW
, etc in keymaps, like we can in tasks.ctrl-w *
keybindings in vim so don't have much of an opinion.Regarding the unimpaired style ] x
and [ x
, I learned a really cool trick from #9244 - Not really suggesting as a default, but I've been using it a lot.
{
"context": "Editor && vim_mode == visual && !VimWaiting && !menu",
"bindings": {
"v": "editor::SelectLargerSyntaxNode",
"V": "editor::SelectSmallerSyntaxNode"
}
},
Agreed with not having default bindings with a space so everyone has somewhere they can stash their own things.
For panels we've started the convention of :X
opening them, so we could add :Blame
for git blame (and ensure that :B
selects that) and :Projects
for recent projects? (similarly :P
). Will work fine until we get up to 26 panes and panels (assuming we name them carefully :D).
I think ctrl-w t
is not the right "builtin" shortcut for that (use :T
or :te
, or ctrl-w j
once it's open). ctrl-w t
is a vim shortcut (though probably not a zed compatible one)
ctrl-w z
could work for zoom. I'm not sure we'll ever build vim-style preview panes, so it's probably ok to reuse. I'd also be open to another key, but ctrl-w
is pretty full already, so maybe that's the best option.
@ConradIrwin
Though you cannot operate on arbitrary objects yet, but it is possible to implement gco
and gcO
in a simple way.
{
"context": "Editor && vim_mode == normal && !VimWaiting",
"bindings": {
"g c o": ["workspace::SendKeystrokes", "o escape g c c shift-a"],
"g c shift-o": [
"workspace::SendKeystrokes",
"shift-o escape g c c shift-a"
]
}
}
I think we can take the same general approach for gc
as we just did for >
where we have a vim wrapper that sets up the selection, calls the editor command, and restores the selection where we want it.
We'll also need to build the gc
object to make it work really well though.
Check for existing issues
Describe the feature
If applicable, add mockups / screenshots to help present your vision of the feature
No response